mirror of https://github.com/waku-org/js-waku.git
3 lines
2.1 MiB
3 lines
2.1 MiB
/*! For license information please see main.dea5c94f.js.LICENSE.txt */
|
|
(()=>{var __webpack_modules__={5345:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.proto=t.StoreCodec=t.WakuStore=t.PageDirection=t.waku_store=t.RelayCodecs=t.WakuRelay=t.waku_relay=t.PushResponse=t.LightPushCodec=t.WakuLightPush=t.waku_light_push=t.getPublicKey=t.generateSymmetricKey=t.generatePrivateKey=t.WakuMessage=t.waku_message=t.DefaultPubSubTopic=t.Waku=t.waku=t.utils=t.enr=t.discovery=t.getNodesFromHostedJson=void 0;var s=r(15117);Object.defineProperty(t,"getNodesFromHostedJson",{enumerable:!0,get:function(){return s.getNodesFromHostedJson}}),t.discovery=o(r(15117)),t.enr=o(r(38509)),t.utils=o(r(23677)),t.waku=o(r(84109));var a=r(84109);Object.defineProperty(t,"Waku",{enumerable:!0,get:function(){return a.Waku}}),Object.defineProperty(t,"DefaultPubSubTopic",{enumerable:!0,get:function(){return a.DefaultPubSubTopic}}),t.waku_message=o(r(41995));var u=r(41995);Object.defineProperty(t,"WakuMessage",{enumerable:!0,get:function(){return u.WakuMessage}});var c=r(2469);Object.defineProperty(t,"generatePrivateKey",{enumerable:!0,get:function(){return c.generatePrivateKey}}),Object.defineProperty(t,"generateSymmetricKey",{enumerable:!0,get:function(){return c.generateSymmetricKey}}),Object.defineProperty(t,"getPublicKey",{enumerable:!0,get:function(){return c.getPublicKey}}),t.waku_light_push=o(r(37167));var h=r(37167);Object.defineProperty(t,"WakuLightPush",{enumerable:!0,get:function(){return h.WakuLightPush}}),Object.defineProperty(t,"LightPushCodec",{enumerable:!0,get:function(){return h.LightPushCodec}}),Object.defineProperty(t,"PushResponse",{enumerable:!0,get:function(){return h.PushResponse}}),t.waku_relay=o(r(84507));var l=r(84507);Object.defineProperty(t,"WakuRelay",{enumerable:!0,get:function(){return l.WakuRelay}}),Object.defineProperty(t,"RelayCodecs",{enumerable:!0,get:function(){return l.RelayCodecs}}),t.waku_store=o(r(28026));var f=r(28026);Object.defineProperty(t,"PageDirection",{enumerable:!0,get:function(){return f.PageDirection}}),Object.defineProperty(t,"WakuStore",{enumerable:!0,get:function(){return f.WakuStore}}),Object.defineProperty(t,"StoreCodec",{enumerable:!0,get:function(){return f.StoreCodec}}),t.proto=o(r(12187))},36559:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Bootstrap=void 0;const i=n(r(39287)),o=r(57604),s=r(80470),a=r(15117),u=i.default("waku:discovery:bootstrap");class c{constructor(e){var t;const r=null!==(t=e.maxPeers)&&void 0!==t?t:c.DefaultMaxPeers;if(e.default)u("Use hosted list of peers."),this.getBootstrapPeers=a.getNodesFromHostedJson.bind({},void 0,void 0,r);else if(void 0!==e.peers&&e.peers.length>0){u("Use provided list of peers.");const t=e.peers.map((e=>new o.Multiaddr(e))),n=a.getPseudoRandomSubset(t,r);this.getBootstrapPeers=()=>Promise.resolve(n)}else if("function"===typeof e.getPeers){u("Bootstrap: Use provided getPeers function.");const t=e.getPeers;this.getBootstrapPeers=async()=>{const e=await t();return a.getPseudoRandomSubset(e,r).map((e=>new o.Multiaddr(e)))}}else if(e.enrUrl){const t=e.enrUrl;u("Use provided EIP-1459 ENR Tree URL.");const n=s.DnsNodeDiscovery.dnsOverHttp();this.getBootstrapPeers=async()=>{const e=await n.getPeers(r,[t]);return u("Found ".concat(e.length," peers")),e.map((e=>e.getFullMultiaddrs())).flat()}}else u("No bootstrap method specified, no peer will be returned"),this.getBootstrapPeers=void 0}}t.Bootstrap=c,c.DefaultMaxPeers=1},80470:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DnsNodeDiscovery=void 0;const i=n(r(26801)),o=r(39287),s=r(38509),a=r(8250),u=r(50737),c=o.debug("waku:discovery:dns");class h{constructor(e){this._errorTolerance=10,this._DNSTreeCache={},this.dns=e}static dnsOverHttp(e){const t=new a.DnsOverHttps(e);return new h(t)}async getPeers(e,t){let r=0;const n=[],i=Math.floor(Math.random()*t.length),{publicKey:o,domain:s}=u.ENRTree.parseTree(t[i]);for(;n.length<e&&r<e+this._errorTolerance;){const e={domain:s,publicKey:o,visits:{}},t=await this._search(s,e);t&&l(t,n)&&(n.push(t),c("got new peer candidate from DNS address=".concat(t.nodeId,"@").concat(t.ip))),r++}return n}async _search(e,t){const r=await this._getTXTRecord(e,t);let n,i;t.visits[e]=!0;const o=function(e){return e.startsWith(u.ENRTree.ROOT_PREFIX)?u.ENRTree.ROOT_PREFIX:e.startsWith(u.ENRTree.BRANCH_PREFIX)?u.ENRTree.BRANCH_PREFIX:e.startsWith(u.ENRTree.RECORD_PREFIX)?u.ENRTree.RECORD_PREFIX:""}(r);try{switch(o){case u.ENRTree.ROOT_PREFIX:return n=u.ENRTree.parseAndVerifyRoot(r,t.publicKey),await this._search(n,t);case u.ENRTree.BRANCH_PREFIX:return i=u.ENRTree.parseBranch(r),n=function(e,t){const r={};for(const[i,o]of e.entries())t.visits[o]&&(r[i]=!0);if(Object.keys(r).length===e.length)throw new Error("Unresolvable circular path detected");let n;do{n=Math.floor(Math.random()*e.length)}while(r[n]);return e[n]}(i,t),await this._search(n,t);case u.ENRTree.RECORD_PREFIX:return s.ENR.decodeTxt(r);default:return null}}catch(a){return c("Failed to search DNS tree ".concat(o," at subdomain ").concat(e,": ").concat(a)),null}}async _getTXTRecord(e,t){if(this._DNSTreeCache[e])return this._DNSTreeCache[e];const r=e!==t.domain?"".concat(e,".").concat(t.domain):t.domain,n=await this.dns.resolveTXT(r);i.default(n.length,"Received empty result array while fetching TXT record"),i.default(n[0].length,"Received empty TXT record");const o=n.join("");return this._DNSTreeCache[e]=o,o}}function l(e,t){if(!e||!e.nodeId)return!1;for(const r of t)if(e.nodeId===r.nodeId)return!1;return!0}t.DnsNodeDiscovery=h},8250:(e,t,r)=>{"use strict";var n=r(29536).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.DnsOverHttps=void 0;const i=r(3205),{cloudflare:o,google:s,opendns:a}=i.endpoints;t.DnsOverHttps=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[o,s,a];this.endpoints=e}async resolveTXT(e){const t=(await i.query({questions:[{type:"TXT",name:e}]})).answers.map((e=>e.data)),r=[];return t.forEach((e=>{"string"===typeof e?r.push(e):Array.isArray(e)?e.forEach((e=>{"string"===typeof e?r.push(e):r.push(n.from(e).toString("utf-8"))})):r.push(n.from(e).toString("utf-8"))})),r}}},50737:function(e,t,r){"use strict";var n=r(29536).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ENRTree=void 0;const u=a(r(26801)),c=a(r(39390)),h=s(r(93478)),l=r(44846),f=r(38509),d=r(23677);class p{static parseAndVerifyRoot(e,t){u.default(e.startsWith(this.ROOT_PREFIX),"ENRTree root entry must start with '".concat(this.ROOT_PREFIX,"'"));const r=p.parseRootValues(e),i=h.decode.asBytes(t),o=e.split(" sig")[0],s=n.from(o),a=c.default.toBuffer(r.signature).slice(0,64),f=n.from(i),y=l.ecdsaVerify(a,d.keccak256Buf(s),f);return u.default(y,"Unable to verify ENRTree root signature"),r.eRoot}static parseRootValues(e){const t=e.match(/^enrtree-root:v1 e=([^ ]+) l=([^ ]+) seq=(\d+) sig=([^ ]+)$/);u.default.ok(Array.isArray(t),"Could not parse ENRTree root entry"),t.shift();const[r,n,i,o]=t;return u.default.ok(r,"Could not parse 'e' value from ENRTree root entry"),u.default.ok(n,"Could not parse 'l' value from ENRTree root entry"),u.default.ok(i,"Could not parse 'seq' value from ENRTree root entry"),u.default.ok(o,"Could not parse 'sig' value from ENRTree root entry"),{eRoot:r,lRoot:n,seq:Number(i),signature:o}}static parseTree(e){u.default(e.startsWith(this.TREE_PREFIX),"ENRTree tree entry must start with '".concat(this.TREE_PREFIX,"'"));const t=e.match(/^enrtree:\/\/([^@]+)@(.+)$/);u.default.ok(Array.isArray(t),"Could not parse ENRTree tree entry"),t.shift();const[r,n]=t;return u.default.ok(r,"Could not parse public key from ENRTree tree entry"),u.default.ok(n,"Could not parse domain from ENRTree tree entry"),{publicKey:r,domain:n}}static parseBranch(e){return u.default(e.startsWith(this.BRANCH_PREFIX),"ENRTree branch entry must start with '".concat(this.BRANCH_PREFIX,"'")),e.split(this.BRANCH_PREFIX)[1].split(",")}}t.ENRTree=p,p.RECORD_PREFIX=f.ENR.RECORD_PREFIX,p.TREE_PREFIX="enrtree:",p.BRANCH_PREFIX="enrtree-branch:",p.ROOT_PREFIX="enrtree-root:"},76763:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getNodesFromHostedJson=void 0;const i=n(r(27229)),o=n(r(39287)),s=r(57604),a=r(15117),u=o.default("waku:discovery");t.getNodesFromHostedJson=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["fleets","wakuv2.prod","waku-websocket"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://fleets.status.im/",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(r<=0)return[];const n=await i.default.get(t,{headers:{"Content-Type":"application/json"}});let o=n.data;for(const i of e){if(void 0===o[i])throw u("Failed to retrieve bootstrap nodes: ".concat(i," does not exist on "),o),"Failed to retrieve bootstrap nodes: ".concat(i," does not exist on ").concat(JSON.stringify(o));o=o[i]}if(Array.isArray(o))return a.getPseudoRandomSubset(o,r).map((e=>new s.Multiaddr(e)));if("string"===typeof o)return[new s.Multiaddr(o)];if("object"===typeof o)return o=Object.values(o),o=o.map((e=>new s.Multiaddr(e))),a.getPseudoRandomSubset(o,r);throw"Failed to retrieve bootstrap nodes: response format is not supported: ".concat(JSON.stringify(o))}},15117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPseudoRandomSubset=t.ENRTree=t.DnsOverHttps=t.DnsNodeDiscovery=t.Bootstrap=t.getNodesFromHostedJson=void 0;const n=r(56785);var i=r(76763);Object.defineProperty(t,"getNodesFromHostedJson",{enumerable:!0,get:function(){return i.getNodesFromHostedJson}});var o=r(36559);Object.defineProperty(t,"Bootstrap",{enumerable:!0,get:function(){return o.Bootstrap}});var s=r(80470);Object.defineProperty(t,"DnsNodeDiscovery",{enumerable:!0,get:function(){return s.DnsNodeDiscovery}});var a=r(8250);Object.defineProperty(t,"DnsOverHttps",{enumerable:!0,get:function(){return a.DnsOverHttps}});var u=r(50737);Object.defineProperty(t,"ENRTree",{enumerable:!0,get:function(){return u.ENRTree}}),t.getPseudoRandomSubset=function(e,t){return e.length<=t?e:n.shuffle(e).slice(0,t)}},6917:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MULTIADDR_LENGTH_SIZE=t.ERR_NO_SIGNATURE=t.ERR_INVALID_ID=t.MAX_RECORD_SIZE=void 0,t.MAX_RECORD_SIZE=300,t.ERR_INVALID_ID="Invalid record id",t.ERR_NO_SIGNATURE="No valid signature found",t.MULTIADDR_LENGTH_SIZE=2},21983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createNodeId=void 0;const n=r(23677);t.createNodeId=function(e){if(32!==e.length)throw new Error("NodeId must be 32 bytes in length");return n.bufToHex(e)}},94004:function(e,t,r){"use strict";var n=r(29536).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ENR=void 0;const u=a(r(39390)),c=r(17786),h=r(57604),l=a(r(52442)),f=s(r(37950)),d=r(16980),p=r(6917),y=r(57658),g=s(r(86455));class m extends Map{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;super(Object.entries(e)),this.seq=t,this.signature=r}static createV4(e){return new m({...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},id:n.from("v4"),secp256k1:e})}static createFromPeerId(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=y.createKeypairFromPeerId(e);if(r.type===y.KeypairType.secp256k1)return m.createV4(r.publicKey,t);throw new Error}static decodeFromValues(e){if(!Array.isArray(e))throw new Error("Decoded ENR must be an array");if(e.length%2!==0)throw new Error("Decoded ENR must have an even number of elements");const[t,r,...i]=e;if(!t||Array.isArray(t))throw new Error("Decoded ENR invalid signature: must be a byte array");if(!r||Array.isArray(r))throw new Error("Decoded ENR invalid sequence number: must be a byte array");const o={};for(let a=0;a<i.length;a+=2)o[i[a].toString()]=n.from(i[a+1]);const s=new m(o,c.toBigIntBE(r),t);if(!s.verify(f.encode([r,...i]),t))throw new Error("Unable to verify ENR signature");return s}static decode(e){const t=f.decode(e);return m.decodeFromValues(t)}static decodeTxt(e){if(!e.startsWith(this.RECORD_PREFIX))throw new Error("\"string encoded ENR must start with '".concat(this.RECORD_PREFIX,"'"));return m.decode(u.default.toBuffer(e.slice(4)))}set(e,t){return this.signature=null,this.seq++,super.set(e,t)}get id(){const e=this.get("id");if(!e)throw new Error("id not found.");return e.toString("utf8")}get keypairType(){if("v4"===this.id)return y.KeypairType.secp256k1;throw new Error(p.ERR_INVALID_ID)}get publicKey(){if("v4"===this.id)return this.get("secp256k1");throw new Error(p.ERR_INVALID_ID)}get keypair(){return y.createKeypair(this.keypairType,void 0,this.publicKey)}get peerId(){return y.createPeerIdFromKeypair(this.keypair)}get nodeId(){if("v4"===this.id)return g.nodeId(this.publicKey);throw new Error(p.ERR_INVALID_ID)}get ip(){const e=this.get("ip");return e?l.default.toString(h.protocols.names.ip4.code,e):void 0}set ip(e){e?this.set("ip",l.default.toBytes(h.protocols.names.ip4.code,e)):this.delete("ip")}get tcp(){const e=this.get("tcp");return e?Number(l.default.toString(h.protocols.names.tcp.code,e)):void 0}set tcp(e){void 0===e?this.delete("tcp"):this.set("tcp",l.default.toBytes(h.protocols.names.tcp.code,e))}get udp(){const e=this.get("udp");return e?Number(l.default.toString(h.protocols.names.udp.code,e)):void 0}set udp(e){void 0===e?this.delete("udp"):this.set("udp",l.default.toBytes(h.protocols.names.udp.code,e))}get ip6(){const e=this.get("ip6");return e?l.default.toString(h.protocols.names.ip6.code,e):void 0}set ip6(e){e?this.set("ip6",l.default.toBytes(h.protocols.names.ip6.code,e)):this.delete("ip6")}get tcp6(){const e=this.get("tcp6");return e?Number(l.default.toString(h.protocols.names.tcp.code,e)):void 0}set tcp6(e){void 0===e?this.delete("tcp6"):this.set("tcp6",l.default.toBytes(h.protocols.names.tcp.code,e))}get udp6(){const e=this.get("udp6");return e?Number(l.default.toString(h.protocols.names.udp.code,e)):void 0}set udp6(e){void 0===e?this.delete("udp6"):this.set("udp6",l.default.toBytes(h.protocols.names.udp.code,e))}get multiaddrs(){const e=this.get("multiaddrs");if(e){const r=[];try{let t=0;for(;t<e.length;){const i=e.slice(t,t+2),o=n.from(i).readUInt16BE(0),s=e.slice(t+p.MULTIADDR_LENGTH_SIZE,t+o+p.MULTIADDR_LENGTH_SIZE),a=new h.Multiaddr(s);r.push(a),t+=o+p.MULTIADDR_LENGTH_SIZE}}catch(t){throw new Error("Invalid value in multiaddrs field")}return r}}set multiaddrs(e){if(void 0===e)this.delete("multiaddrs");else{let t=n.from([]);e.forEach((e=>{if(e.getPeerId())throw new Error("`multiaddr` field MUST not contain peer id");const r=e.bytes;let i=n.alloc(2);if(i.writeUInt16BE(r.length,0)!==p.MULTIADDR_LENGTH_SIZE)throw new Error("Internal error: unsigned 16-bit integer was not written in ".concat(p.MULTIADDR_LENGTH_SIZE," bytes"));i=n.concat([i,r]),t=n.concat([t,i])})),this.set("multiaddrs",t)}}getLocationMultiaddr(e){if("udp"===e)return this.getLocationMultiaddr("udp4")||this.getLocationMultiaddr("udp6");if("tcp"===e)return this.getLocationMultiaddr("tcp4")||this.getLocationMultiaddr("tcp6");const t=e.endsWith("6"),r=this.get(t?"ip6":"ip");if(!r)return;const n=e.startsWith("udp"),i=e.startsWith("tcp");let o,s;if(n)o="udp",s=t?this.get("udp6"):this.get("udp");else{if(!i)return;o="tcp",s=t?this.get("tcp6"):this.get("tcp")}if(!s)return;const a=h.protocols.names[t?"ip6":"ip4"],u=a.size/8,c=h.protocols.names[o],l=d.encode(c.code),f=new Uint8Array(3+u+l.length);return f[0]=a.code,f.set(r,1),f.set(l,1+u),f.set(s,1+u+l.length),new h.Multiaddr(f)}setLocationMultiaddr(e){const t=e.protoNames();if(2!==t.length&&"udp"!==t[1]&&"tcp"!==t[1])throw new Error("Invalid multiaddr");const r=e.tuples();if(!r[0][1]||!r[1][1])throw new Error("Invalid multiaddr");4===r[0][0]?(this.set("ip",r[0][1]),this.set(t[1],r[1][1])):(this.set("ip6",r[0][1]),this.set(t[1]+"6",r[1][1]))}getFullMultiaddr(e){const t=this.getLocationMultiaddr(e);if(t)return t.encapsulate("/p2p/".concat(this.peerId.toB58String()))}getFullMultiaddrs(){return this.multiaddrs?this.multiaddrs.map((e=>e.encapsulate("/p2p/".concat(this.peerId.toB58String())))):[]}verify(e,t){if(!this.get("id")||"v4"!==this.id)throw new Error(p.ERR_INVALID_ID);if(!this.publicKey)throw new Error("Failed to verify ENR: No public key");return g.verify(this.publicKey,e,t)}sign(e,t){if("v4"!==this.id)throw new Error(p.ERR_INVALID_ID);return this.signature=g.sign(t,e),this.signature}encodeToValues(e){const t=Array.from(this.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>[e,this.get(e)])).flat();if(t.unshift(Number(this.seq)),e)t.unshift(this.sign(f.encode(t),e));else{if(!this.signature)throw new Error(p.ERR_NO_SIGNATURE);t.unshift(this.signature)}return t}encode(e){const t=f.encode(this.encodeToValues(e));if(t.length>=p.MAX_RECORD_SIZE)throw new Error("ENR must be less than 300 bytes");return t}encodeTxt(e){return m.RECORD_PREFIX+u.default.encode(this.encode(e))}}t.ENR=m,m.RECORD_PREFIX="enr:"},38509:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.v4=void 0;const a=o(r(86455));t.v4=a,s(r(6917),t),s(r(94004),t),s(r(18982),t),s(r(21983),t),s(r(57658),t)},51338:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERR_INVALID_KEYPAIR_TYPE=t.ERR_TYPE_NOT_IMPLEMENTED=void 0,t.ERR_TYPE_NOT_IMPLEMENTED="Keypair type not implemented",t.ERR_INVALID_KEYPAIR_TYPE="Invalid keypair type"},57658:function(e,t,r){"use strict";var n=r(29536).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createKeypairFromPeerId=t.createPeerIdFromKeypair=t.createKeypair=t.generateKeypair=void 0;const a=r(25137),u=s(r(15218)),c=s(r(96732)),{keysPBM:h,supportedKeys:l}=a.keys,f=r(51338),d=r(48639),p=r(78382);function y(e,t,r){if(e===p.KeypairType.secp256k1)return new d.Secp256k1Keypair(t,r);throw new Error(f.ERR_TYPE_NOT_IMPLEMENTED)}o(r(78382),t),o(r(48639),t),t.generateKeypair=async function(e){if(e===p.KeypairType.secp256k1)return await d.Secp256k1Keypair.generate();throw new Error(f.ERR_TYPE_NOT_IMPLEMENTED)},t.createKeypair=y,t.createPeerIdFromKeypair=function(e){if(e.type===p.KeypairType.secp256k1){const t=e.hasPrivateKey()?new l.secp256k1.Secp256k1PrivateKey(e.privateKey,e.publicKey):void 0,r=new l.secp256k1.Secp256k1PublicKey(e.publicKey),n=u.default.encode(r.bytes,"identity");return new c.default(n,t,r)}throw new Error(f.ERR_TYPE_NOT_IMPLEMENTED)},t.createKeypairFromPeerId=function(e){const t=h.PublicKey.decode(e.pubKey.bytes);return y(t.Type,e.privKey?n.from(e.privKey.marshal()):void 0,n.from(t.Data))}},48639:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Secp256k1Keypair=t.secp256k1PublicKeyToRaw=t.secp256k1PublicKeyToFull=t.secp256k1PublicKeyToCompressed=void 0;const a=r(29536),u=s(r(86433)),c=o(r(44846)),h=r(78382);function l(e){return 64===e.length&&(e=a.Buffer.concat([a.Buffer.from([4]),e])),a.Buffer.from(c.publicKeyConvert(e,!0))}t.secp256k1PublicKeyToCompressed=l,t.secp256k1PublicKeyToFull=function(e){return 64===e.length?a.Buffer.concat([a.Buffer.from([4]),e]):a.Buffer.from(c.publicKeyConvert(e,!1))},t.secp256k1PublicKeyToRaw=function(e){return a.Buffer.from(c.publicKeyConvert(e,!1).slice(1))};const f=class e extends h.AbstractKeypair{constructor(e,t){let r=t;r&&(r=l(r)),super(e,r),this.type=h.KeypairType.secp256k1}static async generate(){const t=a.Buffer.from(await function(e){if("undefined"!==typeof window&&window&&window.crypto){const t=new Uint8Array(e);return window.crypto.getRandomValues(t),t}return u.default.randomBytes(e)}(32)),r=c.publicKeyCreate(t);return new e(t,a.Buffer.from(r))}privateKeyVerify(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._privateKey;return!e||c.privateKeyVerify(e)}publicKeyVerify(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._publicKey;return!e||c.publicKeyVerify(e)}sign(e){const{signature:t,recid:r}=c.ecdsaSign(e,this.privateKey);return a.Buffer.concat([t,a.Buffer.from([r])])}verify(e,t){return c.ecdsaVerify(t,e,this.publicKey)}};t.Secp256k1Keypair=f},78382:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractKeypair=t.KeypairType=void 0,function(e){e[e.rsa=0]="rsa",e[e.ed25519=1]="ed25519",e[e.secp256k1=2]="secp256k1"}(t.KeypairType||(t.KeypairType={}));t.AbstractKeypair=class{constructor(e,t){if((this._privateKey=e)&&!this.privateKeyVerify())throw new Error("Invalid private key");if((this._publicKey=t)&&!this.publicKeyVerify())throw new Error("Invalid private key")}get privateKey(){if(!this._privateKey)throw new Error;return this._privateKey}get publicKey(){if(!this._publicKey)throw new Error;return this._publicKey}privateKeyVerify(){return!0}publicKeyVerify(){return!0}hasPrivateKey(){return Boolean(this._privateKey)}}},18982:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},86455:function(e,t,r){"use strict";var n=r(29536).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ENRKeyPair=t.nodeId=t.verify=t.sign=t.publicKey=t.createPrivateKey=t.hash=void 0;const u=a(r(86433)),c=r(46541),h=s(r(44846)),l=r(21983);function f(e){return n.from(c.keccak256.arrayBuffer(e))}async function d(){return n.from(await function(e){if("undefined"!==typeof window&&window&&window.crypto){const t=new Uint8Array(e);return window.crypto.getRandomValues(t),t}return u.default.randomBytes(e)}(32))}function p(e){return n.from(h.publicKeyCreate(e))}function y(e,t){const{signature:r}=h.ecdsaSign(f(t),e);return n.from(r)}function g(e,t,r){return h.ecdsaVerify(r.slice(0,64),f(t),e)}function m(e){const t=h.publicKeyConvert(e,!1);return l.createNodeId(f(t.slice(1)))}t.hash=f,t.createPrivateKey=d,t.publicKey=p,t.sign=y,t.verify=g,t.nodeId=m;class b{constructor(e,t,r){this.nodeId=e,this.privateKey=t,this.publicKey=r}static async create(e){if(e&&!h.privateKeyVerify(e))throw new Error("Invalid private key");const t=e||await d(),r=p(t),n=m(r);return new b(n,t,r)}sign(e){return y(this.privateKey,e)}verify(e,t){return g(this.publicKey,e,t)}}t.ENRKeyPair=b},950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPeersForProtocol=t.selectRandomPeer=void 0,t.selectRandomPeer=function(e){if(0===e.length)return;return e[Math.round(Math.random()*(e.length-1))]},t.getPeersForProtocol=function(e,t){return Array.from(e.peerStore.peers.values()).filter((e=>e.protocols.includes(t)))}},23677:(e,t,r)=>{"use strict";var n=r(29536).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256Buf=t.equalByteArrays=t.bufToHex=t.hexToBuf=void 0;const i=r(46541);function o(e){return"string"===typeof e?n.from(e.replace(/^0x/i,""),"hex"):n.from(e)}t.hexToBuf=o,t.bufToHex=function(e){return n.from(e).toString("hex")},t.equalByteArrays=function(e,t){let r,i;return r="string"===typeof e?o(e):n.from(e),i="string"===typeof t?o(t):n.from(t),0===r.compare(i)},t.keccak256Buf=function(e){return n.from(i.keccak256.arrayBuffer(e))}},84109:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Waku=t.DefaultPubSubTopic=t.DefaultRelayKeepAliveValueSecs=t.DefaultPingKeepAliveValueSecs=void 0;const i=r(72913),o=n(r(39287)),s=n(r(30717)),a=n(r(80642)),u=n(r(94149)),c=n(r(70585)),h=n(r(81842)),l=n(r(32084)),f=r(57604),d=n(r(96732)),p=r(15117),y=r(950),g=r(37167),m=r(41995),b=r(84507),v=r(16075),w=r(28026),_=c.default.prototype[Symbol.toStringTag];t.DefaultPingKeepAliveValueSecs=0,t.DefaultRelayKeepAliveValueSecs=300,t.DefaultPubSubTopic="/waku/2/default-waku/proto";const E=o.default("waku:waku");class S{constructor(e,r,n,i){var o;this.libp2p=r,this.relay=r.pubsub,this.store=n,this.lightPush=i,this.pingKeepAliveTimers={},this.relayKeepAliveTimers={};const s=e.pingKeepAlive||t.DefaultPingKeepAliveValueSecs,a=e.relayKeepAlive||t.DefaultRelayKeepAliveValueSecs;r.connectionManager.on("peer:connect",(e=>{this.startKeepAlive(e.remotePeer,s,a)})),r.connectionManager.on("peer:disconnect",(e=>{this.stopKeepAlive(e.remotePeer)})),null===e||void 0===e||null===(o=e.decryptionKeys)||void 0===o||o.forEach((e=>{this.addDecryptionKey(e)}))}static async create(e){var t,r,n;const o=Object.assign({},null===e||void 0===e?void 0:e.libp2p);if(o.config=Object.assign({transport:{[_]:{filter:h.default.all}}},null===e||void 0===e||null===(t=e.libp2p)||void 0===t?void 0:t.config),null!==e&&void 0!==e&&e.pubSubTopic&&(o.config.pubsub=Object.assign({pubSubTopic:e.pubSubTopic},o.config.pubsub)),o.modules=Object.assign({},null===e||void 0===e||null===(r=e.libp2p)||void 0===r?void 0:r.modules),o.modules=Object.assign({transport:[c.default]},null===e||void 0===e||null===(n=e.libp2p)||void 0===n?void 0:n.modules),o.modules=Object.assign(o.modules,{streamMuxer:[u.default],connEncryption:[new i.Noise(null===e||void 0===e?void 0:e.staticNoiseKey)],pubsub:b.WakuRelay}),null!==e&&void 0!==e&&e.bootstrap){const t=new p.Bootstrap(null===e||void 0===e?void 0:e.bootstrap);if(void 0!==t.getBootstrapPeers)try{const e=await t.getBootstrapPeers();o.modules=Object.assign(o.modules,{peerDiscovery:[a.default]}),o.config.peerDiscovery={[a.default.tag]:{list:e,enabled:!0}}}catch(y){E("Failed to retrieve bootstrap nodes",y)}}const l=await s.default.create(o),f=new w.WakuStore(l,{pubSubTopic:null===e||void 0===e?void 0:e.pubSubTopic}),d=new g.WakuLightPush(l);return await l.start(),new S(e||{},l,f,d)}async dial(e){return this.libp2p.dialProtocol(e,[w.StoreCodec].concat(b.RelayCodecs))}addPeerToAddressBook(e,t){let r;r="string"===typeof e?d.default.createFromB58String(e):e;const n=t.map((e=>"string"===typeof e?f.multiaddr(e):e));this.libp2p.peerStore.addressBook.set(r,n)}async stop(){return this.libp2p.stop()}addDecryptionKey(e,t){this.relay.addDecryptionKey(e,t),this.store.addDecryptionKey(e,t)}deleteDecryptionKey(e){this.relay.deleteDecryptionKey(e),this.store.deleteDecryptionKey(e)}getLocalMultiaddrWithID(){const e=this.libp2p.multiaddrs.find((e=>e.toString().match(/127\.0\.0\.1/)));if(!e||""===e.toString())throw"Not listening on localhost";return e+"/p2p/"+this.libp2p.peerId.toB58String()}async waitForConnectedPeer(){const e=[[w.StoreCodec],[g.LightPushCodec],b.RelayCodecs];await Promise.all(e.map((e=>{const t=new Array;return e.forEach((e=>{y.getPeersForProtocol(this.libp2p,e).forEach((e=>t.push(e)))})),t.length>0?Promise.resolve():new Promise((t=>{this.libp2p.peerStore.on("change:protocols",(r=>{let{protocols:n}=r;e.forEach((e=>{n.includes(e)&&(E("Resolving for",e,n),t())}))}))}))})))}startKeepAlive(e,t,r){this.stopKeepAlive(e);const n=e.toB58String();0!==t&&(this.pingKeepAliveTimers[n]=setInterval((()=>{l.default(this.libp2p,e)}),1e3*t)),0!==r&&(this.relayKeepAliveTimers[n]=setInterval((()=>{m.WakuMessage.fromBytes(new Uint8Array,v.RelayPingContentTopic).then((e=>this.relay.send(e)))}),1e3*r))}stopKeepAlive(e){const t=e.toB58String();this.pingKeepAliveTimers[t]&&(clearInterval(this.pingKeepAliveTimers[t]),delete this.pingKeepAliveTimers[t]),this.relayKeepAliveTimers[t]&&(clearInterval(this.relayKeepAliveTimers[t]),delete this.relayKeepAliveTimers[t])}}t.Waku=S},37167:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WakuLightPush=t.PushResponse=t.LightPushCodec=void 0;const i=n(r(89554)),o=n(r(4666)),s=n(r(91522)),a=r(39755);Object.defineProperty(t,"PushResponse",{enumerable:!0,get:function(){return a.PushResponse}});const u=r(950),c=r(84109),h=r(96895);t.LightPushCodec="/vac/waku/lightpush/2.0.0-beta1";t.WakuLightPush=class{constructor(e,t){this.libp2p=e,null!==t&&void 0!==t&&t.pubSubTopic?this.pubSubTopic=t.pubSubTopic:this.pubSubTopic=c.DefaultPubSubTopic}async push(e,r){let n;if(null!==r&&void 0!==r&&r.peerId){if(n=this.libp2p.peerStore.get(r.peerId),!n)throw"Peer is unknown"}else n=this.randomPeer;if(!n)throw"No peer available";if(!n.protocols.includes(t.LightPushCodec))throw"Peer does not register waku light push protocol";const a=this.libp2p.connectionManager.get(n.id);if(!a)throw"Failed to get a connection to the peer";const{stream:u}=await a.newStream(t.LightPushCodec);try{const t=null!==r&&void 0!==r&&r.pubSubTopic?r.pubSubTopic:this.pubSubTopic,n=h.PushRPC.createRequest(e,t),a=await s.default([n.encode()],o.default.encode(),u,o.default.decode(),i.default);try{const e=h.PushRPC.decode(a.slice()).response;return e||(console.log("No response in PushRPC"),null)}catch(c){console.log("Failed to decode push reply",c)}}catch(c){console.log("Failed to send waku light push request",c)}return null}get peers(){return u.getPeersForProtocol(this.libp2p,t.LightPushCodec)}get randomPeer(){return u.selectRandomPeer(this.peers)}}},96895:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PushRPC=void 0;const s=r(6018),a=r(48061),u=o(r(39755));class c{constructor(e){this.proto=e}static createRequest(e,t){return new c({requestId:a.v4(),request:{message:e.proto,pubSubTopic:t},response:void 0})}static decode(e){const t=u.PushRPC.decode(s.Reader.create(e));return new c(t)}encode(){return u.PushRPC.encode(this.proto).finish()}get query(){return this.proto.request}get response(){return this.proto.response}}t.PushRPC=c},41995:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WakuMessage=t.DecryptionMethod=void 0;const a=r(29536),u=s(r(39287)),c=r(6018),h=o(r(94326)),l=o(r(2469)),f=u.default("waku:message");var d;!function(e){e.Asymmetric="asymmetric",e.Symmetric="symmetric"}(d=t.DecryptionMethod||(t.DecryptionMethod={}));class p{constructor(e,t,r){this.proto=e,this._signaturePublicKey=t,this._signature=r}static async fromUtf8String(e,t,r){const n=a.Buffer.from(e,"utf-8");return p.fromBytes(n,t,r)}static async fromBytes(e,t,r){var n,i;const{timestamp:o,encPublicKey:s,symKey:a,sigPrivKey:u}=Object.assign({timestamp:new Date},r||{});let c,h=e,f=0;if(s&&a)throw"Pass either `encPublicKey` or `symKey`, not both.";if(s){const e=l.clearEncode(h,u);h=await l.encryptAsymmetric(e.payload,s),c=e.sig,f=1}else if(a){const e=l.clearEncode(h,u);h=await l.encryptSymmetric(e.payload,a),c=e.sig,f=1}return new p({payload:h,timestamp:o.valueOf()/1e3,version:f,contentTopic:t},null===(n=c)||void 0===n?void 0:n.publicKey,null===(i=c)||void 0===i?void 0:i.signature)}static async decode(e,t){const r=h.WakuMessage.decode(c.Reader.create(e));return p.decodeProto(r,t)}static async decodeProto(e,t){if(void 0===e.payload)return void f("Payload is undefined");const r=e.payload;let n,i;if(1===e.version&&e.payload){var o,s;if(void 0===t)return void f("Payload is encrypted but no private keys have been provided.");const a=e=>!!e,u=(await Promise.all(t.map((async t=>{let{key:n,method:i,contentTopics:o}=t;if(!o||e.contentTopic&&o.includes(e.contentTopic))switch(i){case d.Asymmetric:try{return await l.decryptAsymmetric(r,n)}catch(s){return void f("Failed to decrypt message using symmetric encryption despite decryption method being specified",s)}case d.Symmetric:try{return await l.decryptSymmetric(r,n)}catch(s){return void f("Failed to decrypt message using asymmetric encryption despite decryption method being specified",s)}default:try{return await l.decryptSymmetric(r,n)}catch(s){f("Failed to decrypt message using symmetric encryption",s);try{return await l.decryptAsymmetric(r,n)}catch(s){return void f("Failed to decrypt message using asymmetric encryption",s)}}}})))).filter(a);if(0===u.length)return void f("Failed to decrypt payload.");const c=u[0],h=await l.clearDecode(c);if(!h)return void f("Failed to decode payload.");Object.assign(e,{payload:h.payload}),n=null===(o=h.sig)||void 0===o?void 0:o.publicKey,i=null===(s=h.sig)||void 0===s?void 0:s.signature}return new p(e,n,i)}encode(){return h.WakuMessage.encode(this.proto).finish()}get payloadAsUtf8(){return this.proto.payload?a.Buffer.from(this.proto.payload).toString("utf-8"):""}get payload(){return this.proto.payload}get contentTopic(){return this.proto.contentTopic}get version(){return this.proto.version}get timestamp(){if(this.proto.timestamp)return new Date(1e3*this.proto.timestamp)}get signaturePublicKey(){return this._signaturePublicKey}get signature(){return this._signature}}t.WakuMessage=p},45300:(e,t,r)=>{"use strict";var n=r(29536).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.generateIv=t.decrypt=t.encrypt=void 0;const i=r(67171),o=window.crypto||window.msCrypto,s=o.subtle||o.webkitSubtle,a={name:"AES-GCM",length:128};if(void 0===s)throw new Error("Failed to load Subtle CryptoAPI");t.encrypt=async function(e,t,r){return s.importKey("raw",t,a,!1,["encrypt"]).then((t=>s.encrypt({iv:e,...a},t,r))).then(n.from)},t.decrypt=async function(e,t,r){return s.importKey("raw",t,a,!1,["decrypt"]).then((t=>s.decrypt({iv:e,...a},t,r))).then(n.from)},t.generateIv=function(){const e=new Uint8Array(i.IvSize);return o.getRandomValues(e),e}},67171:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.symmetric=t.TagSize=t.IvSize=t.SymmetricKeySize=void 0,t.SymmetricKeySize=32,t.IvSize=12,t.TagSize=16,t.symmetric={},Promise.resolve().then((()=>o(r(45300)))).then((e=>{t.symmetric=e})).catch((e=>{Promise.resolve().then((()=>o(r(60591)))).then((e=>{t.symmetric=e})).catch((t=>{throw"Could not load any symmetric crypto modules: ".concat(e,", ").concat(t)}))}))},60591:(e,t,r)=>{"use strict";var n=r(29536).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.generateIv=t.decrypt=t.encrypt=void 0;const i=r(86433),o=r(67171),s="aes-256-gcm";t.encrypt=async function(e,t,r){const o=i.createCipheriv(s,t,e),a=o.update(r),u=o.final(),c=o.getAuthTag();return n.concat([a,u,c])},t.decrypt=async function(e,t,r){const a=r.length-o.TagSize,u=r.slice(0,a),c=r.slice(a),h=i.createDecipheriv(s,t,e);h.setAuthTag(c);const l=h.update(u),f=h.final();return n.concat([l,f])},t.generateIv=function(){return i.randomBytes(o.IvSize)}},2469:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.getPublicKey=t.generateSymmetricKey=t.generatePrivateKey=t.decryptSymmetric=t.encryptSymmetric=t.decryptAsymmetric=t.encryptAsymmetric=t.clearDecode=t.clearEncode=t.PrivateKeySize=void 0;const s=r(29536),a=o(r(86433)),u=o(r(86066)),c=r(46541),h=o(r(44846)),l=r(23677),f=r(67171);function d(e){return h.publicKeyCreate(e,!1)}function p(e){let t=1;for(let r=e.length;r>=256;r/=256)t++;return t}function y(e){if("undefined"!==typeof window&&window&&window.crypto){const t=new Uint8Array(e);return window.crypto.getRandomValues(t),t}return a.randomBytes(e)}t.PrivateKeySize=32,t.clearEncode=function(e,t){let r=s.Buffer.from([0]);r=function(e,t){const r=p(t);let n=s.Buffer.alloc(4);return n.writeUInt32LE(t.length,0),n=n.slice(0,r),(e=s.Buffer.concat([e,n]))[0]|=r,e}(r,e),r=s.Buffer.concat([r,s.Buffer.from(e)]);let n=1+p(e)+e.length;t&&(n+=65);const i=256-n%256,o=s.Buffer.from(y(i));if(!function(e,t){if(e.length!==t)return!1;return!(t>3&&s.Buffer.from(e).equals(s.Buffer.alloc(e.length)))}(o,i))throw new Error("failed to generate random padding of size "+i);let a;if(r=s.Buffer.concat([r,o]),t){r[0]|=4;const e=c.keccak256(r),n=h.ecdsaSign(l.hexToBuf(e),t);r=s.Buffer.concat([r,n.signature,s.Buffer.from([n.recid])]),a={signature:s.Buffer.from(n.signature),publicKey:d(t)}}return{payload:r,sig:a}},t.clearDecode=function(e){const t=s.Buffer.from(e);let r,n=1;const i=3&t.readUIntLE(0,1);if(0===i)return;const o=t.readUIntLE(n,i);n+=i;const a=t.slice(n,n+o),u=4==(4&t.readUIntLE(0,1));if(u){const e=function(e){return e.slice(e.length-65,e.length)}(t),n=function(e,t){if(t)return c.keccak256(e.slice(0,e.length-65));return c.keccak256(e)}(t,u),i=function(e,t){const r=t.slice(64).readIntBE(0,1);return h.ecdsaRecover(t.slice(0,64),r,l.hexToBuf(e),!1)}(n,e);r={signature:e,publicKey:i}}return{payload:a,sig:r}},t.encryptAsymmetric=async function(e,t){return u.encrypt(l.hexToBuf(t),s.Buffer.from(e))},t.decryptAsymmetric=async function(e,t){return u.decrypt(s.Buffer.from(t),s.Buffer.from(e))},t.encryptSymmetric=async function(e,t){const r=f.symmetric.generateIv(),n=await f.symmetric.encrypt(r,l.hexToBuf(t),s.Buffer.from(e));return s.Buffer.concat([n,s.Buffer.from(r)])},t.decryptSymmetric=async function(e,t){const r=s.Buffer.from(e),n=r.length-f.IvSize,i=r.slice(0,n),o=r.slice(n);return f.symmetric.decrypt(o,l.hexToBuf(t),i)},t.generatePrivateKey=function(){return y(t.PrivateKeySize)},t.generateSymmetricKey=function(){return y(f.SymmetricKeySize)},t.getPublicKey=d},16075:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMaxIHaveLength=t.RelayOpportunisticGraftPeers=t.RelayOpportunisticGraftTicks=t.RelayFanoutTTL=t.RelayPruneBackoff=t.RelayPrunePeers=t.RelayHeartbeatInterval=t.RelayHeartbeatInitialDelay=t.RelayGossipFactor=t.RelayPingContentTopic=t.RelayCodecs=t.minute=t.second=void 0,t.second=1e3,t.minute=60*t.second,t.RelayCodecs=["/vac/waku/relay/2.0.0-beta2","/vac/waku/relay/2.0.0"],t.RelayPingContentTopic="/relay-ping/1/ping/null",t.RelayGossipFactor=.25,t.RelayHeartbeatInitialDelay=100,t.RelayHeartbeatInterval=t.second,t.RelayPrunePeers=16,t.RelayPruneBackoff=t.minute,t.RelayFanoutTTL=t.minute,t.RelayOpportunisticGraftTicks=60,t.RelayOpportunisticGraftPeers=2,t.RelayMaxIHaveLength=5e3},89025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRelayPeers=void 0;const n=r(56785),i=r(84507);t.getRelayPeers=function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>!0;const s=e.topics.get(t);if(!s)return new Set;let a=[];return s.forEach((t=>{const r=e.peers.get(t);r&&i.RelayCodecs.includes(r.protocol)&&o(t)&&a.push(t)})),a=n.shuffle(a),r>0&&a.length>r&&(a=a.slice(0,r)),new Set(a)}},84507:function(e,t,r){"use strict";var n=r(29536).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WakuRelay=t.RelayCodecs=void 0;const u=a(r(39287)),c=a(r(38423)),h=r(56785),l=r(57860),f=a(r(96732)),d=r(23677),p=r(84109),y=r(41995),g=s(r(16075)),m=r(16075);Object.defineProperty(t,"RelayCodecs",{enumerable:!0,get:function(){return m.RelayCodecs}});const b=r(89025),v=r(46058),w=u.default("waku:relay");class _ extends c.default{constructor(e,t){var r;super(e,Object.assign(t,{globalSignaturePolicy:l.SignaturePolicy.StrictNoSign})),this.heartbeat=new v.RelayHeartbeat(this),this.observers={},this.decryptionKeys=new Map;const n=g.RelayCodecs;Object.assign(this,{multicodecs:n}),this.pubSubTopic=(null===t||void 0===t?void 0:t.pubSubTopic)||p.DefaultPubSubTopic,null===t||void 0===t||null===(r=t.decryptionKeys)||void 0===r||r.forEach((e=>{this.addDecryptionKey(e)}))}start(){super.start(),this.subscribe(this.pubSubTopic)}async send(e){const t=e.encode();await super.publish(this.pubSubTopic,n.from(t))}addDecryptionKey(e,t){this.decryptionKeys.set(d.hexToBuf(e),null!==t&&void 0!==t?t:{})}deleteDecryptionKey(e){this.decryptionKeys.delete(d.hexToBuf(e))}addObserver(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];0===t.length?(this.observers[""]||(this.observers[""]=new Set),this.observers[""].add(e)):t.forEach((t=>{this.observers[t]||(this.observers[t]=new Set),this.observers[t].add(e)}))}deleteObserver(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];0===t.length?this.observers[""]&&this.observers[""].delete(e):t.forEach((t=>{this.observers[t]&&this.observers[t].delete(e)}))}getPeers(){return b.getRelayPeers(this,this.pubSubTopic,this._options.D,(e=>this.score.score(e)>=this._options.scoreThresholds.publishThreshold))}subscribe(e){this.on(e,(t=>{const r=Array.from(this.decryptionKeys).map((e=>{let[t,{method:r,contentTopics:n}]=e;return{key:t,method:r,contentTopics:n}}));w("Message received on ".concat(e)),y.WakuMessage.decode(t.data,r).then((e=>{e?(this.observers[""]&&this.observers[""].forEach((t=>{t(e)})),e.contentTopic&&this.observers[e.contentTopic]&&this.observers[e.contentTopic].forEach((t=>{t(e)}))):w("Failed to decode Waku Message")})).catch((e=>{w("Failed to decode Waku Message",e)}))})),super.subscribe(e)}join(e){var t;if(!this.started)throw new Error("WakuRelayPubSub has not started");const r=this.fanout.get(e);if(r)r.forEach((e=>{this.score.score(e)<0&&r.delete(e)})),r.size<this._options.D&&b.getRelayPeers(this,e,this._options.D-r.size,(e=>!r.has(e)&&!this.direct.has(e)&&this.score.score(e)>=0)).forEach((e=>r.add(e))),this.mesh.set(e,r),this.fanout.delete(e),this.lastpub.delete(e);else{const t=b.getRelayPeers(this,e,this._options.D,(e=>!this.direct.has(e)&&this.score.score(e)>=0));this.mesh.set(e,t)}null===(t=this.mesh.get(e))||void 0===t||t.forEach((t=>{this.log("JOIN: Add mesh link to %s in %s",t,e),this._sendGraft(t,e)}))}async _publish(e){e.receivedFrom!==this.peerId.toB58String()&&(this.score.deliverMessage(e),this.gossipTracer.deliverMessage(e));const t=await this.getMsgId(e),r=h.messageIdToString(t);this.seenCache.put(r),this.messageCache.put(e);const n=new Set;e.topicIDs.forEach((e=>{var t;if(!this.topics.get(e))return;this.direct.forEach((e=>{n.add(e)}));let r=this.mesh.get(e);if(!r||!r.size){if(r=this.fanout.get(e),!r){const t=b.getRelayPeers(this,e,this._options.D,(e=>this.score.score(e)>=this._options.scoreThresholds.publishThreshold));t.size>0?(r=t,this.fanout.set(e,t)):r=new Set}this.lastpub.set(e,this._now())}null===(t=r)||void 0===t||t.forEach((e=>{n.add(e)}))}));const i=h.createGossipRpc([c.default.utils.normalizeOutRpcMessage(e)]);n.forEach((t=>{t!==e.from&&this._sendRpc(t,i)}))}_emitGossip(e,t){const r=this.messageCache.getGossipIDs(e);if(!r.length)return;h.shuffle(r),r.length>g.RelayMaxIHaveLength&&this.log("too many messages for gossip; will truncate IHAVE list (%d messages)",r.length);const n=[],i=this.topics.get(e);if(!i)return;i.forEach((e=>{const r=this.peers.get(e);r&&!t.has(e)&&!this.direct.has(e)&&g.RelayCodecs.includes(r.protocol)&&this.score.score(e)>=this._options.scoreThresholds.gossipThreshold&&n.push(e)}));let o=this._options.Dlazy;const s=g.RelayGossipFactor*n.length;s>o&&(o=s),o>n.length?o=n.length:h.shuffle(n),n.slice(0,o).forEach((t=>{let n=r;r.length>g.RelayMaxIHaveLength&&(n=h.shuffle(n.slice()).slice(0,g.RelayMaxIHaveLength)),this._pushGossip(t,{topicID:e,messageIDs:n})}))}_makePrune(e,t,r){const n=g.RelayPruneBackoff/1e3,i=[];if(r){b.getRelayPeers(this,t,g.RelayPrunePeers,(t=>t!==e&&this.score.score(t)>=0)).forEach((e=>{const t=f.default.createFromB58String(e);i.push({peerID:t.toBytes(),signedPeerRecord:this._libp2p.peerStore.addressBook.getRawEnvelope(t)})}))}return{topicID:t,peers:i,backoff:n}}}t.WakuRelay=_},46058:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RelayHeartbeat=void 0;const s=r(87497),a=r(56785),u=o(r(16075)),c=r(89025);class h extends s.Heartbeat{constructor(e){super(e)}start(){if(this._heartbeatTimer)return;const e=this._heartbeat.bind(this),t=setTimeout((()=>{var t;e(),null===(t=this._heartbeatTimer)||void 0===t||t.runPeriodically(e,u.RelayHeartbeatInterval)}),u.RelayHeartbeatInitialDelay);this._heartbeatTimer={_intervalId:void 0,runPeriodically:(e,t)=>{this._heartbeatTimer._intervalId=setInterval(e,t)},cancel:()=>{var e;clearTimeout(t),clearInterval(null===(e=this._heartbeatTimer)||void 0===e?void 0:e._intervalId)}}}stop(){this._heartbeatTimer&&(this._heartbeatTimer.cancel(),this._heartbeatTimer=null)}_heartbeat(){const{D:e,Dlo:t,Dhi:r,Dscore:n,Dout:i}=this.gossipsub._options;this.gossipsub.heartbeatTicks++;const o=new Map,s=e=>{let t=o.get(e);return void 0===t&&(t=this.gossipsub.score.score(e),o.set(e,t)),t},h=new Map,l=new Map,f=new Map;this.gossipsub._clearBackoff(),this.gossipsub.peerhave.clear(),this.gossipsub.iasked.clear(),this.gossipsub._applyIwantPenalties(),this.gossipsub._directConnect(),this.gossipsub.mesh.forEach(((o,d)=>{const p=e=>{this.gossipsub.log("HEARTBEAT: Remove mesh link to %s in %s",e,d),this.gossipsub.score.prune(e,d),this.gossipsub._addBackoff(e,d),o.delete(e);const t=l.get(e);t?t.push(d):l.set(e,[d])},y=e=>{this.gossipsub.log("HEARTBEAT: Add mesh link to %s in %s",e,d),this.gossipsub.score.graft(e,d),o.add(e);const t=h.get(e);t?t.push(d):h.set(e,[d])};if(o.forEach((e=>{const t=s(e);t<0&&(this.gossipsub.log("HEARTBEAT: Prune peer %s with negative score: score=%d, topic=%s",e,t,d),p(e),f.set(e,!0))})),o.size<t){const t=this.gossipsub.backoff.get(d),r=e-o.size;c.getRelayPeers(this.gossipsub,d,r,(e=>!o.has(e)&&!this.gossipsub.direct.has(e)&&(!t||!t.has(e))&&s(e)>=0)).forEach(y)}if(o.size>r){let t=Array.from(o);t.sort(((e,t)=>s(t)-s(e))),t=t.slice(0,n).concat(a.shuffle(t.slice(n)));let r=0;if(t.slice(0,e).forEach((e=>{this.gossipsub.outbound.get(e)&&r++})),r<i){const n=e=>{const r=t[e];for(let n=e;n>0;n--)t[n]=t[n-1];t[0]=r};if(r>0){let i=r;for(let r=1;r<e&&i>0;r++)this.gossipsub.outbound.get(t[r])&&(n(r),i--)}let i=e-r;for(let r=e;r<t.length&&i>0;r++)this.gossipsub.outbound.get(t[r])&&(n(r),i--)}t.slice(e).forEach(p)}if(o.size>=t){let e=0;if(o.forEach((t=>{this.gossipsub.outbound.get(t)&&e++})),e<i){const t=i-e,r=this.gossipsub.backoff.get(d);c.getRelayPeers(this.gossipsub,d,t,(e=>!o.has(e)&&!this.gossipsub.direct.has(e)&&(!r||!r.has(e))&&s(e)>=0)).forEach(y)}}if(this.gossipsub.heartbeatTicks%u.RelayOpportunisticGraftTicks===0&&o.size>1){const e=Array.from(o).sort(((e,t)=>s(e)-s(t))),t=Math.floor(o.size/2),r=s(e[t]);if(r<this.gossipsub._options.scoreThresholds.opportunisticGraftThreshold){const e=this.gossipsub.backoff.get(d);c.getRelayPeers(this.gossipsub,d,u.RelayOpportunisticGraftPeers,(t=>o.has(t)&&!this.gossipsub.direct.has(t)&&(!e||!e.has(t))&&s(t)>r)).forEach((e=>{this.gossipsub.log("HEARTBEAT: Opportunistically graft peer %s on topic %s",e,d),y(e)}))}}this.gossipsub._emitGossip(d,o)}));const d=this.gossipsub._now();this.gossipsub.lastpub.forEach(((e,t)=>{e+u.RelayFanoutTTL<d&&(this.gossipsub.fanout.delete(t),this.gossipsub.lastpub.delete(t))})),this.gossipsub.fanout.forEach(((t,r)=>{const n=this.gossipsub.topics.get(r);if(t.forEach((e=>{(null===n||void 0===n||!n.has(e)||s(e)<this.gossipsub._options.scoreThresholds.publishThreshold)&&t.delete(e)})),t.size<e){const n=e-t.size;c.getRelayPeers(this.gossipsub,r,n,(e=>!t.has(e)&&!this.gossipsub.direct.has(e)&&s(e)>=this.gossipsub._options.scoreThresholds.publishThreshold)).forEach((e=>{t.add(e)}))}this.gossipsub._emitGossip(r,t)})),this.gossipsub._sendGraftPrune(h,l,f),this.gossipsub._flush(),this.gossipsub.messageCache.shift(),this.gossipsub.emit("gossipsub:heartbeat")}}t.RelayHeartbeat=h},4789:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryRPC=t.PageDirection=void 0;const s=r(6018),a=r(48061),u=o(r(71913));var c;!function(e){e.BACKWARD="backward",e.FORWARD="forward"}(c=t.PageDirection||(t.PageDirection={}));class h{constructor(e){this.proto=e}static createQuery(e){const t=function(e){switch(e){case c.BACKWARD:return u.PagingInfo_Direction.DIRECTION_BACKWARD_UNSPECIFIED;case c.FORWARD:return u.PagingInfo_Direction.DIRECTION_FORWARD;default:return u.PagingInfo_Direction.DIRECTION_BACKWARD_UNSPECIFIED}}(e.pageDirection),r={pageSize:e.pageSize,cursor:e.cursor,direction:t},n=e.contentTopics.map((e=>({contentTopic:e})));return new h({requestId:a.v4(),query:{pubSubTopic:e.pubSubTopic,contentFilters:n,pagingInfo:r,startTime:e.startTime,endTime:e.endTime},response:void 0})}static decode(e){const t=u.HistoryRPC.decode(s.Reader.create(e));return new h(t)}encode(){return u.HistoryRPC.encode(this.proto).finish()}get query(){return this.proto.query}get response(){return this.proto.response}}t.HistoryRPC=h},28026:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WakuStore=t.PageDirection=t.DefaultPageSize=t.StoreCodec=void 0;const i=n(r(39287)),o=n(r(89554)),s=n(r(4666)),a=n(r(91522)),u=r(12187),c=r(950),h=r(23677),l=r(84109),f=r(41995),d=r(4789);Object.defineProperty(t,"PageDirection",{enumerable:!0,get:function(){return d.PageDirection}});const p=i.default("waku:store");t.StoreCodec="/vac/waku/store/2.0.0-beta3",t.DefaultPageSize=10;t.WakuStore=class{constructor(e,t){this.libp2p=e,null!==t&&void 0!==t&&t.pubSubTopic?this.pubSubTopic=t.pubSubTopic:this.pubSubTopic=l.DefaultPubSubTopic,this.decryptionKeys=new Map}async queryHistory(e,r){let n,i;null!==r&&void 0!==r&&r.timeFilter&&(n=r.timeFilter.startTime.getTime()/1e3,i=r.timeFilter.endTime.getTime()/1e3);const c=Object.assign({pubSubTopic:this.pubSubTopic,pageDirection:d.PageDirection.BACKWARD,pageSize:t.DefaultPageSize},r,{startTime:n,endTime:i},{contentTopics:e});let l;if(p("Querying history with the following options",r),c.peerId){if(l=this.libp2p.peerStore.get(c.peerId),!l)throw"Failed to retrieve connection details for provided peer in peer store: ".concat(c.peerId.toB58String())}else if(l=this.randomPeer,!l)throw"Failed to find known peer that registers waku store protocol";if(!l.protocols.includes(t.StoreCodec))throw"Peer does not register waku store protocol: ".concat(l.id.toB58String());const y=this.libp2p.connectionManager.get(l.id);if(!y)throw"Failed to get a connection to the peer";const g=Array.from(this.decryptionKeys).map((e=>{let[t,{method:r,contentTopics:n}]=e;return{key:t,method:r,contentTopics:n}}));c.decryptionKeys&&c.decryptionKeys.forEach((t=>{g.push({key:h.hexToBuf(t),contentTopics:e.length?e:void 0,method:void 0})}));const m=[];let b;for(;;){var v,w,_,E;const{stream:e}=await y.newStream(t.StoreCodec),r=Object.assign(c,{cursor:b}),n=d.HistoryRPC.createQuery(r);p("Querying store peer",y.remoteAddr.toString());const i=await a.default([n.encode()],s.default.encode(),e,s.default.decode(),o.default),h=d.HistoryRPC.decode(i.slice()).response;if(!h)throw"History response misses response field";if(h.error&&h.error===u.HistoryResponse_Error.ERROR_INVALID_CURSOR)throw"History response contains an Error: INVALID CURSOR";if(!h.messages||!h.messages.length)return console.log("No messages present in HistoryRPC response"),m;p("".concat(h.messages.length," messages retrieved for pubsub topic ").concat(c.pubSubTopic));const l=[];await Promise.all(h.messages.map((async e=>{const t=await f.WakuMessage.decodeProto(e,g);t&&(m.push(t),l.push(t))})));let S=!1;c.callback&&(S=Boolean(c.callback(l)));const M=null===(v=h.pagingInfo)||void 0===v?void 0:v.pageSize,A=null===(w=n.query)||void 0===w||null===(_=w.pagingInfo)||void 0===_?void 0:_.pageSize;if(S||M&&A&&M<A)return m;if(b=null===(E=h.pagingInfo)||void 0===E?void 0:E.cursor,void 0===b)return console.log("No cursor returned by peer."),m}}addDecryptionKey(e,t){this.decryptionKeys.set(h.hexToBuf(e),null!==t&&void 0!==t?t:{})}deleteDecryptionKey(e){this.decryptionKeys.delete(h.hexToBuf(e))}get peers(){return c.getPeersForProtocol(this.libp2p,t.StoreCodec)}get randomPeer(){return c.selectRandomPeer(this.peers)}}},12187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryRPC=t.HistoryResponse_Error=t.HistoryResponse=t.HistoryQuery=t.ContentFilter=t.PagingInfo_Direction=t.PagingInfo=t.Index=t.WakuMessage=void 0;var n=r(94326);Object.defineProperty(t,"WakuMessage",{enumerable:!0,get:function(){return n.WakuMessage}});var i=r(71913);Object.defineProperty(t,"Index",{enumerable:!0,get:function(){return i.Index}}),Object.defineProperty(t,"PagingInfo",{enumerable:!0,get:function(){return i.PagingInfo}}),Object.defineProperty(t,"PagingInfo_Direction",{enumerable:!0,get:function(){return i.PagingInfo_Direction}}),Object.defineProperty(t,"ContentFilter",{enumerable:!0,get:function(){return i.ContentFilter}}),Object.defineProperty(t,"HistoryQuery",{enumerable:!0,get:function(){return i.HistoryQuery}}),Object.defineProperty(t,"HistoryResponse",{enumerable:!0,get:function(){return i.HistoryResponse}}),Object.defineProperty(t,"HistoryResponse_Error",{enumerable:!0,get:function(){return i.HistoryResponse_Error}}),Object.defineProperty(t,"HistoryRPC",{enumerable:!0,get:function(){return i.HistoryRPC}})},39755:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PushRPC=t.PushResponse=t.PushRequest=t.protobufPackage=void 0;const i=n(r(74395)),o=n(r(6018)),s=r(94326);function a(e){return null!==e&&void 0!==e}t.protobufPackage="waku.v2",t.PushRequest={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.pubSubTopic&&t.uint32(10).string(e.pubSubTopic),void 0!==e.message&&s.WakuMessage.encode(e.message,t.uint32(18).fork()).ldelim(),t},decode(e,t){const r=e instanceof o.default.Reader?e:new o.default.Reader(e);let n=void 0===t?r.len:r.pos+t;const i={pubSubTopic:"",message:void 0};for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:i.pubSubTopic=r.string();break;case 2:i.message=s.WakuMessage.decode(r,r.uint32());break;default:r.skipType(7&e)}}return i},fromJSON:e=>({pubSubTopic:a(e.pubSubTopic)?String(e.pubSubTopic):"",message:a(e.message)?s.WakuMessage.fromJSON(e.message):void 0}),toJSON(e){const t={};return void 0!==e.pubSubTopic&&(t.pubSubTopic=e.pubSubTopic),void 0!==e.message&&(t.message=e.message?s.WakuMessage.toJSON(e.message):void 0),t},fromPartial(e){var t;const r={pubSubTopic:"",message:void 0};return r.pubSubTopic=null!==(t=e.pubSubTopic)&&void 0!==t?t:"",r.message=void 0!==e.message&&null!==e.message?s.WakuMessage.fromPartial(e.message):void 0,r}},t.PushResponse={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return!0===e.isSuccess&&t.uint32(8).bool(e.isSuccess),""!==e.info&&t.uint32(18).string(e.info),t},decode(e,t){const r=e instanceof o.default.Reader?e:new o.default.Reader(e);let n=void 0===t?r.len:r.pos+t;const i={isSuccess:!1,info:""};for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:i.isSuccess=r.bool();break;case 2:i.info=r.string();break;default:r.skipType(7&e)}}return i},fromJSON:e=>({isSuccess:!!a(e.isSuccess)&&Boolean(e.isSuccess),info:a(e.info)?String(e.info):""}),toJSON(e){const t={};return void 0!==e.isSuccess&&(t.isSuccess=e.isSuccess),void 0!==e.info&&(t.info=e.info),t},fromPartial(e){var t,r;const n={isSuccess:!1,info:""};return n.isSuccess=null!==(t=e.isSuccess)&&void 0!==t&&t,n.info=null!==(r=e.info)&&void 0!==r?r:"",n}},t.PushRPC={encode(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.requestId&&r.uint32(10).string(e.requestId),void 0!==e.request&&t.PushRequest.encode(e.request,r.uint32(18).fork()).ldelim(),void 0!==e.response&&t.PushResponse.encode(e.response,r.uint32(26).fork()).ldelim(),r},decode(e,r){const n=e instanceof o.default.Reader?e:new o.default.Reader(e);let i=void 0===r?n.len:n.pos+r;const s={requestId:"",request:void 0,response:void 0};for(;n.pos<i;){const e=n.uint32();switch(e>>>3){case 1:s.requestId=n.string();break;case 2:s.request=t.PushRequest.decode(n,n.uint32());break;case 3:s.response=t.PushResponse.decode(n,n.uint32());break;default:n.skipType(7&e)}}return s},fromJSON:e=>({requestId:a(e.requestId)?String(e.requestId):"",request:a(e.request)?t.PushRequest.fromJSON(e.request):void 0,response:a(e.response)?t.PushResponse.fromJSON(e.response):void 0}),toJSON(e){const r={};return void 0!==e.requestId&&(r.requestId=e.requestId),void 0!==e.request&&(r.request=e.request?t.PushRequest.toJSON(e.request):void 0),void 0!==e.response&&(r.response=e.response?t.PushResponse.toJSON(e.response):void 0),r},fromPartial(e){var r;const n={requestId:"",request:void 0,response:void 0};return n.requestId=null!==(r=e.requestId)&&void 0!==r?r:"",n.request=void 0!==e.request&&null!==e.request?t.PushRequest.fromPartial(e.request):void 0,n.response=void 0!==e.response&&null!==e.response?t.PushResponse.fromPartial(e.response):void 0,n}},o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},94326:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WakuMessage=t.protobufPackage=void 0;const i=n(r(74395)),o=n(r(6018));t.protobufPackage="waku.v2",t.WakuMessage={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return void 0!==e.payload&&t.uint32(10).bytes(e.payload),void 0!==e.contentTopic&&t.uint32(18).string(e.contentTopic),void 0!==e.version&&t.uint32(24).uint32(e.version),void 0!==e.timestamp&&t.uint32(33).double(e.timestamp),t},decode(e,t){const r=e instanceof o.default.Reader?e:new o.default.Reader(e);let n=void 0===t?r.len:r.pos+t;const i={payload:void 0,contentTopic:void 0,version:void 0,timestamp:void 0};for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:i.payload=r.bytes();break;case 2:i.contentTopic=r.string();break;case 3:i.version=r.uint32();break;case 4:i.timestamp=r.double();break;default:r.skipType(7&e)}}return i},fromJSON:e=>({payload:h(e.payload)?u(e.payload):void 0,contentTopic:h(e.contentTopic)?String(e.contentTopic):void 0,version:h(e.version)?Number(e.version):void 0,timestamp:h(e.timestamp)?Number(e.timestamp):void 0}),toJSON(e){const t={};return void 0!==e.payload&&(t.payload=void 0!==e.payload?function(e){const t=[];for(const r of e)t.push(String.fromCharCode(r));return c(t.join(""))}(e.payload):void 0),void 0!==e.contentTopic&&(t.contentTopic=e.contentTopic),void 0!==e.version&&(t.version=Math.round(e.version)),void 0!==e.timestamp&&(t.timestamp=e.timestamp),t},fromPartial(e){var t,r,n,i;const o={payload:void 0,contentTopic:void 0,version:void 0,timestamp:void 0};return o.payload=null!==(t=e.payload)&&void 0!==t?t:void 0,o.contentTopic=null!==(r=e.contentTopic)&&void 0!==r?r:void 0,o.version=null!==(n=e.version)&&void 0!==n?n:void 0,o.timestamp=null!==(i=e.timestamp)&&void 0!==i?i:void 0,o}};var s=(()=>{if("undefined"!==typeof s)return s;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw"Unable to locate global object"})();const a=s.atob||(e=>s.Buffer.from(e,"base64").toString("binary"));function u(e){const t=a(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}const c=s.btoa||(e=>s.Buffer.from(e,"binary").toString("base64"));function h(e){return null!==e&&void 0!==e}o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},71913:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HistoryRPC=t.HistoryResponse=t.HistoryQuery=t.ContentFilter=t.PagingInfo=t.Index=t.historyResponse_ErrorToJSON=t.historyResponse_ErrorFromJSON=t.HistoryResponse_Error=t.pagingInfo_DirectionToJSON=t.pagingInfo_DirectionFromJSON=t.PagingInfo_Direction=t.protobufPackage=void 0;const i=n(r(74395)),o=n(r(6018)),s=r(94326);var a,u;function c(e){switch(e){case 0:case"DIRECTION_BACKWARD_UNSPECIFIED":return a.DIRECTION_BACKWARD_UNSPECIFIED;case 1:case"DIRECTION_FORWARD":return a.DIRECTION_FORWARD;default:return a.UNRECOGNIZED}}function h(e){switch(e){case a.DIRECTION_BACKWARD_UNSPECIFIED:return"DIRECTION_BACKWARD_UNSPECIFIED";case a.DIRECTION_FORWARD:return"DIRECTION_FORWARD";default:return"UNKNOWN"}}function l(e){switch(e){case 0:case"ERROR_NONE_UNSPECIFIED":return u.ERROR_NONE_UNSPECIFIED;case 1:case"ERROR_INVALID_CURSOR":return u.ERROR_INVALID_CURSOR;default:return u.UNRECOGNIZED}}function f(e){switch(e){case u.ERROR_NONE_UNSPECIFIED:return"ERROR_NONE_UNSPECIFIED";case u.ERROR_INVALID_CURSOR:return"ERROR_INVALID_CURSOR";default:return"UNKNOWN"}}function d(){return{digest:new Uint8Array,receivedTime:0,senderTime:0}}t.protobufPackage="waku.v2",function(e){e[e.DIRECTION_BACKWARD_UNSPECIFIED=0]="DIRECTION_BACKWARD_UNSPECIFIED",e[e.DIRECTION_FORWARD=1]="DIRECTION_FORWARD",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(a=t.PagingInfo_Direction||(t.PagingInfo_Direction={})),t.pagingInfo_DirectionFromJSON=c,t.pagingInfo_DirectionToJSON=h,function(e){e[e.ERROR_NONE_UNSPECIFIED=0]="ERROR_NONE_UNSPECIFIED",e[e.ERROR_INVALID_CURSOR=1]="ERROR_INVALID_CURSOR",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(u=t.HistoryResponse_Error||(t.HistoryResponse_Error={})),t.historyResponse_ErrorFromJSON=l,t.historyResponse_ErrorToJSON=f,t.Index={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return 0!==e.digest.length&&t.uint32(10).bytes(e.digest),0!==e.receivedTime&&t.uint32(17).double(e.receivedTime),0!==e.senderTime&&t.uint32(25).double(e.senderTime),t},decode(e,t){const r=e instanceof o.default.Reader?e:new o.default.Reader(e);let n=void 0===t?r.len:r.pos+t;const i=d();for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:i.digest=r.bytes();break;case 2:i.receivedTime=r.double();break;case 3:i.senderTime=r.double();break;default:r.skipType(7&e)}}return i},fromJSON:e=>({digest:v(e.digest)?g(e.digest):new Uint8Array,receivedTime:v(e.receivedTime)?Number(e.receivedTime):0,senderTime:v(e.senderTime)?Number(e.senderTime):0}),toJSON(e){const t={};return void 0!==e.digest&&(t.digest=function(e){const t=[];for(const r of e)t.push(String.fromCharCode(r));return m(t.join(""))}(void 0!==e.digest?e.digest:new Uint8Array)),void 0!==e.receivedTime&&(t.receivedTime=e.receivedTime),void 0!==e.senderTime&&(t.senderTime=e.senderTime),t},fromPartial(e){var t,r,n;const i=d();return i.digest=null!==(t=e.digest)&&void 0!==t?t:new Uint8Array,i.receivedTime=null!==(r=e.receivedTime)&&void 0!==r?r:0,i.senderTime=null!==(n=e.senderTime)&&void 0!==n?n:0,i}},t.PagingInfo={encode(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return 0!==e.pageSize&&r.uint32(8).uint64(e.pageSize),void 0!==e.cursor&&t.Index.encode(e.cursor,r.uint32(18).fork()).ldelim(),0!==e.direction&&r.uint32(24).int32(e.direction),r},decode(e,r){const n=e instanceof o.default.Reader?e:new o.default.Reader(e);let i=void 0===r?n.len:n.pos+r;const s={pageSize:0,cursor:void 0,direction:0};for(;n.pos<i;){const e=n.uint32();switch(e>>>3){case 1:s.pageSize=b(n.uint64());break;case 2:s.cursor=t.Index.decode(n,n.uint32());break;case 3:s.direction=n.int32();break;default:n.skipType(7&e)}}return s},fromJSON:e=>({pageSize:v(e.pageSize)?Number(e.pageSize):0,cursor:v(e.cursor)?t.Index.fromJSON(e.cursor):void 0,direction:v(e.direction)?c(e.direction):0}),toJSON(e){const r={};return void 0!==e.pageSize&&(r.pageSize=Math.round(e.pageSize)),void 0!==e.cursor&&(r.cursor=e.cursor?t.Index.toJSON(e.cursor):void 0),void 0!==e.direction&&(r.direction=h(e.direction)),r},fromPartial(e){var r,n;const i={pageSize:0,cursor:void 0,direction:0};return i.pageSize=null!==(r=e.pageSize)&&void 0!==r?r:0,i.cursor=void 0!==e.cursor&&null!==e.cursor?t.Index.fromPartial(e.cursor):void 0,i.direction=null!==(n=e.direction)&&void 0!==n?n:0,i}},t.ContentFilter={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.contentTopic&&t.uint32(10).string(e.contentTopic),t},decode(e,t){const r=e instanceof o.default.Reader?e:new o.default.Reader(e);let n=void 0===t?r.len:r.pos+t;const i={contentTopic:""};for(;r.pos<n;){const e=r.uint32();if(e>>>3===1)i.contentTopic=r.string();else r.skipType(7&e)}return i},fromJSON:e=>({contentTopic:v(e.contentTopic)?String(e.contentTopic):""}),toJSON(e){const t={};return void 0!==e.contentTopic&&(t.contentTopic=e.contentTopic),t},fromPartial(e){var t;const r={contentTopic:""};return r.contentTopic=null!==(t=e.contentTopic)&&void 0!==t?t:"",r}},t.HistoryQuery={encode(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();void 0!==e.pubSubTopic&&r.uint32(18).string(e.pubSubTopic);for(const n of e.contentFilters)t.ContentFilter.encode(n,r.uint32(26).fork()).ldelim();return void 0!==e.pagingInfo&&t.PagingInfo.encode(e.pagingInfo,r.uint32(34).fork()).ldelim(),void 0!==e.startTime&&r.uint32(41).double(e.startTime),void 0!==e.endTime&&r.uint32(49).double(e.endTime),r},decode(e,r){const n=e instanceof o.default.Reader?e:new o.default.Reader(e);let i=void 0===r?n.len:n.pos+r;const s={pubSubTopic:void 0,contentFilters:[],pagingInfo:void 0,startTime:void 0,endTime:void 0};for(;n.pos<i;){const e=n.uint32();switch(e>>>3){case 2:s.pubSubTopic=n.string();break;case 3:s.contentFilters.push(t.ContentFilter.decode(n,n.uint32()));break;case 4:s.pagingInfo=t.PagingInfo.decode(n,n.uint32());break;case 5:s.startTime=n.double();break;case 6:s.endTime=n.double();break;default:n.skipType(7&e)}}return s},fromJSON:e=>({pubSubTopic:v(e.pubSubTopic)?String(e.pubSubTopic):void 0,contentFilters:Array.isArray(null===e||void 0===e?void 0:e.contentFilters)?e.contentFilters.map((e=>t.ContentFilter.fromJSON(e))):[],pagingInfo:v(e.pagingInfo)?t.PagingInfo.fromJSON(e.pagingInfo):void 0,startTime:v(e.startTime)?Number(e.startTime):void 0,endTime:v(e.endTime)?Number(e.endTime):void 0}),toJSON(e){const r={};return void 0!==e.pubSubTopic&&(r.pubSubTopic=e.pubSubTopic),e.contentFilters?r.contentFilters=e.contentFilters.map((e=>e?t.ContentFilter.toJSON(e):void 0)):r.contentFilters=[],void 0!==e.pagingInfo&&(r.pagingInfo=e.pagingInfo?t.PagingInfo.toJSON(e.pagingInfo):void 0),void 0!==e.startTime&&(r.startTime=e.startTime),void 0!==e.endTime&&(r.endTime=e.endTime),r},fromPartial(e){var r,n,i,o;const s={pubSubTopic:void 0,contentFilters:[],pagingInfo:void 0,startTime:void 0,endTime:void 0};return s.pubSubTopic=null!==(r=e.pubSubTopic)&&void 0!==r?r:void 0,s.contentFilters=(null===(n=e.contentFilters)||void 0===n?void 0:n.map((e=>t.ContentFilter.fromPartial(e))))||[],s.pagingInfo=void 0!==e.pagingInfo&&null!==e.pagingInfo?t.PagingInfo.fromPartial(e.pagingInfo):void 0,s.startTime=null!==(i=e.startTime)&&void 0!==i?i:void 0,s.endTime=null!==(o=e.endTime)&&void 0!==o?o:void 0,s}},t.HistoryResponse={encode(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();for(const t of e.messages)s.WakuMessage.encode(t,r.uint32(18).fork()).ldelim();return void 0!==e.pagingInfo&&t.PagingInfo.encode(e.pagingInfo,r.uint32(26).fork()).ldelim(),0!==e.error&&r.uint32(32).int32(e.error),r},decode(e,r){const n=e instanceof o.default.Reader?e:new o.default.Reader(e);let i=void 0===r?n.len:n.pos+r;const a={messages:[],pagingInfo:void 0,error:0};for(;n.pos<i;){const e=n.uint32();switch(e>>>3){case 2:a.messages.push(s.WakuMessage.decode(n,n.uint32()));break;case 3:a.pagingInfo=t.PagingInfo.decode(n,n.uint32());break;case 4:a.error=n.int32();break;default:n.skipType(7&e)}}return a},fromJSON:e=>({messages:Array.isArray(null===e||void 0===e?void 0:e.messages)?e.messages.map((e=>s.WakuMessage.fromJSON(e))):[],pagingInfo:v(e.pagingInfo)?t.PagingInfo.fromJSON(e.pagingInfo):void 0,error:v(e.error)?l(e.error):0}),toJSON(e){const r={};return e.messages?r.messages=e.messages.map((e=>e?s.WakuMessage.toJSON(e):void 0)):r.messages=[],void 0!==e.pagingInfo&&(r.pagingInfo=e.pagingInfo?t.PagingInfo.toJSON(e.pagingInfo):void 0),void 0!==e.error&&(r.error=f(e.error)),r},fromPartial(e){var r,n;const i={messages:[],pagingInfo:void 0,error:0};return i.messages=(null===(r=e.messages)||void 0===r?void 0:r.map((e=>s.WakuMessage.fromPartial(e))))||[],i.pagingInfo=void 0!==e.pagingInfo&&null!==e.pagingInfo?t.PagingInfo.fromPartial(e.pagingInfo):void 0,i.error=null!==(n=e.error)&&void 0!==n?n:0,i}},t.HistoryRPC={encode(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default.Writer.create();return""!==e.requestId&&r.uint32(10).string(e.requestId),void 0!==e.query&&t.HistoryQuery.encode(e.query,r.uint32(18).fork()).ldelim(),void 0!==e.response&&t.HistoryResponse.encode(e.response,r.uint32(26).fork()).ldelim(),r},decode(e,r){const n=e instanceof o.default.Reader?e:new o.default.Reader(e);let i=void 0===r?n.len:n.pos+r;const s={requestId:"",query:void 0,response:void 0};for(;n.pos<i;){const e=n.uint32();switch(e>>>3){case 1:s.requestId=n.string();break;case 2:s.query=t.HistoryQuery.decode(n,n.uint32());break;case 3:s.response=t.HistoryResponse.decode(n,n.uint32());break;default:n.skipType(7&e)}}return s},fromJSON:e=>({requestId:v(e.requestId)?String(e.requestId):"",query:v(e.query)?t.HistoryQuery.fromJSON(e.query):void 0,response:v(e.response)?t.HistoryResponse.fromJSON(e.response):void 0}),toJSON(e){const r={};return void 0!==e.requestId&&(r.requestId=e.requestId),void 0!==e.query&&(r.query=e.query?t.HistoryQuery.toJSON(e.query):void 0),void 0!==e.response&&(r.response=e.response?t.HistoryResponse.toJSON(e.response):void 0),r},fromPartial(e){var r;const n={requestId:"",query:void 0,response:void 0};return n.requestId=null!==(r=e.requestId)&&void 0!==r?r:"",n.query=void 0!==e.query&&null!==e.query?t.HistoryQuery.fromPartial(e.query):void 0,n.response=void 0!==e.response&&null!==e.response?t.HistoryResponse.fromPartial(e.response):void 0,n}};var p=(()=>{if("undefined"!==typeof p)return p;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw"Unable to locate global object"})();const y=p.atob||(e=>p.Buffer.from(e,"base64").toString("binary"));function g(e){const t=y(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}const m=p.btoa||(e=>p.Buffer.from(e,"binary").toString("base64"));function b(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new p.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}function v(e){return null!==e&&void 0!==e}o.default.util.Long!==i.default&&(o.default.util.Long=i.default,o.default.configure())},99662:(e,t,r)=>{"use strict";var n=r(31725),i=r(72791)},39648:(e,t,r)=>{"use strict";r(99662)},16522:(e,t,r)=>{"use strict";const n=t;n.bignum=r(87664),n.define=r(88199).define,n.base=r(68222),n.constants=r(43062),n.decoders=r(4023),n.encoders=r(37407)},88199:(e,t,r)=>{"use strict";const n=r(37407),i=r(4023),o=r(12534);function s(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new s(e,t)},s.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)},s.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},s.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},s.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},s.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},90357:(e,t,r)=>{"use strict";const n=r(12534),i=r(92382).b,o=r(39138).Buffer;function s(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 a(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return a.isEncoderBuffer(e)||(e=new a(e,t)),this.length+=e.length,e}),this);else if("number"===typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"===typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(s,i),t.C=s,s.isDecoderBuffer=function(e){if(e instanceof s)return!0;return"object"===typeof e&&o.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"===typeof e.offset&&"number"===typeof e.length&&"function"===typeof e.save&&"function"===typeof e.restore&&"function"===typeof e.isEmpty&&"function"===typeof e.readUInt8&&"function"===typeof e.skip&&"function"===typeof e.raw},s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(e){const t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},s.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.R=a,a.isEncoderBuffer=function(e){if(e instanceof a)return!0;return"object"===typeof e&&"EncoderBuffer"===e.constructor.name&&"number"===typeof e.length&&"function"===typeof e.join},a.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}},68222:(e,t,r)=>{"use strict";const n=t;n.Reporter=r(92382).b,n.DecoderBuffer=r(90357).C,n.EncoderBuffer=r(90357).R,n.Node=r(32319)},32319:(e,t,r)=>{"use strict";const n=r(92382).b,i=r(90357).R,o=r(90357).C,s=r(72325),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);function c(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=c;const h=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){const e=this._baseState,t={};h.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);return r._baseState=t,r},c.prototype._wrap=function(){const e=this._baseState;u.forEach((function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},c.prototype._init=function(e){const t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),s.equal(t.children.length,1,"Root node can have only one child")},c.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&&(s(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(s(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){c.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),a.forEach((function(e){c.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(r),this}})),c.prototype.use=function(e){s(e);const t=this._baseState;return s(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){const t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){const t=this._baseState;return s(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){const t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},c.prototype.contains=function(e){const t=this._baseState;return s(null===t.use),t.contains=e,this},c.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,s=!0,a=null;if(null!==r.key&&(a=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(s=this._peekTag(e,n,r.any),e.isError(s))return s}else{const n=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),s=!0}catch(u){s=!1}e.restore(n)}}if(r.obj&&s&&(n=e.enterObject()),s){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&&s&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==a&&e.exitKey(a):e.leaveKey(a,r.key,i),i},c.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)},c.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),s(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},c.prototype._decodeChoice=function(e,t){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(o){const s=e.save(),a=r.choice[o];try{const r=a._decode(e,t);if(e.isError(r))return!1;n={type:o,value:r},i=!0}catch(u){return e.restore(s),!1}return!0}),this),i?n:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},c.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},c.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 s=null,a=!1;if(i.any)o=this._createEncoderBuffer(e);else if(i.choice)o=this._encodeChoice(e,t);else if(i.contains)s=this._getUse(i.contains,r)._encode(e,t),a=!0;else if(i.children)s=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})),s=this._createEncoderBuffer(s);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,s=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):(s=this._encodePrimitive(i.tag,e),a=!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,a,r,s))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(e,t){const r=this._baseState,n=r.choice[e.type];return n||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},c.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)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},92382:(e,t,r)=>{"use strict";const n=r(12534);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(t){this.stack=t.stack}return this}},38266:(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)},43062:(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(38266)},92650:(e,t,r)=>{"use strict";const n=r(12534),i=r(87664),o=r(90357).C,s=r(32319),a=r(38266);function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){s.call(this,"der",e)}function h(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;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function l(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 o=0;o<i;o++){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){return o.isDecoderBuffer(e)||(e=new o(e,t)),this.tree._decode(e,t)},n(c,s),c.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;const n=e.save(),i=h(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)},c.prototype._decodeTag=function(e,t,r){const n=h(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let i=l(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(),s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(s)?s:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){const r=h(e,t);if(e.isError(r))return r;const n=l(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}},c.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},c.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")},c.prototype._decodeObjid=function(e,t,r){let n;const i=[];let o=0,s=0;for(;!e.isEmpty();)s=e.readUInt8(),o<<=7,o|=127&s,0===(128&s)&&(i.push(o),o=0);128&s&&i.push(o);const a=i[0]/40|0,u=i[0]%40;if(n=r?i:[a,u].concat(i.slice(1)),t){let e=t[n.join(" ")];void 0===e&&(e=t[n.join(".")]),void 0!==e&&(n=e)}return n},c.prototype._decodeTime=function(e,t){const r=e.raw().toString();let n,i,o,s,a,u;if("gentime"===t)n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),u=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),s=0|r.slice(6,8),a=0|r.slice(8,10),u=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,s,a,u,0)},c.prototype._decodeNull=function(){return null},c.prototype._decodeBool=function(e){const t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){const r=e.raw();let n=new i(r);return t&&(n=t[n.toString(10)]||n),n},c.prototype._use=function(e,t){return"function"===typeof e&&(e=e(t)),e._getDecoder("der").tree}},4023:(e,t,r)=>{"use strict";const n=t;n.der=r(92650),n.pem=r(56282)},56282:(e,t,r)=>{"use strict";const n=r(12534),i=r(39138).Buffer,o=r(92650);function s(e){o.call(this,e),this.enc="pem"}n(s,o),e.exports=s,s.prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,u=-1;for(let i=0;i<r.length;i++){const e=r[i].match(s);if(null!==e&&e[2]===n){if(-1!==a){if("END"!==e[1])break;u=i;break}if("BEGIN"!==e[1])break;a=i}}if(-1===a||-1===u)throw new Error("PEM section not found for: "+n);const c=r.slice(a+1,u).join("");c.replace(/[^a-z0-9+/=]+/gi,"");const h=i.from(c,"base64");return o.prototype.decode.call(this,h,t)}},22627:(e,t,r)=>{"use strict";const n=r(12534),i=r(39138).Buffer,o=r(32319),s=r(38266);function a(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){o.call(this,"der",e)}function c(e){return e<10?"0"+e:e}e.exports=a,a.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(u,o),u.prototype._encodeComposite=function(e,t,r,n){const o=function(e,t,r,n){let i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(s.tagByName.hasOwnProperty(e))i=s.tagByName[e];else{if("number"!==typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}if(i>=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.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 a=1;for(let i=n.length;i>=256;i>>=8)a++;const u=i.alloc(2+a);u[0]=o,u[1]=128|a;for(let i=1+a,s=n.length;s>0;i--,s>>=8)u[i]=255&s;return this._createEncoderBuffer([u,n])},u.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")},u.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 i=0;i<e.length;i++){let t=e[i];for(n++;t>=128;t>>=7)n++}const o=i.alloc(n);let s=o.length-1;for(let i=e.length-1;i>=0;i--){let t=e[i];for(o[s--]=127&t;(t>>=7)>0;)o[s--]=128|127&t}return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(e,t){let r;const n=new Date(e);return"gentime"===t?r=[c(n.getUTCFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(n.getUTCFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.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 i=e;i>=256;i>>=8)r++;const n=new Array(r);for(let i=n.length-1;i>=0;i--)n[i]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"===typeof e&&(e=e(t)),e._getEncoder("der").tree},u.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}},37407:(e,t,r)=>{"use strict";const n=t;n.der=r(22627),n.pem=r(78540)},78540:(e,t,r)=>{"use strict";const n=r(12534),i=r(22627);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 i=0;i<r.length;i+=64)n.push(r.slice(i,i+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},87664:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(80950).Buffer}catch(A){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],d=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n("undefined"!==typeof s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],l=8191&h,f=h>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,M=E>>>13,A=0|s[5],I=8191&A,k=A>>>13,T=0|s[6],R=8191&T,P=T>>>13,C=0|s[7],O=8191&C,x=C>>>13,B=0|s[8],D=8191&B,N=B>>>13,L=0|s[9],K=8191&L,U=L>>>13,j=0|a[0],q=8191&j,F=j>>>13,z=0|a[1],V=8191&z,H=z>>>13,G=0|a[2],W=8191&G,Y=G>>>13,Z=0|a[3],X=8191&Z,J=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],le=8191&he,fe=he>>>13,de=0|a[9],pe=8191&de,ye=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(y,q)|0,o=Math.imul(y,F);var me=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(b,q)|0,o=Math.imul(b,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0;var be=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var ve=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,F))+Math.imul(k,q)|0,o=Math.imul(k,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,F))+Math.imul(P,q)|0,o=Math.imul(P,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,F))+Math.imul(x,q)|0,o=Math.imul(x,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Se=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,F))+Math.imul(N,q)|0,o=Math.imul(N,F),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Me=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(K,q),i=(i=Math.imul(K,F))+Math.imul(U,q)|0,o=Math.imul(U,F),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,H)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,fe)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(K,V),i=(i=Math.imul(K,H))+Math.imul(U,V)|0,o=Math.imul(U,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(K,W),i=(i=Math.imul(K,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,fe)|0;var ke=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(K,X),i=(i=Math.imul(K,J))+Math.imul(U,X)|0,o=Math.imul(U,J),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,fe)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(K,$),i=(i=Math.imul(K,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var Re=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(K,re),i=(i=Math.imul(K,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,fe)|0;var Pe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(K,oe),i=(i=Math.imul(K,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,fe)|0;var Ce=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(K,ue),i=(i=Math.imul(K,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,fe)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(K,le),i=(i=Math.imul(K,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var xe=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Be=(c+(n=Math.imul(K,pe))|0)+((8191&(i=(i=Math.imul(K,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ye))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ge,u[1]=me,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Se,u[8]=Me,u[9]=Ae,u[10]=Ie,u[11]=ke,u[12]=Te,u[13]=Re,u[14]=Pe,u[15]=Ce,u[16]=Oe,u[17]=xe,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;a=67108863&(f=f+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var l=u,f=c,d=0;d<s;d++){var p=r[h+d],y=n[h+d],g=r[h+d+s],m=n[h+d+s],b=l*g-f*m;m=l*m+f*g,g=b,r[h+d]=p+g,n[h+d]=y+m,r[h+d+s]=p-g,n[h+d+s]=y-m,d!==a&&(b=u*l-c*f,f=u*f+c*l,l=b)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,l,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"===typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(l)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(l,new o(1).iushln(p-g-1));f=f.redMul(m),l=m.redSqr(),d=d.redMul(l),p=g}return f},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},2009:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),h=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[h++]=255&t);1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(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("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},80518:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(46601).Buffer}catch(T){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),u=t;u<a;u++){var c=e.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){h(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(T){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],h=p[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var y=l.modrn(h).toString(e);r=(l=l.idivn(h)).isZero()?y+r:f[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],l=8191&h,f=h>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,M=E>>>13,A=0|s[5],I=8191&A,k=A>>>13,T=0|s[6],R=8191&T,P=T>>>13,C=0|s[7],O=8191&C,x=C>>>13,B=0|s[8],D=8191&B,N=B>>>13,L=0|s[9],K=8191&L,U=L>>>13,j=0|a[0],q=8191&j,F=j>>>13,z=0|a[1],V=8191&z,H=z>>>13,G=0|a[2],W=8191&G,Y=G>>>13,Z=0|a[3],X=8191&Z,J=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],le=8191&he,fe=he>>>13,de=0|a[9],pe=8191&de,ye=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(y,q)|0,o=Math.imul(y,F);var me=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(b,q)|0,o=Math.imul(b,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0;var be=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var ve=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,F))+Math.imul(k,q)|0,o=Math.imul(k,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,F))+Math.imul(P,q)|0,o=Math.imul(P,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,F))+Math.imul(x,q)|0,o=Math.imul(x,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Se=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,F))+Math.imul(N,q)|0,o=Math.imul(N,F),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Me=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(K,q),i=(i=Math.imul(K,F))+Math.imul(U,q)|0,o=Math.imul(U,F),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,H)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,fe)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(K,V),i=(i=Math.imul(K,H))+Math.imul(U,V)|0,o=Math.imul(U,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(K,W),i=(i=Math.imul(K,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,fe)|0;var ke=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(K,X),i=(i=Math.imul(K,J))+Math.imul(U,X)|0,o=Math.imul(U,J),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,fe)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(K,$),i=(i=Math.imul(K,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var Re=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(K,re),i=(i=Math.imul(K,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,fe)|0;var Pe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(K,oe),i=(i=Math.imul(K,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,fe)|0;var Ce=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(K,ue),i=(i=Math.imul(K,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,fe)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(K,le),i=(i=Math.imul(K,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var xe=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Be=(c+(n=Math.imul(K,pe))|0)+((8191&(i=(i=Math.imul(K,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ye))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ge,u[1]=me,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Se,u[8]=Me,u[9]=Ae,u[10]=Ie,u[11]=ke,u[12]=Te,u[13]=Re,u[14]=Pe,u[15]=Ce,u[16]=Oe,u[17]=xe,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;a=67108863&(f=f+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(e,t,r){return m(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=y),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?y(this,e,t):r<1024?m(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},v.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var l=u,f=c,d=0;d<s;d++){var p=r[h+d],y=n[h+d],g=r[h+d+s],m=n[h+d+s],b=l*g-f*m;m=l*m+f*g,g=b,r[h+d]=p+g,n[h+d]=y+m,r[h+d+s]=p-g,n[h+d+s]=y-m,d!==a&&(b=u*l-c*f,f=u*f+c*l,l=b)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},v.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,l,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"===typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(l)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(E,_),E.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},E.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(S,_),i(M,_),i(A,_),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new S;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},I.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(l,new o(1).iushln(p-g-1));f=f.redMul(m),l=m.redSqr(),d=d.redMul(l),p=g}return f},I.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},I.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,I),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},26084:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"===typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"===typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(89214);if("function"!==typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(s){}},59915:(e,t,r)=>{var n=r(82543).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function o(e){for(;0<e.length;e++)e[0]=0}function s(e,t,r,n,i){for(var o,s,a,u,c=r[0],h=r[1],l=r[2],f=r[3],d=e[0]^t[0],p=e[1]^t[1],y=e[2]^t[2],g=e[3]^t[3],m=4,b=1;b<i;b++)o=c[d>>>24]^h[p>>>16&255]^l[y>>>8&255]^f[255&g]^t[m++],s=c[p>>>24]^h[y>>>16&255]^l[g>>>8&255]^f[255&d]^t[m++],a=c[y>>>24]^h[g>>>16&255]^l[d>>>8&255]^f[255&p]^t[m++],u=c[g>>>24]^h[d>>>16&255]^l[p>>>8&255]^f[255&y]^t[m++],d=o,p=s,y=a,g=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[y>>>8&255]<<8|n[255&g])^t[m++],s=(n[p>>>24]<<24|n[y>>>16&255]<<16|n[g>>>8&255]<<8|n[255&d])^t[m++],a=(n[y>>>24]<<24|n[g>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^t[m++],u=(n[g>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&y])^t[m++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var c=a^a<<1^a<<2^a<<3^a<<4;c=c>>>8^255&c^99,r[s]=c,n[c]=s;var h=e[s],l=e[h],f=e[l],d=257*e[c]^16843008*c;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*f^65537*l^257*h^16843008*s,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===s?s=a=1:(s=h^e[e[e[f^h]]],a^=e[e[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(e){this._key=i(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],o=0;o<t;o++)i[o]=e[o];for(o=t;o<n;o++){var s=i[o-1];o%t===0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=a[o/t|0]<<24):t>6&&o%t===4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),i[o]=i[o-t]^s}for(var c=[],h=0;h<n;h++){var l=n-h,f=i[l-(h%4?0:4)];c[h]=h<4||l<=4?f:u.INV_SUB_MIX[0][u.SBOX[f>>>24]]^u.INV_SUB_MIX[1][u.SBOX[f>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[f>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&f]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return s(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},c.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=s(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=c},3560:(e,t,r)=>{var n=r(59915),i=r(82543).Buffer,o=r(92221),s=r(12534),a=r(15283),u=r(35865),c=r(8387);function h(e,t,r,s){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(t);var h=this._cipher.encryptBlock(u);this._ghash=new a(h),r=function(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var n=new a(r),o=t.length,s=o%16;n.update(t),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var u=8*o,h=i.alloc(8);h.writeUIntBE(u,0,8),n.update(h),e._finID=n.state;var l=i.from(e._finID);return c(l),l}(this,r,h),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}s(h,o),h.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},h.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i<n;++i)r+=e[i]^t[i];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},h.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},h.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},h.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=h},23525:(e,t,r)=>{var n=r(25270),i=r(75194),o=r(44946);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},75194:(e,t,r)=>{var n=r(3560),i=r(82543).Buffer,o=r(88172),s=r(12776),a=r(92221),u=r(59915),c=r(48462);function h(e,t,r){a.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function f(e,t,r){var a=o[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"===typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"===typeof t&&(t=i.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===a.type?new s(a.module,t,r,!0):"auth"===a.type?new n(a.module,t,r,!0):new h(a.module,t,r)}r(12534)(h,a),h.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=i.concat([this.cache,e])},l.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return f(e,n.key,n.iv)},t.createDecipheriv=f},25270:(e,t,r)=>{var n=r(88172),i=r(3560),o=r(82543).Buffer,s=r(12776),a=r(92221),u=r(59915),c=r(48462);function h(e,t,r){a.call(this),this._cache=new f,this._cipher=new u.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(12534)(h,a),h.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return o.concat(n)};var l=o.alloc(16,16);function f(){this.cache=o.allocUnsafe(0)}function d(e,t,r){var a=n[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"===typeof t&&(t=o.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);if("string"===typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,t,r):"auth"===a.type?new i(a.module,t,r):new h(a.module,t,r)}h.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},h.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=o.concat([this.cache,e])},f.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},f.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},t.createCipheriv=d,t.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(t,!1,r.key,r.iv);return d(e,i.key,i.iv)}},15283:(e,t,r)=>{var n=r(82543).Buffer,i=n.alloc(16,0);function o(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function s(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},s.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!==(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!==(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},s.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=s},8387:e=>{e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},10694:(e,t,r)=>{var n=r(35865);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},33492:(e,t,r)=>{var n=r(82543).Buffer,i=r(35865);function o(e,t,r){var o=t.length,s=i(t,e._cache);return e._cache=e._cache.slice(o),e._prev=n.concat([e._prev,r?t:s]),s}t.encrypt=function(e,t,r){for(var i,s=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){s=n.concat([s,o(e,t,r)]);break}i=e._cache.length,s=n.concat([s,o(e,t.slice(0,i),r)]),t=t.slice(i)}return s}},61400:(e,t,r)=>{var n=r(82543).Buffer;function i(e,t,r){for(var n,i,s=-1,a=0;++s<8;)n=t&1<<7-s?128:0,a+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^n))>>s%8,e._prev=o(e._prev,r?n:i);return a}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)o[i]=e[i]<<1|e[i+1]>>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(e,t[a],r);return s}},38681:(e,t,r)=>{var n=r(82543).Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var o=t.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(e,t[a],r);return s}},89347:(e,t,r)=>{var n=r(35865),i=r(82543).Buffer,o=r(8387);function s(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),o=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var u=s(e),c=o+16*a;e._cache.writeUInt32BE(u[0],c+0),e._cache.writeUInt32BE(u[1],c+4),e._cache.writeUInt32BE(u[2],c+8),e._cache.writeUInt32BE(u[3],c+12)}var h=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,h)}},14097:(e,t)=>{t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},88172:(e,t,r)=>{var n={ECB:r(14097),CBC:r(10694),CFB:r(33492),CFB8:r(38681),CFB1:r(61400),OFB:r(91746),CTR:r(89347),GCM:r(89347)},i=r(44946);for(var o in i)i[o].module=n[i[o].mode];e.exports=i},91746:(e,t,r)=>{var n=r(19778).Buffer,i=r(35865);function o(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=n.concat([e._cache,o(e)]);var r=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),i(t,r)}},12776:(e,t,r)=>{var n=r(59915),i=r(82543).Buffer,o=r(92221);function s(e,t,r,s){o.call(this),this._cipher=new n.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=e}r(12534)(s,o),s.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},e.exports=s},69161:(e,t,r)=>{var n=r(47788),i=r(23525),o=r(88172),s=r(67282),a=r(48462);function u(e,t,r){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,r);if(s[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function c(e,t,r){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,r);if(s[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,n=s[e].iv}var i=a(t,!1,r,n);return u(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");r=8*s[e].key,n=s[e].iv}var i=a(t,!1,r,n);return c(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=c,t.listCiphers=t.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},47788:(e,t,r)=>{var n=r(92221),i=r(7439),o=r(12534),s=r(82543).Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(e){n.call(this);var t,r=e.mode.toLowerCase(),i=a[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var u=e.iv;s.isBuffer(u)||(u=s.from(u)),this._des=i.create({key:o,iv:u,type:t})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],e.exports=u,o(u,n),u.prototype._update=function(e){return s.from(this._des.update(e))},u.prototype._final=function(){return s.from(this._des.final())}},67282:(e,t)=>{t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},81330:(e,t,r)=>{var n=r(19778).Buffer,i=r(80518),o=r(12525);function s(e){var t,r=e.modulus.byteLength();do{t=new i(o(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function a(e,t){var r=function(e){var t=s(e);return{blinder:t.toRed(i.mont(e.modulus)).redPow(new i(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),o=t.modulus.byteLength(),a=new i(e).mul(r.blinder).umod(t.modulus),u=a.toRed(i.mont(t.prime1)),c=a.toRed(i.mont(t.prime2)),h=t.coefficient,l=t.prime1,f=t.prime2,d=u.redPow(t.exponent1).fromRed(),p=c.redPow(t.exponent2).fromRed(),y=d.isub(p).imul(h).umod(l).imul(f);return p.iadd(y).imul(r.unblinder).umod(t.modulus).toArrayLike(n,"be",o)}a.getr=s,e.exports=a},77050:(e,t,r)=>{e.exports=r(75207)},87834:(e,t,r)=>{var n=r(34777).Buffer,i=r(83569),o=r(90723),s=r(12534),a=r(45908),u=r(71666),c=r(75207);function h(e){o.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function l(e){o.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){return new h(e)}function d(e){return new l(e)}Object.keys(c).forEach((function(e){c[e].id=n.from(c[e].id,"hex"),c[e.toLowerCase()]=c[e]})),s(h,o.Writable),h.prototype._write=function(e,t,r){this._hash.update(e),r()},h.prototype.update=function(e,t){return"string"===typeof e&&(e=n.from(e,t)),this._hash.update(e),this},h.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),n=a(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},s(l,o.Writable),l.prototype._write=function(e,t,r){this._hash.update(e),r()},l.prototype.update=function(e,t){return"string"===typeof e&&(e=n.from(e,t)),this._hash.update(e),this},l.prototype.verify=function(e,t,r){"string"===typeof t&&(t=n.from(t,r)),this.end();var i=this._hash.digest();return u(t,i,e,this._signType,this._tag)},e.exports={Sign:f,Verify:d,createSign:f,createVerify:d}},45908:(e,t,r)=>{var n=r(34777).Buffer,i=r(57651),o=r(81330),s=r(6289).ec,a=r(80518),u=r(37510),c=r(1308);function h(e,t,r,o){if((e=n.from(e.toArray())).length<t.byteLength()){var s=n.alloc(t.byteLength()-e.length);e=n.concat([s,e])}var a=r.length,u=function(e,t){e=(e=l(e,t)).mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}(r,t),c=n.alloc(a);c.fill(1);var h=n.alloc(a);return h=i(o,h).update(c).update(n.from([0])).update(e).update(u).digest(),c=i(o,h).update(c).digest(),{k:h=i(o,h).update(c).update(n.from([1])).update(e).update(u).digest(),v:c=i(o,h).update(c).digest()}}function l(e,t){var r=new a(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function f(e,t,r){var o,s;do{for(o=n.alloc(0);8*o.length<e.bitLength();)t.v=i(r,t.k).update(t.v).digest(),o=n.concat([o,t.v]);s=l(o,e),t.k=i(r,t.k).update(t.v).update(n.from([0])).digest(),t.v=i(r,t.k).update(t.v).digest()}while(-1!==s.cmp(e));return s}function d(e,t,r,n){return e.toRed(a.mont(r)).redPow(t).fromRed().mod(n)}e.exports=function(e,t,r,i,p){var y=u(t);if(y.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(e,t){var r=c[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var i=new s(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}(e,y)}if("dsa"===y.type){if("dsa"!==i)throw new Error("wrong private key type");return function(e,t,r){var i,o=t.params.priv_key,s=t.params.p,u=t.params.q,c=t.params.g,p=new a(0),y=l(e,u).mod(u),g=!1,m=h(o,u,e,r);for(;!1===g;)p=d(c,i=f(u,m,r),s,u),0===(g=i.invm(u).imul(y.add(o.mul(p))).mod(u)).cmpn(0)&&(g=!1,p=new a(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e));128&t[0]&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}(p,g)}(e,y,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");e=n.concat([p,e]);for(var g=y.modulus.byteLength(),m=[0,1];e.length+m.length+1<g;)m.push(255);m.push(0);for(var b=-1;++b<e.length;)m.push(e[b]);return o(m,y)},e.exports.getKey=h,e.exports.makeKey=f},71666:(e,t,r)=>{var n=r(34777).Buffer,i=r(80518),o=r(6289).ec,s=r(37510),a=r(1308);function u(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,t,r,c,h){var l=s(r);if("ec"===l.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),s=r.data.subjectPrivateKey.data;return i.verify(t,e,s)}(e,t,l)}if("dsa"===l.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=r.data.p,o=r.data.q,a=r.data.g,c=r.data.pub_key,h=s.signature.decode(e,"der"),l=h.s,f=h.r;u(l,o),u(f,o);var d=i.mont(n),p=l.invm(o);return 0===a.toRed(d).redPow(new i(t).mul(p).mod(o)).fromRed().mul(c.toRed(d).redPow(f.mul(p).mod(o)).fromRed()).mod(n).mod(o).cmp(f)}(e,t,l)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");t=n.concat([h,t]);for(var f=l.modulus.byteLength(),d=[1],p=0;t.length+d.length+2<f;)d.push(255),p++;d.push(0);for(var y=-1;++y<t.length;)d.push(t[y]);d=n.from(d);var g=i.mont(l.modulus);e=(e=new i(e).toRed(g)).redPow(new i(l.publicExponent)),e=n.from(e.fromRed().toArray());var m=p<8?1:0;for(f=Math.min(e.length,d.length),e.length!==d.length&&(m=1),y=-1;++y<f;)m|=e[y]^d[y];return 0===m}},34777:(e,t,r)=>{var n=r(19778),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},35865:(e,t,r)=>{var n=r(19778).Buffer;e.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new n(r),o=0;o<r;++o)i[o]=e[o]^t[o];return i}},19778:(e,t,r)=>{"use strict";const n=r(2009),i=r(84038),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,r)}function c(e,t,r){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!==typeof e.length||X(e.length)?a(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return h(e),a(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(X(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return Y(G(t,e.length-r),e,r,n)}function E(e,t,r,n){return Y(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return Y(W(t),e,r,n)}function M(e,t,r,n){return Y(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128===(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128===(192&r)&&128===(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128===(192&r)&&128===(192&n)&&128===(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?a(e):void 0!==t?"string"===typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return l(e)},u.allocUnsafeSlow=function(e){return l(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),h=e.slice(t,r);for(let u=0;u<a;++u)if(c[u]!==h[u]){o=c[u],s=h[u];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"===typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function P(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=t;o<r;++o)i+=J[e[o]];return i}function C(e,t,r){const n=e.slice(t,r);let i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function O(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function B(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function D(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function K(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Q((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Q((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Q((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=Q((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Q((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Q((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"===typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"===typeof e){if("string"===typeof t?(n=t,t=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"===typeof e?e&=255:"boolean"===typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const U={};function j(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name="".concat(this.name," [").concat(e,"]"),this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function F(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"===typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(o+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(o+1)-1).concat(n,") and < 2 ** ")+"".concat(8*(o+1)-1).concat(n):">= ".concat(t).concat(n," and <= ").concat(r).concat(n),new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function z(e,t){if("number"!==typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"===typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i),n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function Y(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!==e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Q(e){return"undefined"===typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},12951:e=>{e.exports=e=>t=>(r,n)=>{0===r&&t(0,((t,r)=>{n(t,1===t?e(r):r)}))}},72042:e=>{e.exports=function(){let e=[];return(t,r)=>{if(0===t){const t=r;e.push(t),t(0,(r=>{if(2===r){const r=e.indexOf(t);r>-1&&e.splice(r,1)}}))}else{const n=e.slice(0);for(let i,o=0,s=n.length;o<s;o++)i=n[o],e.indexOf(i)>-1&&i(t,r)}}}},92221:(e,t,r)=>{var n=r(82543).Buffer,i=r(41064).Transform,o=r(15948).s;function s(e){i.call(this),this.hashMode="string"===typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(12534)(s,i),s.prototype.update=function(e,t,r){"string"===typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(i){n=i}finally{r(n)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=s},69420:(e,t,r)=>{var n=r(19778).Buffer,i=r(6289),o=r(39236);e.exports=function(e){return new a(e)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(e){this.curveType=s[e],this.curveType||(this.curveType={name:e}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function u(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new n(e);if(r&&i.length<r){var o=new n(r-i.length);o.fill(0),i=n.concat([o,i])}return t?i.toString(t):i}s.p224=s.secp224r1,s.p256=s.secp256r1=s.prime256v1,s.p192=s.secp192r1=s.prime192v1,s.p384=s.secp384r1,s.p521=s.secp521r1,a.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},a.prototype.computeSecret=function(e,t,r){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),u(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},a.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),u(r,e)},a.prototype.getPrivateKey=function(e){return u(this.keys.getPrivate(),e)},a.prototype.setPublicKey=function(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this.keys._importPublic(e),this},a.prototype.setPrivateKey=function(e,t){t=t||"utf8",n.isBuffer(e)||(e=new n(e,t));var r=new o(e);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}},39236:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(8623).Buffer}catch(A){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],d=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n("undefined"!==typeof s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],l=8191&h,f=h>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,M=E>>>13,A=0|s[5],I=8191&A,k=A>>>13,T=0|s[6],R=8191&T,P=T>>>13,C=0|s[7],O=8191&C,x=C>>>13,B=0|s[8],D=8191&B,N=B>>>13,L=0|s[9],K=8191&L,U=L>>>13,j=0|a[0],q=8191&j,F=j>>>13,z=0|a[1],V=8191&z,H=z>>>13,G=0|a[2],W=8191&G,Y=G>>>13,Z=0|a[3],X=8191&Z,J=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],le=8191&he,fe=he>>>13,de=0|a[9],pe=8191&de,ye=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(y,q)|0,o=Math.imul(y,F);var me=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(b,q)|0,o=Math.imul(b,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0;var be=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var ve=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,F))+Math.imul(k,q)|0,o=Math.imul(k,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,F))+Math.imul(P,q)|0,o=Math.imul(P,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,F))+Math.imul(x,q)|0,o=Math.imul(x,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Se=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,F))+Math.imul(N,q)|0,o=Math.imul(N,F),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Me=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(K,q),i=(i=Math.imul(K,F))+Math.imul(U,q)|0,o=Math.imul(U,F),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,H)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,fe)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(K,V),i=(i=Math.imul(K,H))+Math.imul(U,V)|0,o=Math.imul(U,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(K,W),i=(i=Math.imul(K,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,fe)|0;var ke=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(K,X),i=(i=Math.imul(K,J))+Math.imul(U,X)|0,o=Math.imul(U,J),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,fe)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(K,$),i=(i=Math.imul(K,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var Re=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(K,re),i=(i=Math.imul(K,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,fe)|0;var Pe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(K,oe),i=(i=Math.imul(K,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,fe)|0;var Ce=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(K,ue),i=(i=Math.imul(K,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,fe)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(K,le),i=(i=Math.imul(K,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var xe=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Be=(c+(n=Math.imul(K,pe))|0)+((8191&(i=(i=Math.imul(K,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ye))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ge,u[1]=me,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Se,u[8]=Me,u[9]=Ae,u[10]=Ie,u[11]=ke,u[12]=Te,u[13]=Re,u[14]=Pe,u[15]=Ce,u[16]=Oe,u[17]=xe,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;a=67108863&(f=f+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var l=u,f=c,d=0;d<s;d++){var p=r[h+d],y=n[h+d],g=r[h+d+s],m=n[h+d+s],b=l*g-f*m;m=l*m+f*g,g=b,r[h+d]=p+g,n[h+d]=y+m,r[h+d+s]=p-g,n[h+d+s]=y-m,d!==a&&(b=u*l-c*f,f=u*f+c*l,l=b)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,l,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"===typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(l)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(l,new o(1).iushln(p-g-1));f=f.redMul(m),l=m.redSqr(),d=d.redMul(l),p=g}return f},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},83569:(e,t,r)=>{"use strict";var n=r(12534),i=r(68437),o=r(83375),s=r(85730),a=r(92221);function u(e){a.call(this,"digest"),this._hash=e}n(u,a),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(s(e))}},55378:(e,t,r)=>{var n=r(68437);e.exports=function(e){return(new n).update(e).digest()}},57651:(e,t,r)=>{"use strict";var n=r(12534),i=r(43189),o=r(92221),s=r(82543).Buffer,a=r(55378),u=r(83375),c=r(85730),h=s.alloc(128);function l(e,t){o.call(this,"digest"),"string"===typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length<r&&(t=s.concat([t,h],r));for(var n=this._ipad=s.allocUnsafe(r),i=this._opad=s.allocUnsafe(r),a=0;a<r;a++)n[a]=54^t[a],i[a]=92^t[a];this._hash="rmd160"===e?new u:c(e),this._hash.update(n)}n(l,o),l.prototype._update=function(e){this._hash.update(e)},l.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new u:c(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new l("rmd160",t):"md5"===e?new i(a,t):new l(e,t)}},43189:(e,t,r)=>{"use strict";var n=r(12534),i=r(82543).Buffer,o=r(92221),s=i.alloc(128),a=64;function u(e,t){o.call(this,"digest"),"string"===typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>a?t=e(t):t.length<a&&(t=i.concat([t,s],a));for(var r=this._ipad=i.allocUnsafe(a),n=this._opad=i.allocUnsafe(a),u=0;u<a;u++)r[u]=54^t[u],n[u]=92^t[u];this._hash=[r]}n(u,o),u.prototype._update=function(e){this._hash.push(e)},u.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=u},86433:(e,t,r)=>{"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(12525),t.createHash=t.Hash=r(83569),t.createHmac=t.Hmac=r(57651);var n=r(77050),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var s=r(95896);t.pbkdf2=s.pbkdf2,t.pbkdf2Sync=s.pbkdf2Sync;var a=r(69161);t.Cipher=a.Cipher,t.createCipher=a.createCipher,t.Cipheriv=a.Cipheriv,t.createCipheriv=a.createCipheriv,t.Decipher=a.Decipher,t.createDecipher=a.createDecipher,t.Decipheriv=a.Decipheriv,t.createDecipheriv=a.createDecipheriv,t.getCiphers=a.getCiphers,t.listCiphers=a.listCiphers;var u=r(2197);t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var c=r(87834);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=r(69420);var h=r(60012);t.publicEncrypt=h.publicEncrypt,t.privateEncrypt=h.privateEncrypt,t.publicDecrypt=h.publicDecrypt,t.privateDecrypt=h.privateDecrypt;var l=r(50394);t.randomFill=l.randomFill,t.randomFillSync=l.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},7439:(e,t,r)=>{"use strict";t.utils=r(47427),t.Cipher=r(834),t.DES=r(23688),t.CBC=r(1159),t.EDE=r(38534)},1159:(e,t,r)=>{"use strict";var n=r(72325),i=r(12534),o={};function s(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(o),n=0;n<r.length;n++){var s=r[n];t.prototype[s]=o[s]}return t.create=function(e){return new t(e)},t},o._cbcInit=function(){var e=new s(this.options.iv);this._cbcState=e},o._update=function(e,t,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=e[t+a];o._update.call(this,s,0,r,n);for(a=0;a<this.blockSize;a++)s[a]=r[n+a]}else{o._update.call(this,e,t,r,n);for(a=0;a<this.blockSize;a++)r[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=e[t+a]}}},834:(e,t,r)=>{"use strict";var n=r(72325);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<r;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(e){var t=0,r=0,n=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=e.length-(e.length-t)%this.blockSize;t<o;t+=this.blockSize)this._update(e,t,i,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},i.prototype._updateDecrypt=function(e){for(var t=0,r=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},i.prototype._unpad=function(e){return e},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},23688:(e,t,r)=>{"use strict";var n=r(72325),i=r(12534),o=r(47427),s=r(834);function a(){this.tmp=new Array(2),this.keys=null}function u(e){s.call(this,e);var t=new a;this._desState=t,this.deriveKeys(t,e.key)}i(u,s),e.exports=u,u.create=function(e){return new u(e)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(t,0),i=o.readUInt32BE(t,4);o.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var s=0;s<e.keys.length;s+=2){var a=c[s>>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,e.keys,s)}},u.prototype._update=function(e,t,r,n){var i=this._desState,s=o.readUInt32BE(e,t),a=o.readUInt32BE(e,t+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n<e.length;n++)e[n]=r;return!0},u.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)},u.prototype._encrypt=function(e,t,r,n,i){for(var s=t,a=r,u=0;u<e.keys.length;u+=2){var c=e.keys[u],h=e.keys[u+1];o.expand(a,e.tmp,0),c^=e.tmp[0],h^=e.tmp[1];var l=o.substitute(c,h),f=a;a=(s^o.permute(l))>>>0,s=f}o.rip(a,s,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var s=r,a=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],h=e.keys[u+1];o.expand(s,e.tmp,0),c^=e.tmp[0],h^=e.tmp[1];var l=o.substitute(c,h),f=s;s=(a^o.permute(l))>>>0,a=f}o.rip(s,a,n,i)}},38534:(e,t,r)=>{"use strict";var n=r(72325),i=r(12534),o=r(834),s=r(23688);function a(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new a(this.type,this.options.key);this._edeState=t}i(u,o),e.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},47427:(e,t)=>{"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=t>>>a+s&1,i<<=1,i|=e>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=t>>>a+s&1,o<<=1,o|=e>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,n,i){for(var o=0,s=0,a=r.length>>>1,u=0;u<a;u++)o<<=1,o|=e>>>r[u]&1;for(u=a;u<r.length;u++)s<<=1,s|=t>>>r[u]&1;n[i+0]=o>>>0,n[i+1]=s>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r<i.length;r++)t<<=1,t|=e>>>i[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var i=[],o=0;o<t;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},2197:(e,t,r)=>{var n=r(19778).Buffer,i=r(13164),o=r(29799),s=r(4771);var a={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(e){var t=new n(o[e].prime,"hex"),r=new n(o[e].gen,"hex");return new s(t,r)},t.createDiffieHellman=t.DiffieHellman=function e(t,r,o,u){return n.isBuffer(r)||void 0===a[r]?e(t,"binary",r,o):(r=r||"binary",u=u||"binary",o=o||new n([2]),n.isBuffer(o)||(o=new n(o,u)),"number"===typeof t?new s(i(t,o),o,!0):(n.isBuffer(t)||(t=new n(t,r)),new s(t,o,!0)))}},4771:(e,t,r)=>{var n=r(19778).Buffer,i=r(54231),o=new(r(31595)),s=new i(24),a=new i(11),u=new i(10),c=new i(3),h=new i(7),l=r(13164),f=r(12525);function d(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this._pub=new i(e),this}function p(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this._priv=new i(e),this}e.exports=g;var y={};function g(e,t,r){this.setGenerator(t),this.__prime=new i(e),this._prime=i.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=p):this._primeCode=8}function m(e,t){var r=new n(e.toArray());return t?r.toString(t):r}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!==typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in y)return y[n];var i,f=0;if(e.isEven()||!l.simpleSieve||!l.fermatTest(e)||!o.test(e))return f+=1,f+="02"===r||"05"===r?8:4,y[n]=f,f;switch(o.test(e.shrn(1))||(f+=2),r){case"02":e.mod(s).cmp(a)&&(f+=8);break;case"05":(i=e.mod(u)).cmp(c)&&i.cmp(h)&&(f+=8);break;default:f+=4}return y[n]=f,f}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new i(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(e){var t=(e=(e=new i(e)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new n(t.toArray()),o=this.getPrime();if(r.length<o.length){var s=new n(o.length-r.length);s.fill(0),r=n.concat([s,r])}return r},g.prototype.getPublicKey=function(e){return m(this._pub,e)},g.prototype.getPrivateKey=function(e){return m(this._priv,e)},g.prototype.getPrime=function(e){return m(this.__prime,e)},g.prototype.getGenerator=function(e){return m(this._gen,e)},g.prototype.setGenerator=function(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this.__gen=e,this._gen=new i(e),this}},13164:(e,t,r)=>{var n=r(12525);e.exports=b,b.simpleSieve=g,b.fermatTest=m;var i=r(54231),o=new i(24),s=new(r(31595)),a=new i(1),u=new i(2),c=new i(5),h=(new i(16),new i(8),new i(10)),l=new i(3),f=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function y(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<t&&e[i]<=n&&r%e[i]!==0;i++);t!==i&&e[i]<=n||(e[t++]=r)}return p=e,e}function g(e){for(var t=y(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function m(e){var t=i.mont(e);return 0===u.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function b(e,t){if(e<16)return new i(2===t||5===t?[140,123]:[140,39]);var r,p;for(t=new i(t);;){for(r=new i(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;r.mod(h).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(f);)r.iadd(d);if(g(p=r.shrn(1))&&g(r)&&m(p)&&m(r)&&s.test(p)&&s.test(r))return r}}},54231:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(7748).Buffer}catch(A){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],d=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n("undefined"!==typeof s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],l=8191&h,f=h>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,M=E>>>13,A=0|s[5],I=8191&A,k=A>>>13,T=0|s[6],R=8191&T,P=T>>>13,C=0|s[7],O=8191&C,x=C>>>13,B=0|s[8],D=8191&B,N=B>>>13,L=0|s[9],K=8191&L,U=L>>>13,j=0|a[0],q=8191&j,F=j>>>13,z=0|a[1],V=8191&z,H=z>>>13,G=0|a[2],W=8191&G,Y=G>>>13,Z=0|a[3],X=8191&Z,J=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],le=8191&he,fe=he>>>13,de=0|a[9],pe=8191&de,ye=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(y,q)|0,o=Math.imul(y,F);var me=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(b,q)|0,o=Math.imul(b,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0;var be=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var ve=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,F))+Math.imul(k,q)|0,o=Math.imul(k,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,F))+Math.imul(P,q)|0,o=Math.imul(P,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,F))+Math.imul(x,q)|0,o=Math.imul(x,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Se=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,F))+Math.imul(N,q)|0,o=Math.imul(N,F),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Me=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(K,q),i=(i=Math.imul(K,F))+Math.imul(U,q)|0,o=Math.imul(U,F),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,H)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,fe)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(K,V),i=(i=Math.imul(K,H))+Math.imul(U,V)|0,o=Math.imul(U,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(K,W),i=(i=Math.imul(K,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,fe)|0;var ke=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(K,X),i=(i=Math.imul(K,J))+Math.imul(U,X)|0,o=Math.imul(U,J),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,fe)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(K,$),i=(i=Math.imul(K,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var Re=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(K,re),i=(i=Math.imul(K,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,fe)|0;var Pe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(K,oe),i=(i=Math.imul(K,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,fe)|0;var Ce=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(K,ue),i=(i=Math.imul(K,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,fe)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(K,le),i=(i=Math.imul(K,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var xe=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Be=(c+(n=Math.imul(K,pe))|0)+((8191&(i=(i=Math.imul(K,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ye))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ge,u[1]=me,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Se,u[8]=Me,u[9]=Ae,u[10]=Ie,u[11]=ke,u[12]=Te,u[13]=Re,u[14]=Pe,u[15]=Ce,u[16]=Oe,u[17]=xe,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;a=67108863&(f=f+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var l=u,f=c,d=0;d<s;d++){var p=r[h+d],y=n[h+d],g=r[h+d+s],m=n[h+d+s],b=l*g-f*m;m=l*m+f*g,g=b,r[h+d]=p+g,n[h+d]=y+m,r[h+d+s]=p-g,n[h+d+s]=y-m,d!==a&&(b=u*l-c*f,f=u*f+c*l,l=b)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,l,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"===typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(l)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(l,new o(1).iushln(p-g-1));f=f.redMul(m),l=m.redSqr(),d=d.redMul(l),p=g}return f},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6289:(e,t,r)=>{"use strict";var n=t;n.version=r(18597).i8,n.utils=r(82629),n.rand=r(26084),n.curve=r(37075),n.curves=r(13297),n.ec=r(74170),n.eddsa=r(20156)},55950:(e,t,r)=>{"use strict";var n=r(37548),i=r(82629),o=i.getNAF,s=i.getJSF,a=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;var s,u,c=[];for(s=0;s<n.length;s+=r.step){u=0;for(var h=s+r.step-1;h>=s;h--)u=(u<<1)+n[h];c.push(u)}for(var l=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s<c.length;s++)(u=c[s])===d?f=f.mixedAdd(r.points[s]):u===-d&&(f=f.mixedAdd(r.points[s].neg()));l=l.add(f)}return l.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(t,r,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(var h=0;c>=0&&0===s[c];c--)h++;if(c>=0&&h++,u=u.dblp(h),c<0)break;var l=s[c];a(0!==l),u="affine"===e.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var a,u,c,h=this._wnafT1,l=this._wnafT2,f=this._wnafT3,d=0;for(a=0;a<n;a++){var p=(c=t[a])._getNAFPoints(e);h[a]=p.wnd,l[a]=p.points}for(a=n-1;a>=1;a-=2){var y=a-1,g=a;if(1===h[y]&&1===h[g]){var m=[t[y],null,null,t[g]];0===t[y].y.cmp(t[g].y)?(m[1]=t[y].add(t[g]),m[2]=t[y].toJ().mixedAdd(t[g].neg())):0===t[y].y.cmp(t[g].y.redNeg())?(m[1]=t[y].toJ().mixedAdd(t[g]),m[2]=t[y].add(t[g].neg())):(m[1]=t[y].toJ().mixedAdd(t[g]),m[2]=t[y].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[y],r[g]);for(d=Math.max(v[0].length,d),f[y]=new Array(d),f[g]=new Array(d),u=0;u<d;u++){var w=0|v[0][u],_=0|v[1][u];f[y][u]=b[3*(w+1)+(_+1)],f[g][u]=0,l[y]=m}}else f[y]=o(r[y],h[y],this._bitLength),f[g]=o(r[g],h[g],this._bitLength),d=Math.max(f[y].length,d),d=Math.max(f[g].length,d)}var E=this.jpoint(null,null,null),S=this._wnafT4;for(a=d;a>=0;a--){for(var M=0;a>=0;){var A=!0;for(u=0;u<n;u++)S[u]=0|f[u][a],0!==S[u]&&(A=!1);if(!A)break;M++,a--}if(a>=0&&M++,E=E.dblp(M),a<0)break;for(u=0;u<n;u++){var I=S[u];0!==I&&(I>0?c=l[u][I-1>>1]:I<0&&(c=l[u][-I-1>>1].neg()),E="affine"===c.type?E.mixedAdd(c):E.add(c))}}for(a=0;a<n;a++)l[a]=null;return i?E:E.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1===2*r)return 6===e[0]?a(e[e.length-1]%2===0):7===e[0]&&a(e[e.length-1]%2===1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},72124:(e,t,r)=>{"use strict";var n=r(82629),i=r(37548),o=r(12534),s=r(55950),a=n.assert;function u(e){this.twisted=1!==(0|e.a),this.mOneA=this.twisted&&-1===(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|e.c)}function c(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(t&&!u||!t&&u)&&(a=a.redNeg()),this.point(e,a)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,s.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),u=i.redMul(s),c=o.redMul(a),h=i.redMul(a),l=s.redMul(o);return this.curve.point(u,c,l,h)},c.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(e=s.redSub(a).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=s.redSub(a).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(t),c=o.redMul(s),h=a.redMul(u),l=o.redMul(u),f=s.redMul(a);return this.curve.point(c,h,f,l)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),c=i.redAdd(a),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),l=n.redMul(u).redMul(h);return this.curve.twisted?(t=n.redMul(c).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(l,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},37075:(e,t,r)=>{"use strict";var n=t;n.base=r(55950),n.short=r(95536),n.mont=r(29113),n.edwards=r(72124)},29113:(e,t,r)=>{"use strict";var n=r(37548),i=r(12534),o=r(55950),s=r(82629);function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new u(this,e,t)},a.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},95536:(e,t,r)=>{"use strict";var n=r(82629),i=r(37548),o=r(12534),s=r(55950),a=n.assert;function u(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,u,c,h,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,d=this.n.clone(),p=new i(1),y=new i(0),g=new i(0),m=new i(1),b=0;0!==f.cmpn(0);){var v=d.div(f);c=d.sub(v.mul(f)),h=g.sub(v.mul(p));var w=m.sub(v.mul(y));if(!n&&c.cmp(l)<0)t=u.neg(),r=p,n=c.neg(),o=h;else if(n&&2===++b)break;u=c,d=f,f=c,g=p,p=h,m=y,y=w}s=c.neg(),a=h;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),h=0;h<2*o;h++)n[h]=null,i[h]=null;return c},o(c,s.BasePoint),u.prototype.point=function(e,t,r){return new c(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"===typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,s.BasePoint),u.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),h=c.redMul(a),l=n.redMul(c),f=u.redSqr().redIAdd(h).redISub(l).redISub(l),d=u.redMul(l.redISub(f)).redISub(o.redMul(h)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,d,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=r.redMul(u),l=a.redSqr().redIAdd(c).redISub(h).redISub(h),f=a.redMul(h.redISub(l)).redISub(i.redMul(c)),d=this.z.redMul(s);return this.curve.jpoint(l,f,d)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),c=s.redAdd(s);for(t=0;t<e;t++){var h=o.redSqr(),l=c.redSqr(),f=l.redSqr(),d=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(u)),p=o.redMul(l),y=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(y),m=d.redMul(g);m=m.redIAdd(m).redISub(f);var b=c.redMul(a);t+1<e&&(u=u.redMul(f)),o=y,a=b,c=m}return this.curve.jpoint(o,c.redMul(i),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),l=this.y.redSqr(),f=l.redSqr(),d=this.x.redAdd(l).redSqr().redISub(h).redISub(f);d=d.redIAdd(d);var p=h.redAdd(h).redIAdd(h),y=p.redSqr(),g=f.redIAdd(f);g=(g=g.redIAdd(g)).redIAdd(g),e=y.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},h.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),l=this.y.redSqr(),f=this.x.redMul(l),d=this.x.redSub(h).redMul(this.x.redAdd(h));d=d.redAdd(d).redIAdd(d);var p=f.redIAdd(f),y=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(h);var g=l.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=d.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(s),h=a.redSqr().redISub(c.redAdd(c)),l=c.redISub(h),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=a.redMul(l).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,d,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),h=t.redMul(c);h=(h=h.redIAdd(h)).redIAdd(h);var l=this.x.redMul(a).redISub(h);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(l,f,d)},h.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},13297:(e,t,r)=>{"use strict";var n,i=t,o=r(33125),s=r(37075),a=r(82629).assert;function u(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(31025)}catch(h){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},74170:(e,t,r)=>{"use strict";var n=r(37548),i=r(17411),o=r(82629),s=r(13297),a=r(26084),u=o.assert,c=r(80615),h=r(23198);function l(e){if(!(this instanceof l))return new l(e);"string"===typeof e&&(u(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=l,l.prototype.keyPair=function(e){return new c(this,e)},l.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},l.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,o){"object"===typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),u=e.toArray("be",s),c=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new n(1)),f=0;;f++){var d=o.k?o.k(f):new n(c.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(l)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var y=p.getX(),g=y.umod(this.n);if(0!==g.cmpn(0)){var m=d.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==y.cmp(g)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),b^=1),new h({r:g,s:m,recoveryParam:b})}}}}}},l.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new h(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new h(t,i);var o=this.n,s=new n(e),a=t.r,c=t.s,l=1&r,f=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var d=t.r.invm(o),p=o.sub(s).mul(d).umod(o),y=c.mul(d).umod(o);return this.g.mulAdd(p,a,y)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new h(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},80615:(e,t,r)=>{"use strict";var n=r(37548),i=r(82629).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"===typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},23198:(e,t,r)=>{"use strict";var n=r(37548),i=r(82629),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function h(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=u(e,r);if(!1===s)return!1;var c=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var h=u(e,r);if(!1===h)return!1;if(e.length!==h+r.place)return!1;var l=e.slice(r.place,h+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];h(n,t.length),(n=n.concat(t)).push(2),h(n,r.length);var o=n.concat(r),s=[48];return h(s,o.length),s=s.concat(o),i.encode(s,e)}},20156:(e,t,r)=>{"use strict";var n=r(33125),i=r(13297),o=r(82629),s=o.assert,a=o.parseBytes,u=r(1722),c=r(68574);function h(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof h))return new h(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=h,h.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},h.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},h.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},h.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},h.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},h.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},h.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!==(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},h.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(e){return o.intFromLE(e)},h.prototype.isPoint=function(e){return e instanceof this.pointClass}},1722:(e,t,r)=>{"use strict";var n=r(82629),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},68574:(e,t,r)=>{"use strict";var n=r(37548),i=r(82629),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(e,t){this.eddsa=e,"object"!==typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},31025:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},82629:(e,t,r)=>{"use strict";var n=t,i=r(37548),o=r(72325),s=r(94034);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),s=0===(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(s),a=0===(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},37548:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(85568).Buffer}catch(A){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],d=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n("undefined"!==typeof s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],l=8191&h,f=h>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,M=E>>>13,A=0|s[5],I=8191&A,k=A>>>13,T=0|s[6],R=8191&T,P=T>>>13,C=0|s[7],O=8191&C,x=C>>>13,B=0|s[8],D=8191&B,N=B>>>13,L=0|s[9],K=8191&L,U=L>>>13,j=0|a[0],q=8191&j,F=j>>>13,z=0|a[1],V=8191&z,H=z>>>13,G=0|a[2],W=8191&G,Y=G>>>13,Z=0|a[3],X=8191&Z,J=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],le=8191&he,fe=he>>>13,de=0|a[9],pe=8191&de,ye=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(y,q)|0,o=Math.imul(y,F);var me=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(b,q)|0,o=Math.imul(b,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0;var be=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var ve=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,F))+Math.imul(k,q)|0,o=Math.imul(k,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,F))+Math.imul(P,q)|0,o=Math.imul(P,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,F))+Math.imul(x,q)|0,o=Math.imul(x,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Se=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,F))+Math.imul(N,q)|0,o=Math.imul(N,F),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Me=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(K,q),i=(i=Math.imul(K,F))+Math.imul(U,q)|0,o=Math.imul(U,F),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,H)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,fe)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(K,V),i=(i=Math.imul(K,H))+Math.imul(U,V)|0,o=Math.imul(U,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(K,W),i=(i=Math.imul(K,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,fe)|0;var ke=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(K,X),i=(i=Math.imul(K,J))+Math.imul(U,X)|0,o=Math.imul(U,J),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,fe)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(K,$),i=(i=Math.imul(K,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var Re=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(K,re),i=(i=Math.imul(K,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,fe)|0;var Pe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(K,oe),i=(i=Math.imul(K,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,fe)|0;var Ce=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(K,ue),i=(i=Math.imul(K,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,fe)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(K,le),i=(i=Math.imul(K,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var xe=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Be=(c+(n=Math.imul(K,pe))|0)+((8191&(i=(i=Math.imul(K,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ye))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ge,u[1]=me,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Se,u[8]=Me,u[9]=Ae,u[10]=Ie,u[11]=ke,u[12]=Te,u[13]=Re,u[14]=Pe,u[15]=Ce,u[16]=Oe,u[17]=xe,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;a=67108863&(f=f+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var l=u,f=c,d=0;d<s;d++){var p=r[h+d],y=n[h+d],g=r[h+d+s],m=n[h+d+s],b=l*g-f*m;m=l*m+f*g,g=b,r[h+d]=p+g,n[h+d]=y+m,r[h+d+s]=p-g,n[h+d+s]=y-m,d!==a&&(b=u*l-c*f,f=u*f+c*l,l=b)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,l,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"===typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(l)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(l,new o(1).iushln(p-g-1));f=f.redMul(m),l=m.redSqr(),d=d.redMul(l),p=g}return f},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},47465:e=>{"use strict";var t,r="object"===typeof Reflect?Reflect:null,n=r&&"function"===typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"===typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"===typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"===typeof e.on&&y(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"===typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=s.length,c=h,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function f(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"===typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!==typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!==typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"===typeof u)n(u,this,t);else{var c=u.length,h=p(u,c);for(r=0;r<c;++r)n(h[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!==typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},48462:(e,t,r)=>{var n=r(82543).Buffer,i=r(68437);e.exports=function(e,t,r,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),u=n.alloc(o||0),c=n.alloc(0);s>0||o>0;){var h=new i;h.update(c),h.update(e),t&&h.update(t),c=h.digest();var l=0;if(s>0){var f=a.length-s;l=Math.min(s,c.length),c.copy(a,f,0,l),s-=l}if(l<c.length&&o>0){var d=u.length-o,p=Math.min(o,c.length-l);c.copy(u,d,l,l+p),o-=p}}return c.fill(0),{key:a,iv:u}}},86266:(e,t,r)=>{"use strict";var n=r(11160).Buffer,i=r(90723).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(12534)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(i){n=i}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!==typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var s=0,a=8*e.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},11160:(e,t,r)=>{var n=r(19778),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},33125:(e,t,r)=>{var n=t;n.utils=r(79046),n.common=r(79684),n.sha=r(39194),n.ripemd=r(56645),n.hmac=r(93609),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},79684:(e,t,r)=>{"use strict";var n=r(79046),i=r(72325);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},93609:(e,t,r)=>{"use strict";var n=r(79046),i=r(72325);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},56645:(e,t,r)=>{"use strict";var n=r(79046),i=r(79684),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function h(){if(!(this instanceof h))return new h;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function f(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function d(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(h,c),t.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],h=this.h[4],b=r,v=n,w=i,_=c,E=h,S=0;S<80;S++){var M=s(o(u(r,l(S,n,i,c),e[p[S]+t],f(S)),g[S]),h);r=h,h=c,c=o(i,10),i=n,n=M,M=s(o(u(b,l(79-S,v,w,_),e[y[S]+t],d(S)),m[S]),E),b=E,E=_,_=o(w,10),w=v,v=M}M=a(this.h[1],i,_),this.h[1]=a(this.h[2],c,E),this.h[2]=a(this.h[3],h,b),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=M},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},39194:(e,t,r)=>{"use strict";t.sha1=r(77361),t.sha224=r(77753),t.sha256=r(76966),t.sha384=r(51233),t.sha512=r(59063)},77361:(e,t,r)=>{"use strict";var n=r(79046),i=r(79684),o=r(34343),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=o.ft_1,h=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(f,h),e.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],h=this.h[2],f=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=u(s(i,5),c(p,o,h,f),d,r[n],l[p]);d=f,f=h,h=s(o,30),o=i,i=y}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],f),this.h[4]=a(this.h[4],d)},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},77753:(e,t,r)=>{"use strict";var n=r(79046),i=r(76966);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},76966:(e,t,r)=>{"use strict";var n=r(79046),i=r(79684),o=r(34343),s=r(72325),a=n.sum32,u=n.sum32_4,c=n.sum32_5,h=o.ch32,l=o.maj32,f=o.s0_256,d=o.s1_256,p=o.g0_256,y=o.g1_256,g=i.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],m=this.h[3],b=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=c(_,d(b),h(b,v,w),this.k[n],r[n]),S=a(f(i),l(i,o,g));_=w,w=v,v=b,b=a(m,E),m=g,g=o,o=i,i=a(E,S)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],b),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},51233:(e,t,r)=>{"use strict";var n=r(79046),i=r(59063);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},59063:(e,t,r)=>{"use strict";var n=r(79046),i=r(79684),o=r(72325),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,h=n.sum64,l=n.sum64_hi,f=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,g=n.sum64_5_lo,m=i.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function _(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function S(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function M(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function k(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,1)^s(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=a(e,t,1)^a(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,19)^s(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function C(e,t){var r=a(e,t,19)^a(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,m),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=P(r[n-4],r[n-3]),o=C(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=T(r[n-30],r[n-29]),c=R(r[n-30],r[n-29]),h=r[n-32],l=r[n-31];r[n]=d(i,o,s,a,u,c,h,l),r[n+1]=p(i,o,s,a,u,c,h,l)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],c=this.h[5],d=this.h[6],p=this.h[7],m=this.h[8],b=this.h[9],v=this.h[10],T=this.h[11],R=this.h[12],P=this.h[13],C=this.h[14],O=this.h[15];o(this.k.length===r.length);for(var x=0;x<r.length;x+=2){var B=C,D=O,N=I(m,b),L=k(m,b),K=w(m,b,v,T,R),U=_(m,b,v,T,R,P),j=this.k[x],q=this.k[x+1],F=r[x],z=r[x+1],V=y(B,D,N,L,K,U,j,q,F,z),H=g(B,D,N,L,K,U,j,q,F,z);B=M(n,i),D=A(n,i),N=E(n,i,s,a,u),L=S(n,i,s,a,u,c);var G=l(B,D,N,L),W=f(B,D,N,L);C=R,O=P,R=v,P=T,v=m,T=b,m=l(d,p,V,H),b=f(p,p,V,H),d=u,p=c,u=s,c=a,s=n,a=i,n=l(V,H,G,W),i=f(V,H,G,W)}h(this.h,0,n,i),h(this.h,2,s,a),h(this.h,4,u,c),h(this.h,6,d,p),h(this.h,8,m,b),h(this.h,10,v,T),h(this.h,12,R,P),h(this.h,14,C,O)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},34343:(e,t,r)=>{"use strict";var n=r(79046).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},79046:(e,t,r)=>{"use strict";var n=r(72325),i=r(12534);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=u(i.toString(16))}return r},t.zero2=a,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4===0);for(var s=new Array(o/4),a=0,u=t;a<s.length;a++,u+=4){var c;c="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],s[a]=c>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,u,c){var h=0,l=t;return h+=(l=l+n>>>0)<t?1:0,h+=(l=l+o>>>0)<o?1:0,h+=(l=l+a>>>0)<a?1:0,e+r+i+s+u+(h+=(l=l+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,u,c){return t+n+o+a+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},17411:(e,t,r)=>{"use strict";var n=r(33125),i=r(94034),o=r(72325);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!==typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},62110:(e,t,r)=>{"use strict";var n=r(48309),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(e){return n.isMemo(e)?s:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=s;var c=Object.defineProperty,h=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){if(p){var i=d(r);i&&i!==p&&e(t,i,n)}var s=h(r);l&&(s=s.concat(l(r)));for(var a=u(t),y=u(r),g=0;g<s.length;++g){var m=s[g];if(!o[m]&&(!n||!n[m])&&(!y||!y[m])&&(!a||!a[m])){var b=f(r,m);try{c(t,m,b)}catch(v){}}}}return t}},746:(e,t)=>{"use strict";var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,h=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,m=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,v=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function _(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case h:case l:case o:case a:case s:case d:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case y:case u:return e;default:return t}}case i:return t}}}function E(e){return _(e)===l}t.AsyncMode=h,t.ConcurrentMode=l,t.ContextConsumer=c,t.ContextProvider=u,t.Element=n,t.ForwardRef=f,t.Fragment=o,t.Lazy=g,t.Memo=y,t.Portal=i,t.Profiler=a,t.StrictMode=s,t.Suspense=d,t.isAsyncMode=function(e){return E(e)||_(e)===h},t.isConcurrentMode=E,t.isContextConsumer=function(e){return _(e)===c},t.isContextProvider=function(e){return _(e)===u},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return _(e)===f},t.isFragment=function(e){return _(e)===o},t.isLazy=function(e){return _(e)===g},t.isMemo=function(e){return _(e)===y},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===a},t.isStrictMode=function(e){return _(e)===s},t.isSuspense=function(e){return _(e)===d},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===o||e===l||e===a||e===s||e===d||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===y||e.$$typeof===u||e.$$typeof===c||e.$$typeof===f||e.$$typeof===b||e.$$typeof===v||e.$$typeof===w||e.$$typeof===m)},t.typeOf=_},48309:(e,t,r)=>{"use strict";e.exports=r(746)},84038:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,h=-7,l=r?i-1:0,f=r?-1:1,d=e[t+l];for(l+=f,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+e[t+l],l+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+e[t+l],l+=f,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,l=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?f/u:f*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*y}},12534:e=>{"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},68437:(e,t,r)=>{"use strict";var n=r(12534),i=r(86266),o=r(82543).Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<<t|e>>>32-t}function c(e,t,r,n,i,o,s){return u(e+(t&r|~t&n)+i+o|0,s)+t|0}function h(e,t,r,n,i,o,s){return u(e+(t&n|r&~n)+i+o|0,s)+t|0}function l(e,t,r,n,i,o,s){return u(e+(t^r^n)+i+o|0,s)+t|0}function f(e,t,r,n,i,o,s){return u(e+(r^(t|~n))+i+o|0,s)+t|0}n(a,i),a.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,e[0],3614090360,7),o=c(o,r,n,i,e[1],3905402710,12),i=c(i,o,r,n,e[2],606105819,17),n=c(n,i,o,r,e[3],3250441966,22),r=c(r,n,i,o,e[4],4118548399,7),o=c(o,r,n,i,e[5],1200080426,12),i=c(i,o,r,n,e[6],2821735955,17),n=c(n,i,o,r,e[7],4249261313,22),r=c(r,n,i,o,e[8],1770035416,7),o=c(o,r,n,i,e[9],2336552879,12),i=c(i,o,r,n,e[10],4294925233,17),n=c(n,i,o,r,e[11],2304563134,22),r=c(r,n,i,o,e[12],1804603682,7),o=c(o,r,n,i,e[13],4254626195,12),i=c(i,o,r,n,e[14],2792965006,17),r=h(r,n=c(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=h(o,r,n,i,e[6],3225465664,9),i=h(i,o,r,n,e[11],643717713,14),n=h(n,i,o,r,e[0],3921069994,20),r=h(r,n,i,o,e[5],3593408605,5),o=h(o,r,n,i,e[10],38016083,9),i=h(i,o,r,n,e[15],3634488961,14),n=h(n,i,o,r,e[4],3889429448,20),r=h(r,n,i,o,e[9],568446438,5),o=h(o,r,n,i,e[14],3275163606,9),i=h(i,o,r,n,e[3],4107603335,14),n=h(n,i,o,r,e[8],1163531501,20),r=h(r,n,i,o,e[13],2850285829,5),o=h(o,r,n,i,e[2],4243563512,9),i=h(i,o,r,n,e[7],1735328473,14),r=l(r,n=h(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=l(o,r,n,i,e[8],2272392833,11),i=l(i,o,r,n,e[11],1839030562,16),n=l(n,i,o,r,e[14],4259657740,23),r=l(r,n,i,o,e[1],2763975236,4),o=l(o,r,n,i,e[4],1272893353,11),i=l(i,o,r,n,e[7],4139469664,16),n=l(n,i,o,r,e[10],3200236656,23),r=l(r,n,i,o,e[13],681279174,4),o=l(o,r,n,i,e[0],3936430074,11),i=l(i,o,r,n,e[3],3572445317,16),n=l(n,i,o,r,e[6],76029189,23),r=l(r,n,i,o,e[9],3654602809,4),o=l(o,r,n,i,e[12],3873151461,11),i=l(i,o,r,n,e[15],530742520,16),r=f(r,n=l(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=f(o,r,n,i,e[7],1126891415,10),i=f(i,o,r,n,e[14],2878612391,15),n=f(n,i,o,r,e[5],4237533241,21),r=f(r,n,i,o,e[12],1700485571,6),o=f(o,r,n,i,e[3],2399980690,10),i=f(i,o,r,n,e[10],4293915773,15),n=f(n,i,o,r,e[1],2240044497,21),r=f(r,n,i,o,e[8],1873313359,6),o=f(o,r,n,i,e[15],4264355552,10),i=f(i,o,r,n,e[6],2734768916,15),n=f(n,i,o,r,e[13],1309151649,21),r=f(r,n,i,o,e[4],4149444226,6),o=f(o,r,n,i,e[11],3174756917,10),i=f(i,o,r,n,e[2],718787259,15),n=f(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=a},31595:(e,t,r)=>{var n=r(97942),i=r(26084);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),s=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var a=e.subn(1),u=0;!a.testn(u);u++);for(var c=e.shrn(u),h=a.toRed(o);t>0;t--){var l=this._randrange(new n(2),a);r&&r(l);var f=l.toRed(o).redPow(c);if(0!==f.cmp(s)&&0!==f.cmp(h)){for(var d=1;d<u;d++){if(0===(f=f.redSqr()).cmp(s))return!1;if(0===f.cmp(h))break}if(d===u)return!1}}return!0},o.prototype.getDivisor=function(e,t){var r=e.bitLength(),i=n.mont(e),o=new n(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var s=e.subn(1),a=0;!s.testn(a);a++);for(var u=e.shrn(a),c=s.toRed(i);t>0;t--){var h=this._randrange(new n(2),s),l=e.gcd(h);if(0!==l.cmpn(1))return l;var f=h.toRed(i).redPow(u);if(0!==f.cmp(o)&&0!==f.cmp(c)){for(var d=1;d<a;d++){if(0===(f=f.redSqr()).cmp(o))return f.fromRed().subn(1).gcd(e);if(0===f.cmp(c))break}if(d===a)return(f=f.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},97942:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(56619).Buffer}catch(A){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],d=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n("undefined"!==typeof s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],l=8191&h,f=h>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,M=E>>>13,A=0|s[5],I=8191&A,k=A>>>13,T=0|s[6],R=8191&T,P=T>>>13,C=0|s[7],O=8191&C,x=C>>>13,B=0|s[8],D=8191&B,N=B>>>13,L=0|s[9],K=8191&L,U=L>>>13,j=0|a[0],q=8191&j,F=j>>>13,z=0|a[1],V=8191&z,H=z>>>13,G=0|a[2],W=8191&G,Y=G>>>13,Z=0|a[3],X=8191&Z,J=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],le=8191&he,fe=he>>>13,de=0|a[9],pe=8191&de,ye=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(y,q)|0,o=Math.imul(y,F);var me=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(b,q)|0,o=Math.imul(b,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0;var be=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var ve=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,F))+Math.imul(k,q)|0,o=Math.imul(k,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,F))+Math.imul(P,q)|0,o=Math.imul(P,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,F))+Math.imul(x,q)|0,o=Math.imul(x,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Se=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,F))+Math.imul(N,q)|0,o=Math.imul(N,F),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Me=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(K,q),i=(i=Math.imul(K,F))+Math.imul(U,q)|0,o=Math.imul(U,F),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,H)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,fe)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(K,V),i=(i=Math.imul(K,H))+Math.imul(U,V)|0,o=Math.imul(U,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(K,W),i=(i=Math.imul(K,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,fe)|0;var ke=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(K,X),i=(i=Math.imul(K,J))+Math.imul(U,X)|0,o=Math.imul(U,J),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,fe)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(K,$),i=(i=Math.imul(K,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var Re=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(K,re),i=(i=Math.imul(K,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,fe)|0;var Pe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(K,oe),i=(i=Math.imul(K,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,fe)|0;var Ce=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(K,ue),i=(i=Math.imul(K,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,fe)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(K,le),i=(i=Math.imul(K,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var xe=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Be=(c+(n=Math.imul(K,pe))|0)+((8191&(i=(i=Math.imul(K,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ye))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ge,u[1]=me,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Se,u[8]=Me,u[9]=Ae,u[10]=Ie,u[11]=ke,u[12]=Te,u[13]=Re,u[14]=Pe,u[15]=Ce,u[16]=Oe,u[17]=xe,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;a=67108863&(f=f+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var l=u,f=c,d=0;d<s;d++){var p=r[h+d],y=n[h+d],g=r[h+d+s],m=n[h+d+s],b=l*g-f*m;m=l*m+f*g,g=b,r[h+d]=p+g,n[h+d]=y+m,r[h+d+s]=p-g,n[h+d+s]=y-m,d!==a&&(b=u*l-c*f,f=u*f+c*l,l=b)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,l,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"===typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(l)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(l,new o(1).iushln(p-g-1));f=f.redMul(m),l=m.redSqr(),d=d.redMul(l),p=g}return f},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},72325:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},94034:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!==typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},31725:e=>{"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(e,o){for(var s,a,u=i(e),c=1;c<arguments.length;c++){for(var h in s=Object(arguments[c]))r.call(s,h)&&(u[h]=s[h]);if(t){a=t(s);for(var l=0;l<a.length;l++)n.call(s,a[l])&&(u[a[l]]=s[a[l]])}}return u}},63465:(e,t,r)=>{"use strict";var n=r(16522);t.certificate=r(18799);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));t.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=o;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));t.PublicKey=s;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=u;var c=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));t.EncryptedPrivateKey=c;var h=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));t.DSAPrivateKey=h,t.DSAparam=n.define("DSAparam",(function(){this.int()}));var l=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(f),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=l;var f=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},18799:(e,t,r)=>{"use strict";var n=r(16522),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(u)})),h=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),l=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),f=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(h),this.key("validity").use(l),this.key("subject").use(h),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));e.exports=p},722:(e,t,r)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=r(48462),a=r(23525),u=r(82543).Buffer;e.exports=function(e,t){var r,c=e.toString(),h=c.match(n);if(h){var l="aes"+h[1],f=u.from(h[2],"hex"),d=u.from(h[3].replace(/[\r\n]/g,""),"base64"),p=s(t,f.slice(0,8),parseInt(h[1],10)).key,y=[],g=a.createDecipheriv(l,p,f);y.push(g.update(d)),y.push(g.final()),r=u.concat(y)}else{var m=c.match(o);r=u.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},37510:(e,t,r)=>{var n=r(63465),i=r(22562),o=r(722),s=r(23525),a=r(95896),u=r(82543).Buffer;function c(e){var t;"object"!==typeof e||u.isBuffer(e)||(t=e.passphrase,e=e.key),"string"===typeof e&&(e=u.from(e));var r,c,h=o(e,t),l=h.tag,f=h.data;switch(l){case"CERTIFICATE":c=n.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=n.PublicKey.decode(f,"der")),r=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=n.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":f=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[e.algorithm.decrypt.cipher.algo.join(".")],c=e.algorithm.decrypt.cipher.iv,h=e.subjectPrivateKey,l=parseInt(o.split("-")[1],10)/8,f=a.pbkdf2Sync(t,r,n,l,"sha1"),d=s.createDecipheriv(o,f,c),p=[];return p.push(d.update(h)),p.push(d.final()),u.concat(p)}(f=n.EncryptedPrivateKey.decode(f,"der"),t);case"PRIVATE KEY":switch(r=(c=n.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:n.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=n.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=n.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+l)}}e.exports=c,c.signature=n.signature},95896:(e,t,r)=>{t.pbkdf2=r(66770),t.pbkdf2Sync=r(68017)},66770:(e,t,r)=>{var n,i,o=r(82543).Buffer,s=r(46048),a=r(74404),u=r(68017),c=r(52734),h=r.g.crypto&&r.g.crypto.subtle,l={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},f=[];function d(){return i||(i=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function p(e,t,r,n,i){return h.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return h.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)})).then((function(e){return o.from(e)}))}e.exports=function(e,t,i,y,g,m){"function"===typeof g&&(m=g,g=void 0);var b=l[(g=g||"sha1").toLowerCase()];if(b&&"function"===typeof r.g.Promise){if(s(i,y),e=c(e,a,"Password"),t=c(t,a,"Salt"),"function"!==typeof m)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){d()((function(){t(null,e)}))}),(function(e){d()((function(){t(e)}))}))}(function(e){if(r.g.process&&!r.g.process.browser)return Promise.resolve(!1);if(!h||!h.importKey||!h.deriveBits)return Promise.resolve(!1);if(void 0!==f[e])return f[e];var t=p(n=n||o.alloc(8),n,10,128,e).then((function(){return!0})).catch((function(){return!1}));return f[e]=t,t}(b).then((function(r){return r?p(e,t,i,y,b):u(e,t,i,y,g)})),m)}else d()((function(){var r;try{r=u(e,t,i,y,g)}catch(n){return m(n)}m(null,r)}))}},74404:(e,t,r)=>{var n,i=r(1426);if(r.g.process&&r.g.process.browser)n="utf-8";else if(r.g.process&&r.g.process.version){n=parseInt(i.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";e.exports=n},46048:e=>{var t=Math.pow(2,30)-1;e.exports=function(e,r){if("number"!==typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!==typeof r)throw new TypeError("Key length not a number");if(r<0||r>t||r!==r)throw new TypeError("Bad key length")}},68017:(e,t,r)=>{var n=r(55378),i=r(83375),o=r(85730),s=r(82543).Buffer,a=r(46048),u=r(74404),c=r(52734),h=s.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,t,r){var a=function(e){function t(t){return o(e).update(t).digest()}function r(e){return(new i).update(e).digest()}return"rmd160"===e||"ripemd160"===e?r:"md5"===e?n:t}(e),u="sha512"===e||"sha384"===e?128:64;t.length>u?t=a(t):t.length<u&&(t=s.concat([t,h],u));for(var c=s.allocUnsafe(u+l[e]),f=s.allocUnsafe(u+l[e]),d=0;d<u;d++)c[d]=54^t[d],f[d]=92^t[d];var p=s.allocUnsafe(u+r+4);c.copy(p,0,0,u),this.ipad1=p,this.ipad2=c,this.opad=f,this.alg=e,this.blocksize=u,this.hash=a,this.size=l[e]}f.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,t,r,n,i){a(r,n);var o=new f(i=i||"sha1",e=c(e,u,"Password"),(t=c(t,u,"Salt")).length),h=s.allocUnsafe(n),d=s.allocUnsafe(t.length+4);t.copy(d,0,0,t.length);for(var p=0,y=l[i],g=Math.ceil(n/y),m=1;m<=g;m++){d.writeUInt32BE(m,t.length);for(var b=o.run(d,o.ipad1),v=b,w=1;w<r;w++){v=o.run(v,o.ipad2);for(var _=0;_<y;_++)b[_]^=v[_]}b.copy(h,p),p+=y}return h}},52734:(e,t,r)=>{var n=r(82543).Buffer;e.exports=function(e,t,r){if(n.isBuffer(e))return e;if("string"===typeof e)return n.from(e,t);if(ArrayBuffer.isView(e))return n.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},1426:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"===typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"===typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,h=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):h=-1,u.length&&f())}function f(){if(!c){var e=s(l);c=!0;for(var t=u.length;t;){for(a=u,u=[];++h<t;)a&&a[h].run();h=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||c||s(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},80888:(e,t,r)=>{"use strict";var n=r(79047);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,o,s){if(s!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return r.PropTypes=r,r}},52007:(e,t,r)=>{e.exports=r(80888)()},79047:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},60012:(e,t,r)=>{t.publicEncrypt=r(92190),t.privateDecrypt=r(93936),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},77135:(e,t,r)=>{var n=r(83569),i=r(82543).Buffer;function o(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){for(var r,s=i.alloc(0),a=0;s.length<t;)r=o(a++),s=i.concat([s,n("sha1").update(e).update(r).digest()]);return s.slice(0,t)}},865:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(77108).Buffer}catch(A){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],d=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n("undefined"!==typeof s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],l=8191&h,f=h>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,M=E>>>13,A=0|s[5],I=8191&A,k=A>>>13,T=0|s[6],R=8191&T,P=T>>>13,C=0|s[7],O=8191&C,x=C>>>13,B=0|s[8],D=8191&B,N=B>>>13,L=0|s[9],K=8191&L,U=L>>>13,j=0|a[0],q=8191&j,F=j>>>13,z=0|a[1],V=8191&z,H=z>>>13,G=0|a[2],W=8191&G,Y=G>>>13,Z=0|a[3],X=8191&Z,J=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],le=8191&he,fe=he>>>13,de=0|a[9],pe=8191&de,ye=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(y,q)|0,o=Math.imul(y,F);var me=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(b,q)|0,o=Math.imul(b,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0;var be=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var ve=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,F))+Math.imul(k,q)|0,o=Math.imul(k,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,F))+Math.imul(P,q)|0,o=Math.imul(P,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,F))+Math.imul(x,q)|0,o=Math.imul(x,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Se=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,F))+Math.imul(N,q)|0,o=Math.imul(N,F),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Me=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(K,q),i=(i=Math.imul(K,F))+Math.imul(U,q)|0,o=Math.imul(U,F),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,H)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,fe)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(K,V),i=(i=Math.imul(K,H))+Math.imul(U,V)|0,o=Math.imul(U,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(K,W),i=(i=Math.imul(K,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,fe)|0;var ke=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(K,X),i=(i=Math.imul(K,J))+Math.imul(U,X)|0,o=Math.imul(U,J),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,fe)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(K,$),i=(i=Math.imul(K,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var Re=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(K,re),i=(i=Math.imul(K,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,fe)|0;var Pe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(K,oe),i=(i=Math.imul(K,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,fe)|0;var Ce=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(K,ue),i=(i=Math.imul(K,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,fe)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(K,le),i=(i=Math.imul(K,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var xe=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Be=(c+(n=Math.imul(K,pe))|0)+((8191&(i=(i=Math.imul(K,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ye))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ge,u[1]=me,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Se,u[8]=Me,u[9]=Ae,u[10]=Ie,u[11]=ke,u[12]=Te,u[13]=Re,u[14]=Pe,u[15]=Ce,u[16]=Oe,u[17]=xe,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;a=67108863&(f=f+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var l=u,f=c,d=0;d<s;d++){var p=r[h+d],y=n[h+d],g=r[h+d+s],m=n[h+d+s],b=l*g-f*m;m=l*m+f*g,g=b,r[h+d]=p+g,n[h+d]=y+m,r[h+d+s]=p-g,n[h+d+s]=y-m,d!==a&&(b=u*l-c*f,f=u*f+c*l,l=b)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,l,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"===typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(l)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(l,new o(1).iushln(p-g-1));f=f.redMul(m),l=m.redSqr(),d=d.redMul(l),p=g}return f},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},93936:(e,t,r)=>{var n=r(37510),i=r(77135),o=r(61214),s=r(865),a=r(81330),u=r(83569),c=r(4383),h=r(82543).Buffer;e.exports=function(e,t,r){var l;l=e.padding?e.padding:r?1:4;var f,d=n(e),p=d.modulus.byteLength();if(t.length>p||new s(t).cmp(d.modulus)>=0)throw new Error("decryption error");f=r?c(new s(t),d):a(t,d);var y=h.alloc(p-f.length);if(f=h.concat([y,f],p),4===l)return function(e,t){var r=e.modulus.byteLength(),n=u("sha1").update(h.alloc(0)).digest(),s=n.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,s+1),c=t.slice(s+1),l=o(a,i(c,s)),f=o(c,i(l,r-s-1));if(function(e,t){e=h.from(e),t=h.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i<n;)r+=e[i]^t[i];return r}(n,f.slice(0,s)))throw new Error("decryption error");var d=s;for(;0===f[d];)d++;if(1!==f[d++])throw new Error("decryption error");return f.slice(d)}(d,f);if(1===l)return function(e,t,r){var n=t.slice(0,2),i=2,o=0;for(;0!==t[i++];)if(i>=t.length){o++;break}var s=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,f,r);if(3===l)return f;throw new Error("unknown padding")}},92190:(e,t,r)=>{var n=r(37510),i=r(12525),o=r(83569),s=r(77135),a=r(61214),u=r(865),c=r(4383),h=r(81330),l=r(82543).Buffer;e.exports=function(e,t,r){var f;f=e.padding?e.padding:r?1:4;var d,p=n(e);if(4===f)d=function(e,t){var r=e.modulus.byteLength(),n=t.length,c=o("sha1").update(l.alloc(0)).digest(),h=c.length,f=2*h;if(n>r-f-2)throw new Error("message too long");var d=l.alloc(r-n-f-2),p=r-h-1,y=i(h),g=a(l.concat([c,d,l.alloc(1,1),t],p),s(y,p)),m=a(y,s(g,h));return new u(l.concat([l.alloc(1),m,g],r))}(p,t);else if(1===f)d=function(e,t,r){var n,o=t.length,s=e.modulus.byteLength();if(o>s-11)throw new Error("message too long");n=r?l.alloc(s-o-3,255):function(e){var t,r=l.allocUnsafe(e),n=0,o=i(2*e),s=0;for(;n<e;)s===o.length&&(o=i(2*e),s=0),(t=o[s++])&&(r[n++]=t);return r}(s-o-3);return new u(l.concat([l.from([0,r?1:2]),n,l.alloc(1),t],s))}(p,t,r);else{if(3!==f)throw new Error("unknown padding");if((d=new u(t)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?h(d,p):c(d,p)}},4383:(e,t,r)=>{var n=r(865),i=r(82543).Buffer;e.exports=function(e,t){return i.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},61214:e=>{e.exports=function(e,t){for(var r=e.length,n=-1;++n<r;)e[n]^=t[n];return e}},12525:(e,t,r)=>{"use strict";var n=r(1426),i=65536,o=4294967295;var s=r(82543).Buffer,a=r.g.crypto||r.g.msCrypto;a&&a.getRandomValues?e.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var r=s.allocUnsafe(e);if(e>0)if(e>i)for(var u=0;u<e;u+=i)a.getRandomValues(r.slice(u,u+i));else a.getRandomValues(r);if("function"===typeof t)return n.nextTick((function(){t(null,r)}));return r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},50394:(e,t,r)=>{"use strict";var n=r(1426);function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(82543),s=r(12525),a=o.Buffer,u=o.kMaxLength,c=r.g.crypto||r.g.msCrypto,h=Math.pow(2,32)-1;function l(e,t){if("number"!==typeof e||e!==e)throw new TypeError("offset must be a number");if(e>h||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function f(e,t,r){if("number"!==typeof e||e!==e)throw new TypeError("size must be a number");if(e>h||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>u)throw new RangeError("buffer too small")}function d(e,t,r,i){if(n.browser){var o=e.buffer,a=new Uint8Array(o,t,r);return c.getRandomValues(a),i?void n.nextTick((function(){i(null,e)})):e}if(!i)return s(r).copy(e,t),e;s(r,(function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)}))}c&&c.getRandomValues||!n.browser?(t.randomFill=function(e,t,n,i){if(!a.isBuffer(e)&&!(e instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof t)i=t,t=0,n=e.length;else if("function"===typeof n)i=n,n=e.length-t;else if("function"!==typeof i)throw new TypeError('"cb" argument must be a function');return l(t,e.length),f(n,t,e.length),d(e,t,n,i)},t.randomFillSync=function(e,t,n){"undefined"===typeof t&&(t=0);if(!a.isBuffer(e)&&!(e instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(t,e.length),void 0===n&&(n=e.length-t);return f(n,t,e.length),d(e,t,n)}):(t.randomFill=i,t.randomFillSync=i)},34463:(e,t,r)=>{"use strict";var n=r(72791),i=r(31725),o=r(45296);function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!n)throw Error(s(227));var a=new Set,u={};function c(e,t){h(e,t),h(e+"Capture",t)}function h(e,t){for(u[e]=t,e=0;e<t.length;e++)a.add(t[e])}var l=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d=Object.prototype.hasOwnProperty,p={},y={};function g(e,t,r,n,i,o,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){m[e]=new g(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];m[t]=new g(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){m[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){m[e]=new g(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){m[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){m[e]=new g(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){m[e]=new g(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){m[e]=new g(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){m[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)}));var b=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function w(e,t,r,n){var i=m.hasOwnProperty(t)?m[t]:null;(null!==i?0===i.type:!n&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,r,n){if(null===t||"undefined"===typeof t||function(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,r,i,n)&&(r=null),n||null===i?function(e){return!!d.call(y,e)||!d.call(p,e)&&(f.test(e)?y[e]=!0:(p[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=null===r?3!==i.type&&"":r:(t=i.attributeName,n=i.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(b,v);m[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(b,v);m[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(b,v);m[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){m[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),m.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){m[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var _=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=60103,S=60106,M=60107,A=60108,I=60114,k=60109,T=60110,R=60112,P=60113,C=60120,O=60115,x=60116,B=60121,D=60128,N=60129,L=60130,K=60131;if("function"===typeof Symbol&&Symbol.for){var U=Symbol.for;E=U("react.element"),S=U("react.portal"),M=U("react.fragment"),A=U("react.strict_mode"),I=U("react.profiler"),k=U("react.provider"),T=U("react.context"),R=U("react.forward_ref"),P=U("react.suspense"),C=U("react.suspense_list"),O=U("react.memo"),x=U("react.lazy"),B=U("react.block"),U("react.scope"),D=U("react.opaque.id"),N=U("react.debug_trace_mode"),L=U("react.offscreen"),K=U("react.legacy_hidden")}var j,q="function"===typeof Symbol&&Symbol.iterator;function F(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=q&&e[q]||e["@@iterator"])?e:null}function z(e){if(void 0===j)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);j=t&&t[1]||""}return"\n"+j+e}var V=!1;function H(e,t){if(!e||V)return"";V=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&"string"===typeof u.stack){for(var i=u.stack.split("\n"),o=n.stack.split("\n"),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(1!==s||1!==a)do{if(s--,0>--a||i[s]!==o[a])return"\n"+i[s].replace(" at new "," at ")}while(1<=s&&0<=a);break}}}finally{V=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?z(e):""}function G(e){switch(e.tag){case 5:return z(e.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return e=H(e.type,!1);case 11:return e=H(e.type.render,!1);case 22:return e=H(e.type._render,!1);case 1:return e=H(e.type,!0);default:return""}}function W(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case M:return"Fragment";case S:return"Portal";case I:return"Profiler";case A:return"StrictMode";case P:return"Suspense";case C:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case T:return(e.displayName||"Context")+".Consumer";case k:return(e._context.displayName||"Context")+".Provider";case R:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case O:return W(e.type);case B:return W(e._render);case x:t=e._payload,e=e._init;try{return W(e(t))}catch(r){}}return null}function Y(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Z(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function X(e){e._valueTracker||(e._valueTracker=function(e){var t=Z(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof r&&"function"===typeof r.get&&"function"===typeof r.set){var i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function J(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Z(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function Q(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function $(e,t){var r=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function ee(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=Y(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&w(e,"checked",t,!1)}function re(e,t){te(e,t);var r=Y(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?ie(e,t.type,r):t.hasOwnProperty("defaultValue")&&ie(e,t.type,Y(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ne(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function ie(e,t,r){"number"===t&&Q(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}function oe(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return n.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function se(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Y(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ae(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(s(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ue(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(s(92));if(Array.isArray(r)){if(!(1>=r.length))throw Error(s(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:Y(r)}}function ce(e,t){var r=Y(t.value),n=Y(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function he(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var le="http://www.w3.org/1999/xhtml",fe="http://www.w3.org/2000/svg";function de(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?de(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ye,ge,me=(ge=function(e,t){if(e.namespaceURI!==fe||"innerHTML"in e)e.innerHTML=t;else{for((ye=ye||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ye.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return ge(e,t)}))}:ge);function be(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var ve={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},we=["Webkit","ms","Moz","O"];function _e(e,t,r){return null==t||"boolean"===typeof t||""===t?"":r||"number"!==typeof t||0===t||ve.hasOwnProperty(e)&&ve[e]?(""+t).trim():t+"px"}function Ee(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=_e(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(ve).forEach((function(e){we.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ve[t]=ve[e]}))}));var Se=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Me(e,t){if(t){if(Se[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(s(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(s(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(s(62))}}function Ae(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Ie(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var ke=null,Te=null,Re=null;function Pe(e){if(e=ni(e)){if("function"!==typeof ke)throw Error(s(280));var t=e.stateNode;t&&(t=oi(t),ke(e.stateNode,e.type,t))}}function Ce(e){Te?Re?Re.push(e):Re=[e]:Te=e}function Oe(){if(Te){var e=Te,t=Re;if(Re=Te=null,Pe(e),t)for(e=0;e<t.length;e++)Pe(t[e])}}function xe(e,t){return e(t)}function Be(e,t,r,n,i){return e(t,r,n,i)}function De(){}var Ne=xe,Le=!1,Ke=!1;function Ue(){null===Te&&null===Re||(De(),Oe())}function je(e,t){var r=e.stateNode;if(null===r)return null;var n=oi(r);if(null===n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!==typeof r)throw Error(s(231,t,typeof r));return r}var qe=!1;if(l)try{var Fe={};Object.defineProperty(Fe,"passive",{get:function(){qe=!0}}),window.addEventListener("test",Fe,Fe),window.removeEventListener("test",Fe,Fe)}catch(ge){qe=!1}function ze(e,t,r,n,i,o,s,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(h){this.onError(h)}}var Ve=!1,He=null,Ge=!1,We=null,Ye={onError:function(e){Ve=!0,He=e}};function Ze(e,t,r,n,i,o,s,a,u){Ve=!1,He=null,ze.apply(Ye,arguments)}function Xe(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function Je(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Qe(e){if(Xe(e)!==e)throw Error(s(188))}function $e(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Xe(e)))throw Error(s(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(n=i.return)){r=n;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===r)return Qe(i),e;if(o===n)return Qe(i),t;o=o.sibling}throw Error(s(188))}if(r.return!==n.return)r=i,n=o;else{for(var a=!1,u=i.child;u;){if(u===r){a=!0,r=i,n=o;break}if(u===n){a=!0,n=i,r=o;break}u=u.sibling}if(!a){for(u=o.child;u;){if(u===r){a=!0,r=o,n=i;break}if(u===n){a=!0,n=o,r=i;break}u=u.sibling}if(!a)throw Error(s(189))}}if(r.alternate!==n)throw Error(s(190))}if(3!==r.tag)throw Error(s(188));return r.stateNode.current===r?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function et(e,t){for(var r=e.alternate;null!==t;){if(t===e||t===r)return!0;t=t.return}return!1}var tt,rt,nt,it,ot=!1,st=[],at=null,ut=null,ct=null,ht=new Map,lt=new Map,ft=[],dt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pt(e,t,r,n,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|r,nativeEvent:i,targetContainers:[n]}}function yt(e,t){switch(e){case"focusin":case"focusout":at=null;break;case"dragenter":case"dragleave":ut=null;break;case"mouseover":case"mouseout":ct=null;break;case"pointerover":case"pointerout":ht.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":lt.delete(t.pointerId)}}function gt(e,t,r,n,i,o){return null===e||e.nativeEvent!==o?(e=pt(t,r,n,i,o),null!==t&&(null!==(t=ni(t))&&rt(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function mt(e){var t=ri(e.target);if(null!==t){var r=Xe(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=Je(r)))return e.blockedOn=t,void it(e.lanePriority,(function(){o.unstable_runWithPriority(e.priority,(function(){nt(r)}))}))}else if(3===t&&r.stateNode.hydrate)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function bt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=$t(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r)return null!==(t=ni(r))&&rt(t),e.blockedOn=r,!1;t.shift()}return!0}function vt(e,t,r){bt(e)&&r.delete(t)}function wt(){for(ot=!1;0<st.length;){var e=st[0];if(null!==e.blockedOn){null!==(e=ni(e.blockedOn))&&tt(e);break}for(var t=e.targetContainers;0<t.length;){var r=$t(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r){e.blockedOn=r;break}t.shift()}null===e.blockedOn&&st.shift()}null!==at&&bt(at)&&(at=null),null!==ut&&bt(ut)&&(ut=null),null!==ct&&bt(ct)&&(ct=null),ht.forEach(vt),lt.forEach(vt)}function _t(e,t){e.blockedOn===t&&(e.blockedOn=null,ot||(ot=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,wt)))}function Et(e){function t(t){return _t(t,e)}if(0<st.length){_t(st[0],e);for(var r=1;r<st.length;r++){var n=st[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==at&&_t(at,e),null!==ut&&_t(ut,e),null!==ct&&_t(ct,e),ht.forEach(t),lt.forEach(t),r=0;r<ft.length;r++)(n=ft[r]).blockedOn===e&&(n.blockedOn=null);for(;0<ft.length&&null===(r=ft[0]).blockedOn;)mt(r),null===r.blockedOn&&ft.shift()}function St(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Mt={animationend:St("Animation","AnimationEnd"),animationiteration:St("Animation","AnimationIteration"),animationstart:St("Animation","AnimationStart"),transitionend:St("Transition","TransitionEnd")},At={},It={};function kt(e){if(At[e])return At[e];if(!Mt[e])return e;var t,r=Mt[e];for(t in r)if(r.hasOwnProperty(t)&&t in It)return At[e]=r[t];return e}l&&(It=document.createElement("div").style,"AnimationEvent"in window||(delete Mt.animationend.animation,delete Mt.animationiteration.animation,delete Mt.animationstart.animation),"TransitionEvent"in window||delete Mt.transitionend.transition);var Tt=kt("animationend"),Rt=kt("animationiteration"),Pt=kt("animationstart"),Ct=kt("transitionend"),Ot=new Map,xt=new Map,Bt=["abort","abort",Tt,"animationEnd",Rt,"animationIteration",Pt,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Ct,"transitionEnd","waiting","waiting"];function Dt(e,t){for(var r=0;r<e.length;r+=2){var n=e[r],i=e[r+1];i="on"+(i[0].toUpperCase()+i.slice(1)),xt.set(n,t),Ot.set(n,i),c(i,[n])}}(0,o.unstable_now)();var Nt=8;function Lt(e){if(0!==(1&e))return Nt=15,1;if(0!==(2&e))return Nt=14,2;if(0!==(4&e))return Nt=13,4;var t=24&e;return 0!==t?(Nt=12,t):0!==(32&e)?(Nt=11,32):0!==(t=192&e)?(Nt=10,t):0!==(256&e)?(Nt=9,256):0!==(t=3584&e)?(Nt=8,t):0!==(4096&e)?(Nt=7,4096):0!==(t=4186112&e)?(Nt=6,t):0!==(t=62914560&e)?(Nt=5,t):67108864&e?(Nt=4,67108864):0!==(134217728&e)?(Nt=3,134217728):0!==(t=805306368&e)?(Nt=2,t):0!==(1073741824&e)?(Nt=1,1073741824):(Nt=8,e)}function Kt(e,t){var r=e.pendingLanes;if(0===r)return Nt=0;var n=0,i=0,o=e.expiredLanes,s=e.suspendedLanes,a=e.pingedLanes;if(0!==o)n=o,i=Nt=15;else if(0!==(o=134217727&r)){var u=o&~s;0!==u?(n=Lt(u),i=Nt):0!==(a&=o)&&(n=Lt(a),i=Nt)}else 0!==(o=r&~s)?(n=Lt(o),i=Nt):0!==a&&(n=Lt(a),i=Nt);if(0===n)return 0;if(n=r&((0>(n=31-Vt(n))?0:1<<n)<<1)-1,0!==t&&t!==n&&0===(t&s)){if(Lt(t),i<=Nt)return t;Nt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)i=1<<(r=31-Vt(t)),n|=e[r],t&=~i;return n}function Ut(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function jt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=qt(24&~t))?jt(10,t):e;case 10:return 0===(e=qt(192&~t))?jt(8,t):e;case 8:return 0===(e=qt(3584&~t))&&(0===(e=qt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=qt(805306368&~t))&&(t=268435456),t}throw Error(s(358,e))}function qt(e){return e&-e}function Ft(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function zt(e,t,r){e.pendingLanes|=t;var n=t-1;e.suspendedLanes&=n,e.pingedLanes&=n,(e=e.eventTimes)[t=31-Vt(t)]=r}var Vt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Ht(e)/Gt|0)|0},Ht=Math.log,Gt=Math.LN2;var Wt=o.unstable_UserBlockingPriority,Yt=o.unstable_runWithPriority,Zt=!0;function Xt(e,t,r,n){Le||De();var i=Qt,o=Le;Le=!0;try{Be(i,e,t,r,n)}finally{(Le=o)||Ue()}}function Jt(e,t,r,n){Yt(Wt,Qt.bind(null,e,t,r,n))}function Qt(e,t,r,n){var i;if(Zt)if((i=0===(4&t))&&0<st.length&&-1<dt.indexOf(e))e=pt(null,e,t,r,n),st.push(e);else{var o=$t(e,t,r,n);if(null===o)i&&yt(e,n);else{if(i){if(-1<dt.indexOf(e))return e=pt(o,e,t,r,n),void st.push(e);if(function(e,t,r,n,i){switch(t){case"focusin":return at=gt(at,e,t,r,n,i),!0;case"dragenter":return ut=gt(ut,e,t,r,n,i),!0;case"mouseover":return ct=gt(ct,e,t,r,n,i),!0;case"pointerover":var o=i.pointerId;return ht.set(o,gt(ht.get(o)||null,e,t,r,n,i)),!0;case"gotpointercapture":return o=i.pointerId,lt.set(o,gt(lt.get(o)||null,e,t,r,n,i)),!0}return!1}(o,e,t,r,n))return;yt(e,n)}Dn(e,t,n,null,r)}}}function $t(e,t,r,n){var i=Ie(n);if(null!==(i=ri(i))){var o=Xe(i);if(null===o)i=null;else{var s=o.tag;if(13===s){if(null!==(i=Je(o)))return i;i=null}else if(3===s){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Dn(e,t,n,i,r),null}var er=null,tr=null,rr=null;function nr(){if(rr)return rr;var e,t,r=tr,n=r.length,i="value"in er?er.value:er.textContent,o=i.length;for(e=0;e<n&&r[e]===i[e];e++);var s=n-e;for(t=1;t<=s&&r[n-t]===i[o-t];t++);return rr=i.slice(e,1<t?1-t:void 0)}function ir(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function or(){return!0}function sr(){return!1}function ar(e){function t(t,r,n,i,o){for(var s in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(s)&&(t=e[s],this[s]=t?t(i):i[s]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?or:sr,this.isPropagationStopped=sr,this}return i(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=or)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=or)},persist:function(){},isPersistent:or}),t}var ur,cr,hr,lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fr=ar(lr),dr=i({},lr,{view:0,detail:0}),pr=ar(dr),yr=i({},dr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==hr&&(hr&&"mousemove"===e.type?(ur=e.screenX-hr.screenX,cr=e.screenY-hr.screenY):cr=ur=0,hr=e),ur)},movementY:function(e){return"movementY"in e?e.movementY:cr}}),gr=ar(yr),mr=ar(i({},yr,{dataTransfer:0})),br=ar(i({},dr,{relatedTarget:0})),vr=ar(i({},lr,{animationName:0,elapsedTime:0,pseudoElement:0})),wr=i({},lr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_r=ar(wr),Er=ar(i({},lr,{data:0})),Sr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ar={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Ar[e])&&!!t[e]}function kr(){return Ir}var Tr=i({},dr,{key:function(e){if(e.key){var t=Sr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=ir(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Mr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kr,charCode:function(e){return"keypress"===e.type?ir(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?ir(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Rr=ar(Tr),Pr=ar(i({},yr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Cr=ar(i({},dr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kr})),Or=ar(i({},lr,{propertyName:0,elapsedTime:0,pseudoElement:0})),xr=i({},yr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Br=ar(xr),Dr=[9,13,27,32],Nr=l&&"CompositionEvent"in window,Lr=null;l&&"documentMode"in document&&(Lr=document.documentMode);var Kr=l&&"TextEvent"in window&&!Lr,Ur=l&&(!Nr||Lr&&8<Lr&&11>=Lr),jr=String.fromCharCode(32),qr=!1;function Fr(e,t){switch(e){case"keyup":return-1!==Dr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zr(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Vr=!1;var Hr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Hr[e.type]:"textarea"===t}function Wr(e,t,r,n){Ce(n),0<(t=Ln(t,"onChange")).length&&(r=new fr("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Yr=null,Zr=null;function Xr(e){Rn(e,0)}function Jr(e){if(J(ii(e)))return e}function Qr(e,t){if("change"===e)return t}var $r=!1;if(l){var en;if(l){var tn="oninput"in document;if(!tn){var rn=document.createElement("div");rn.setAttribute("oninput","return;"),tn="function"===typeof rn.oninput}en=tn}else en=!1;$r=en&&(!document.documentMode||9<document.documentMode)}function nn(){Yr&&(Yr.detachEvent("onpropertychange",on),Zr=Yr=null)}function on(e){if("value"===e.propertyName&&Jr(Zr)){var t=[];if(Wr(t,Zr,e,Ie(e)),e=Xr,Le)e(t);else{Le=!0;try{xe(e,t)}finally{Le=!1,Ue()}}}}function sn(e,t,r){"focusin"===e?(nn(),Zr=r,(Yr=t).attachEvent("onpropertychange",on)):"focusout"===e&&nn()}function an(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Jr(Zr)}function un(e,t){if("click"===e)return Jr(t)}function cn(e,t){if("input"===e||"change"===e)return Jr(t)}var hn="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},ln=Object.prototype.hasOwnProperty;function fn(e,t){if(hn(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++)if(!ln.call(t,r[n])||!hn(e[r[n]],t[r[n]]))return!1;return!0}function dn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pn(e,t){var r,n=dn(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dn(n)}}function yn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?yn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function gn(){for(var e=window,t=Q();t instanceof e.HTMLIFrameElement;){try{var r="string"===typeof t.contentWindow.location.href}catch(n){r=!1}if(!r)break;t=Q((e=t.contentWindow).document)}return t}function mn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var bn=l&&"documentMode"in document&&11>=document.documentMode,vn=null,wn=null,_n=null,En=!1;function Sn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;En||null==vn||vn!==Q(n)||("selectionStart"in(n=vn)&&mn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},_n&&fn(_n,n)||(_n=n,0<(n=Ln(wn,"onSelect")).length&&(t=new fr("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=vn)))}Dt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Dt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Dt(Bt,2);for(var Mn="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),An=0;An<Mn.length;An++)xt.set(Mn[An],0);h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var In="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),kn=new Set("cancel close invalid load scroll toggle".split(" ").concat(In));function Tn(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,n,i,o,a,u,c){if(Ze.apply(this,arguments),Ve){if(!Ve)throw Error(s(198));var h=He;Ve=!1,He=null,Ge||(Ge=!0,We=h)}}(n,t,void 0,e),e.currentTarget=null}function Rn(e,t){t=0!==(4&t);for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var s=n.length-1;0<=s;s--){var a=n[s],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==o&&i.isPropagationStopped())break e;Tn(i,a,c),o=u}else for(s=0;s<n.length;s++){if(u=(a=n[s]).instance,c=a.currentTarget,a=a.listener,u!==o&&i.isPropagationStopped())break e;Tn(i,a,c),o=u}}}if(Ge)throw e=We,Ge=!1,We=null,e}function Pn(e,t){var r=si(t),n=e+"__bubble";r.has(n)||(Bn(t,e,2,!1),r.add(n))}var Cn="_reactListening"+Math.random().toString(36).slice(2);function On(e){e[Cn]||(e[Cn]=!0,a.forEach((function(t){kn.has(t)||xn(t,!1,e,null),xn(t,!0,e,null)})))}function xn(e,t,r,n){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=r;if("selectionchange"===e&&9!==r.nodeType&&(o=r.ownerDocument),null!==n&&!t&&kn.has(e)){if("scroll"!==e)return;i|=2,o=n}var s=si(o),a=e+"__"+(t?"capture":"bubble");s.has(a)||(t&&(i|=4),Bn(o,e,i,t),s.add(a))}function Bn(e,t,r,n){var i=xt.get(t);switch(void 0===i?2:i){case 0:i=Xt;break;case 1:i=Jt;break;default:i=Qt}r=i.bind(null,t,r,e),i=void 0,!qe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),n?void 0!==i?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):void 0!==i?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Dn(e,t,r,n,i){var o=n;if(0===(1&t)&&0===(2&t)&&null!==n)e:for(;;){if(null===n)return;var s=n.tag;if(3===s||4===s){var a=n.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===s)for(s=n.return;null!==s;){var u=s.tag;if((3===u||4===u)&&((u=s.stateNode.containerInfo)===i||8===u.nodeType&&u.parentNode===i))return;s=s.return}for(;null!==a;){if(null===(s=ri(a)))return;if(5===(u=s.tag)||6===u){n=o=s;continue e}a=a.parentNode}}n=n.return}!function(e,t,r){if(Ke)return e(t,r);Ke=!0;try{Ne(e,t,r)}finally{Ke=!1,Ue()}}((function(){var n=o,i=Ie(r),s=[];e:{var a=Ot.get(e);if(void 0!==a){var u=fr,c=e;switch(e){case"keypress":if(0===ir(r))break e;case"keydown":case"keyup":u=Rr;break;case"focusin":c="focus",u=br;break;case"focusout":c="blur",u=br;break;case"beforeblur":case"afterblur":u=br;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=gr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=mr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=Cr;break;case Tt:case Rt:case Pt:u=vr;break;case Ct:u=Or;break;case"scroll":u=pr;break;case"wheel":u=Br;break;case"copy":case"cut":case"paste":u=_r;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=Pr}var h=0!==(4&t),l=!h&&"scroll"===e,f=h?null!==a?a+"Capture":null:a;h=[];for(var d,p=n;null!==p;){var y=(d=p).stateNode;if(5===d.tag&&null!==y&&(d=y,null!==f&&(null!=(y=je(p,f))&&h.push(Nn(p,y,d)))),l)break;p=p.return}0<h.length&&(a=new u(a,c,null,r,i),s.push({event:a,listeners:h}))}}if(0===(7&t)){if(u="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||0!==(16&t)||!(c=r.relatedTarget||r.fromElement)||!ri(c)&&!c[ei])&&(u||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,u?(u=n,null!==(c=(c=r.relatedTarget||r.toElement)?ri(c):null)&&(c!==(l=Xe(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(u=null,c=n),u!==c)){if(h=gr,y="onMouseLeave",f="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(h=Pr,y="onPointerLeave",f="onPointerEnter",p="pointer"),l=null==u?a:ii(u),d=null==c?a:ii(c),(a=new h(y,p+"leave",u,r,i)).target=l,a.relatedTarget=d,y=null,ri(i)===n&&((h=new h(f,p+"enter",c,r,i)).target=d,h.relatedTarget=l,y=h),l=y,u&&c)e:{for(f=c,p=0,d=h=u;d;d=Kn(d))p++;for(d=0,y=f;y;y=Kn(y))d++;for(;0<p-d;)h=Kn(h),p--;for(;0<d-p;)f=Kn(f),d--;for(;p--;){if(h===f||null!==f&&h===f.alternate)break e;h=Kn(h),f=Kn(f)}h=null}else h=null;null!==u&&Un(s,a,u,h,!1),null!==c&&null!==l&&Un(s,l,c,h,!0)}if("select"===(u=(a=n?ii(n):window).nodeName&&a.nodeName.toLowerCase())||"input"===u&&"file"===a.type)var g=Qr;else if(Gr(a))if($r)g=cn;else{g=an;var m=sn}else(u=a.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(g=un);switch(g&&(g=g(e,n))?Wr(s,g,r,i):(m&&m(e,a,n),"focusout"===e&&(m=a._wrapperState)&&m.controlled&&"number"===a.type&&ie(a,"number",a.value)),m=n?ii(n):window,e){case"focusin":(Gr(m)||"true"===m.contentEditable)&&(vn=m,wn=n,_n=null);break;case"focusout":_n=wn=vn=null;break;case"mousedown":En=!0;break;case"contextmenu":case"mouseup":case"dragend":En=!1,Sn(s,r,i);break;case"selectionchange":if(bn)break;case"keydown":case"keyup":Sn(s,r,i)}var b;if(Nr)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else Vr?Fr(e,r)&&(v="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(v="onCompositionStart");v&&(Ur&&"ko"!==r.locale&&(Vr||"onCompositionStart"!==v?"onCompositionEnd"===v&&Vr&&(b=nr()):(tr="value"in(er=i)?er.value:er.textContent,Vr=!0)),0<(m=Ln(n,v)).length&&(v=new Er(v,e,null,r,i),s.push({event:v,listeners:m}),b?v.data=b:null!==(b=zr(r))&&(v.data=b))),(b=Kr?function(e,t){switch(e){case"compositionend":return zr(t);case"keypress":return 32!==t.which?null:(qr=!0,jr);case"textInput":return(e=t.data)===jr&&qr?null:e;default:return null}}(e,r):function(e,t){if(Vr)return"compositionend"===e||!Nr&&Fr(e,t)?(e=nr(),rr=tr=er=null,Vr=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ur&&"ko"!==t.locale?null:t.data}}(e,r))&&(0<(n=Ln(n,"onBeforeInput")).length&&(i=new Er("onBeforeInput","beforeinput",null,r,i),s.push({event:i,listeners:n}),i.data=b))}Rn(s,t)}))}function Nn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Ln(e,t){for(var r=t+"Capture",n=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=je(e,r))&&n.unshift(Nn(e,o,i)),null!=(o=je(e,t))&&n.push(Nn(e,o,i))),e=e.return}return n}function Kn(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Un(e,t,r,n,i){for(var o=t._reactName,s=[];null!==r&&r!==n;){var a=r,u=a.alternate,c=a.stateNode;if(null!==u&&u===n)break;5===a.tag&&null!==c&&(a=c,i?null!=(u=je(r,o))&&s.unshift(Nn(r,u,a)):i||null!=(u=je(r,o))&&s.push(Nn(r,u,a))),r=r.return}0!==s.length&&e.push({event:t,listeners:s})}function jn(){}var qn=null,Fn=null;function zn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Vn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Hn="function"===typeof setTimeout?setTimeout:void 0,Gn="function"===typeof clearTimeout?clearTimeout:void 0;function Wn(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Yn(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Zn(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var Xn=0;var Jn=Math.random().toString(36).slice(2),Qn="__reactFiber$"+Jn,$n="__reactProps$"+Jn,ei="__reactContainer$"+Jn,ti="__reactEvents$"+Jn;function ri(e){var t=e[Qn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[ei]||r[Qn]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=Zn(e);null!==e;){if(r=e[Qn])return r;e=Zn(e)}return t}r=(e=r).parentNode}return null}function ni(e){return!(e=e[Qn]||e[ei])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ii(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(s(33))}function oi(e){return e[$n]||null}function si(e){var t=e[ti];return void 0===t&&(t=e[ti]=new Set),t}var ai=[],ui=-1;function ci(e){return{current:e}}function hi(e){0>ui||(e.current=ai[ui],ai[ui]=null,ui--)}function li(e,t){ui++,ai[ui]=e.current,e.current=t}var fi={},di=ci(fi),pi=ci(!1),yi=fi;function gi(e,t){var r=e.type.contextTypes;if(!r)return fi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in r)o[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function mi(e){return null!==(e=e.childContextTypes)&&void 0!==e}function bi(){hi(pi),hi(di)}function vi(e,t,r){if(di.current!==fi)throw Error(s(168));li(di,t),li(pi,r)}function wi(e,t,r){var n=e.stateNode;if(e=t.childContextTypes,"function"!==typeof n.getChildContext)return r;for(var o in n=n.getChildContext())if(!(o in e))throw Error(s(108,W(t)||"Unknown",o));return i({},r,n)}function _i(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fi,yi=di.current,li(di,e),li(pi,pi.current),!0}function Ei(e,t,r){var n=e.stateNode;if(!n)throw Error(s(169));r?(e=wi(e,t,yi),n.__reactInternalMemoizedMergedChildContext=e,hi(pi),hi(di),li(di,e)):hi(pi),li(pi,r)}var Si=null,Mi=null,Ai=o.unstable_runWithPriority,Ii=o.unstable_scheduleCallback,ki=o.unstable_cancelCallback,Ti=o.unstable_shouldYield,Ri=o.unstable_requestPaint,Pi=o.unstable_now,Ci=o.unstable_getCurrentPriorityLevel,Oi=o.unstable_ImmediatePriority,xi=o.unstable_UserBlockingPriority,Bi=o.unstable_NormalPriority,Di=o.unstable_LowPriority,Ni=o.unstable_IdlePriority,Li={},Ki=void 0!==Ri?Ri:function(){},Ui=null,ji=null,qi=!1,Fi=Pi(),zi=1e4>Fi?Pi:function(){return Pi()-Fi};function Vi(){switch(Ci()){case Oi:return 99;case xi:return 98;case Bi:return 97;case Di:return 96;case Ni:return 95;default:throw Error(s(332))}}function Hi(e){switch(e){case 99:return Oi;case 98:return xi;case 97:return Bi;case 96:return Di;case 95:return Ni;default:throw Error(s(332))}}function Gi(e,t){return e=Hi(e),Ai(e,t)}function Wi(e,t,r){return e=Hi(e),Ii(e,t,r)}function Yi(){if(null!==ji){var e=ji;ji=null,ki(e)}Zi()}function Zi(){if(!qi&&null!==Ui){qi=!0;var e=0;try{var t=Ui;Gi(99,(function(){for(;e<t.length;e++){var r=t[e];do{r=r(!0)}while(null!==r)}})),Ui=null}catch(r){throw null!==Ui&&(Ui=Ui.slice(e+1)),Ii(Oi,Yi),r}finally{qi=!1}}}var Xi=_.ReactCurrentBatchConfig;function Ji(e,t){if(e&&e.defaultProps){for(var r in t=i({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}var Qi=ci(null),$i=null,eo=null,to=null;function ro(){to=eo=$i=null}function no(e){var t=Qi.current;hi(Qi),e.type._context._currentValue=t}function io(e,t){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)===t){if(null===r||(r.childLanes&t)===t)break;r.childLanes|=t}else e.childLanes|=t,null!==r&&(r.childLanes|=t);e=e.return}}function oo(e,t){$i=e,to=eo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(Ls=!0),e.firstContext=null)}function so(e,t){if(to!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(to=e,t=1073741823),t={context:e,observedBits:t,next:null},null===eo){if(null===$i)throw Error(s(308));eo=t,$i.dependencies={lanes:0,firstContext:t,responders:null}}else eo=eo.next=t;return e._currentValue}var ao=!1;function uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function co(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ho(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function lo(e,t){if(null!==(e=e.updateQueue)){var r=(e=e.shared).pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}}function fo(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,o=null;if(null!==(r=r.firstBaseUpdate)){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===o?i=o=s:o=o.next=s,r=r.next}while(null!==r);null===o?i=o=t:o=o.next=t}else i=o=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function po(e,t,r,n){var o=e.updateQueue;ao=!1;var s=o.firstBaseUpdate,a=o.lastBaseUpdate,u=o.shared.pending;if(null!==u){o.shared.pending=null;var c=u,h=c.next;c.next=null,null===a?s=h:a.next=h,a=c;var l=e.alternate;if(null!==l){var f=(l=l.updateQueue).lastBaseUpdate;f!==a&&(null===f?l.firstBaseUpdate=h:f.next=h,l.lastBaseUpdate=c)}}if(null!==s){for(f=o.baseState,a=0,l=h=c=null;;){u=s.lane;var d=s.eventTime;if((n&u)===u){null!==l&&(l=l.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,y=s;switch(u=t,d=r,y.tag){case 1:if("function"===typeof(p=y.payload)){f=p.call(d,f,u);break e}f=p;break e;case 3:p.flags=-4097&p.flags|64;case 0:if(null===(u="function"===typeof(p=y.payload)?p.call(d,f,u):p)||void 0===u)break e;f=i({},f,u);break e;case 2:ao=!0}}null!==s.callback&&(e.flags|=32,null===(u=o.effects)?o.effects=[s]:u.push(s))}else d={eventTime:d,lane:u,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===l?(h=l=d,c=f):l=l.next=d,a|=u;if(null===(s=s.next)){if(null===(u=o.shared.pending))break;s=u.next,u.next=null,o.lastBaseUpdate=u,o.shared.pending=null}}null===l&&(c=f),o.baseState=c,o.firstBaseUpdate=h,o.lastBaseUpdate=l,qa|=a,e.lanes=a,e.memoizedState=f}}function yo(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(null!==i){if(n.callback=null,n=r,"function"!==typeof i)throw Error(s(191,i));i.call(n)}}}var go=(new n.Component).refs;function mo(e,t,r,n){r=null===(r=r(n,t=e.memoizedState))||void 0===r?t:i({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var bo={isMounted:function(e){return!!(e=e._reactInternals)&&Xe(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=fu(),i=du(e),o=ho(n,i);o.payload=t,void 0!==r&&null!==r&&(o.callback=r),lo(e,o),pu(e,i,n)},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=fu(),i=du(e),o=ho(n,i);o.tag=1,o.payload=t,void 0!==r&&null!==r&&(o.callback=r),lo(e,o),pu(e,i,n)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=fu(),n=du(e),i=ho(r,n);i.tag=2,void 0!==t&&null!==t&&(i.callback=t),lo(e,i),pu(e,n,r)}};function vo(e,t,r,n,i,o,s){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,o,s):!t.prototype||!t.prototype.isPureReactComponent||(!fn(r,n)||!fn(i,o))}function wo(e,t,r){var n=!1,i=fi,o=t.contextType;return"object"===typeof o&&null!==o?o=so(o):(i=mi(t)?yi:di.current,o=(n=null!==(n=t.contextTypes)&&void 0!==n)?gi(e,i):fi),t=new t(r,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=bo,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function _o(e,t,r,n){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&bo.enqueueReplaceState(t,t.state,null)}function Eo(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=go,uo(e);var o=t.contextType;"object"===typeof o&&null!==o?i.context=so(o):(o=mi(t)?yi:di.current,i.context=gi(e,o)),po(e,r,i,n),i.state=e.memoizedState,"function"===typeof(o=t.getDerivedStateFromProps)&&(mo(e,t,o,r),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&bo.enqueueReplaceState(i,i.state,null),po(e,r,i,n),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.flags|=4)}var So=Array.isArray;function Mo(e,t,r){if(null!==(e=r.ref)&&"function"!==typeof e&&"object"!==typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(s(309));var n=r.stateNode}if(!n)throw Error(s(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=n.refs;t===go&&(t=n.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!==typeof e)throw Error(s(284));if(!r._owner)throw Error(s(290,e))}return e}function Ao(e,t){if("textarea"!==e.type)throw Error(s(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Io(e){function t(t,r){if(e){var n=t.lastEffect;null!==n?(n.nextEffect=r,t.lastEffect=r):t.firstEffect=t.lastEffect=r,r.nextEffect=null,r.flags=8}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Gu(e,t)).index=0,e.sibling=null,e}function o(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags=2,r):n:(t.flags=2,r):r}function a(t){return e&&null===t.alternate&&(t.flags=2),t}function u(e,t,r,n){return null===t||6!==t.tag?((t=Xu(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function c(e,t,r,n){return null!==t&&t.elementType===r.type?((n=i(t,r.props)).ref=Mo(e,t,r),n.return=e,n):((n=Wu(r.type,r.key,r.props,null,e.mode,n)).ref=Mo(e,t,r),n.return=e,n)}function h(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=Ju(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function l(e,t,r,n,o){return null===t||7!==t.tag?((t=Yu(r,e.mode,n,o)).return=e,t):((t=i(t,r)).return=e,t)}function f(e,t,r){if("string"===typeof t||"number"===typeof t)return(t=Xu(""+t,e.mode,r)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case E:return(r=Wu(t.type,t.key,t.props,null,e.mode,r)).ref=Mo(e,null,t),r.return=e,r;case S:return(t=Ju(t,e.mode,r)).return=e,t}if(So(t)||F(t))return(t=Yu(t,e.mode,r,null)).return=e,t;Ao(e,t)}return null}function d(e,t,r,n){var i=null!==t?t.key:null;if("string"===typeof r||"number"===typeof r)return null!==i?null:u(e,t,""+r,n);if("object"===typeof r&&null!==r){switch(r.$$typeof){case E:return r.key===i?r.type===M?l(e,t,r.props.children,n,i):c(e,t,r,n):null;case S:return r.key===i?h(e,t,r,n):null}if(So(r)||F(r))return null!==i?null:l(e,t,r,n,null);Ao(e,r)}return null}function p(e,t,r,n,i){if("string"===typeof n||"number"===typeof n)return u(t,e=e.get(r)||null,""+n,i);if("object"===typeof n&&null!==n){switch(n.$$typeof){case E:return e=e.get(null===n.key?r:n.key)||null,n.type===M?l(t,e,n.props.children,i,n.key):c(t,e,n,i);case S:return h(t,e=e.get(null===n.key?r:n.key)||null,n,i)}if(So(n)||F(n))return l(t,e=e.get(r)||null,n,i,null);Ao(t,n)}return null}function y(i,s,a,u){for(var c=null,h=null,l=s,y=s=0,g=null;null!==l&&y<a.length;y++){l.index>y?(g=l,l=null):g=l.sibling;var m=d(i,l,a[y],u);if(null===m){null===l&&(l=g);break}e&&l&&null===m.alternate&&t(i,l),s=o(m,s,y),null===h?c=m:h.sibling=m,h=m,l=g}if(y===a.length)return r(i,l),c;if(null===l){for(;y<a.length;y++)null!==(l=f(i,a[y],u))&&(s=o(l,s,y),null===h?c=l:h.sibling=l,h=l);return c}for(l=n(i,l);y<a.length;y++)null!==(g=p(l,i,y,a[y],u))&&(e&&null!==g.alternate&&l.delete(null===g.key?y:g.key),s=o(g,s,y),null===h?c=g:h.sibling=g,h=g);return e&&l.forEach((function(e){return t(i,e)})),c}function g(i,a,u,c){var h=F(u);if("function"!==typeof h)throw Error(s(150));if(null==(u=h.call(u)))throw Error(s(151));for(var l=h=null,y=a,g=a=0,m=null,b=u.next();null!==y&&!b.done;g++,b=u.next()){y.index>g?(m=y,y=null):m=y.sibling;var v=d(i,y,b.value,c);if(null===v){null===y&&(y=m);break}e&&y&&null===v.alternate&&t(i,y),a=o(v,a,g),null===l?h=v:l.sibling=v,l=v,y=m}if(b.done)return r(i,y),h;if(null===y){for(;!b.done;g++,b=u.next())null!==(b=f(i,b.value,c))&&(a=o(b,a,g),null===l?h=b:l.sibling=b,l=b);return h}for(y=n(i,y);!b.done;g++,b=u.next())null!==(b=p(y,i,g,b.value,c))&&(e&&null!==b.alternate&&y.delete(null===b.key?g:b.key),a=o(b,a,g),null===l?h=b:l.sibling=b,l=b);return e&&y.forEach((function(e){return t(i,e)})),h}return function(e,n,o,u){var c="object"===typeof o&&null!==o&&o.type===M&&null===o.key;c&&(o=o.props.children);var h="object"===typeof o&&null!==o;if(h)switch(o.$$typeof){case E:e:{for(h=o.key,c=n;null!==c;){if(c.key===h){if(7===c.tag){if(o.type===M){r(e,c.sibling),(n=i(c,o.props.children)).return=e,e=n;break e}}else if(c.elementType===o.type){r(e,c.sibling),(n=i(c,o.props)).ref=Mo(e,c,o),n.return=e,e=n;break e}r(e,c);break}t(e,c),c=c.sibling}o.type===M?((n=Yu(o.props.children,e.mode,u,o.key)).return=e,e=n):((u=Wu(o.type,o.key,o.props,null,e.mode,u)).ref=Mo(e,n,o),u.return=e,e=u)}return a(e);case S:e:{for(c=o.key;null!==n;){if(n.key===c){if(4===n.tag&&n.stateNode.containerInfo===o.containerInfo&&n.stateNode.implementation===o.implementation){r(e,n.sibling),(n=i(n,o.children||[])).return=e,e=n;break e}r(e,n);break}t(e,n),n=n.sibling}(n=Ju(o,e.mode,u)).return=e,e=n}return a(e)}if("string"===typeof o||"number"===typeof o)return o=""+o,null!==n&&6===n.tag?(r(e,n.sibling),(n=i(n,o)).return=e,e=n):(r(e,n),(n=Xu(o,e.mode,u)).return=e,e=n),a(e);if(So(o))return y(e,n,o,u);if(F(o))return g(e,n,o,u);if(h&&Ao(e,o),"undefined"===typeof o&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(s(152,W(e.type)||"Component"))}return r(e,n)}}var ko=Io(!0),To=Io(!1),Ro={},Po=ci(Ro),Co=ci(Ro),Oo=ci(Ro);function xo(e){if(e===Ro)throw Error(s(174));return e}function Bo(e,t){switch(li(Oo,t),li(Co,e),li(Po,Ro),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pe(null,"");break;default:t=pe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}hi(Po),li(Po,t)}function Do(){hi(Po),hi(Co),hi(Oo)}function No(e){xo(Oo.current);var t=xo(Po.current),r=pe(t,e.type);t!==r&&(li(Co,e),li(Po,r))}function Lo(e){Co.current===e&&(hi(Po),hi(Co))}var Ko=ci(0);function Uo(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var jo=null,qo=null,Fo=!1;function zo(e,t){var r=Vu(5,null,null,0);r.elementType="DELETED",r.type="DELETED",r.stateNode=t,r.return=e,r.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=r,e.lastEffect=r):e.firstEffect=e.lastEffect=r}function Vo(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Ho(e){if(Fo){var t=qo;if(t){var r=t;if(!Vo(e,t)){if(!(t=Yn(r.nextSibling))||!Vo(e,t))return e.flags=-1025&e.flags|2,Fo=!1,void(jo=e);zo(jo,r)}jo=e,qo=Yn(t.firstChild)}else e.flags=-1025&e.flags|2,Fo=!1,jo=e}}function Go(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;jo=e}function Wo(e){if(e!==jo)return!1;if(!Fo)return Go(e),Fo=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Vn(t,e.memoizedProps))for(t=qo;t;)zo(e,t),t=Yn(t.nextSibling);if(Go(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){qo=Yn(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}qo=null}}else qo=jo?Yn(e.stateNode.nextSibling):null;return!0}function Yo(){qo=jo=null,Fo=!1}var Zo=[];function Xo(){for(var e=0;e<Zo.length;e++)Zo[e]._workInProgressVersionPrimary=null;Zo.length=0}var Jo=_.ReactCurrentDispatcher,Qo=_.ReactCurrentBatchConfig,$o=0,es=null,ts=null,rs=null,ns=!1,is=!1;function os(){throw Error(s(321))}function ss(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!hn(e[r],t[r]))return!1;return!0}function as(e,t,r,n,i,o){if($o=o,es=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Jo.current=null===e||null===e.memoizedState?xs:Bs,e=r(n,i),is){o=0;do{if(is=!1,!(25>o))throw Error(s(301));o+=1,rs=ts=null,t.updateQueue=null,Jo.current=Ds,e=r(n,i)}while(is)}if(Jo.current=Os,t=null!==ts&&null!==ts.next,$o=0,rs=ts=es=null,ns=!1,t)throw Error(s(300));return e}function us(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===rs?es.memoizedState=rs=e:rs=rs.next=e,rs}function cs(){if(null===ts){var e=es.alternate;e=null!==e?e.memoizedState:null}else e=ts.next;var t=null===rs?es.memoizedState:rs.next;if(null!==t)rs=t,ts=e;else{if(null===e)throw Error(s(310));e={memoizedState:(ts=e).memoizedState,baseState:ts.baseState,baseQueue:ts.baseQueue,queue:ts.queue,next:null},null===rs?es.memoizedState=rs=e:rs=rs.next=e}return rs}function hs(e,t){return"function"===typeof t?t(e):t}function ls(e){var t=cs(),r=t.queue;if(null===r)throw Error(s(311));r.lastRenderedReducer=e;var n=ts,i=n.baseQueue,o=r.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}n.baseQueue=i=o,r.pending=null}if(null!==i){i=i.next,n=n.baseState;var u=a=o=null,c=i;do{var h=c.lane;if(($o&h)===h)null!==u&&(u=u.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),n=c.eagerReducer===e?c.eagerState:e(n,c.action);else{var l={lane:h,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===u?(a=u=l,o=n):u=u.next=l,es.lanes|=h,qa|=h}c=c.next}while(null!==c&&c!==i);null===u?o=n:u.next=a,hn(n,t.memoizedState)||(Ls=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=u,r.lastRenderedState=n}return[t.memoizedState,r.dispatch]}function fs(e){var t=cs(),r=t.queue;if(null===r)throw Error(s(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,o=t.memoizedState;if(null!==i){r.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);hn(o,t.memoizedState)||(Ls=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function ds(e,t,r){var n=t._getVersion;n=n(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===n:(e=e.mutableReadLanes,(e=($o&e)===e)&&(t._workInProgressVersionPrimary=n,Zo.push(t))),e)return r(t._source);throw Zo.push(t),Error(s(350))}function ps(e,t,r,n){var i=xa;if(null===i)throw Error(s(349));var o=t._getVersion,a=o(t._source),u=Jo.current,c=u.useState((function(){return ds(i,t,r)})),h=c[1],l=c[0];c=rs;var f=e.memoizedState,d=f.refs,p=d.getSnapshot,y=f.source;f=f.subscribe;var g=es;return e.memoizedState={refs:d,source:t,subscribe:n},u.useEffect((function(){d.getSnapshot=r,d.setSnapshot=h;var e=o(t._source);if(!hn(a,e)){e=r(t._source),hn(l,e)||(h(e),e=du(g),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var n=i.entanglements,s=e;0<s;){var u=31-Vt(s),c=1<<u;n[u]|=e,s&=~c}}}),[r,t,n]),u.useEffect((function(){return n(t._source,(function(){var e=d.getSnapshot,r=d.setSnapshot;try{r(e(t._source));var n=du(g);i.mutableReadLanes|=n&i.pendingLanes}catch(o){r((function(){throw o}))}}))}),[t,n]),hn(p,r)&&hn(y,t)&&hn(f,n)||((e={pending:null,dispatch:null,lastRenderedReducer:hs,lastRenderedState:l}).dispatch=h=Cs.bind(null,es,e),c.queue=e,c.baseQueue=null,l=ds(i,t,r),c.memoizedState=c.baseState=l),l}function ys(e,t,r){return ps(cs(),e,t,r)}function gs(e){var t=us();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:hs,lastRenderedState:e}).dispatch=Cs.bind(null,es,e),[t.memoizedState,e]}function ms(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=es.updateQueue)?(t={lastEffect:null},es.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function bs(e){return e={current:e},us().memoizedState=e}function vs(){return cs().memoizedState}function ws(e,t,r,n){var i=us();es.flags|=e,i.memoizedState=ms(1|t,r,void 0,void 0===n?null:n)}function _s(e,t,r,n){var i=cs();n=void 0===n?null:n;var o=void 0;if(null!==ts){var s=ts.memoizedState;if(o=s.destroy,null!==n&&ss(n,s.deps))return void ms(t,r,o,n)}es.flags|=e,i.memoizedState=ms(1|t,r,o,n)}function Es(e,t){return ws(516,4,e,t)}function Ss(e,t){return _s(516,4,e,t)}function Ms(e,t){return _s(4,2,e,t)}function As(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Is(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,_s(4,2,As.bind(null,t,e),r)}function ks(){}function Ts(e,t){var r=cs();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&ss(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Rs(e,t){var r=cs();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&ss(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Ps(e,t){var r=Vi();Gi(98>r?98:r,(function(){e(!0)})),Gi(97<r?97:r,(function(){var r=Qo.transition;Qo.transition=1;try{e(!1),t()}finally{Qo.transition=r}}))}function Cs(e,t,r){var n=fu(),i=du(e),o={lane:i,action:r,eagerReducer:null,eagerState:null,next:null},s=t.pending;if(null===s?o.next=o:(o.next=s.next,s.next=o),t.pending=o,s=e.alternate,e===es||null!==s&&s===es)is=ns=!0;else{if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var a=t.lastRenderedState,u=s(a,r);if(o.eagerReducer=s,o.eagerState=u,hn(u,a))return}catch(c){}pu(e,i,n)}}var Os={readContext:so,useCallback:os,useContext:os,useEffect:os,useImperativeHandle:os,useLayoutEffect:os,useMemo:os,useReducer:os,useRef:os,useState:os,useDebugValue:os,useDeferredValue:os,useTransition:os,useMutableSource:os,useOpaqueIdentifier:os,unstable_isNewReconciler:!1},xs={readContext:so,useCallback:function(e,t){return us().memoizedState=[e,void 0===t?null:t],e},useContext:so,useEffect:Es,useImperativeHandle:function(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,ws(4,2,As.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ws(4,2,e,t)},useMemo:function(e,t){var r=us();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=us();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e=(e=n.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Cs.bind(null,es,e),[n.memoizedState,e]},useRef:bs,useState:gs,useDebugValue:ks,useDeferredValue:function(e){var t=gs(e),r=t[0],n=t[1];return Es((function(){var t=Qo.transition;Qo.transition=1;try{n(e)}finally{Qo.transition=t}}),[e]),r},useTransition:function(){var e=gs(!1),t=e[0];return bs(e=Ps.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,r){var n=us();return n.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:r},ps(n,e,t,r)},useOpaqueIdentifier:function(){if(Fo){var e=!1,t=function(e){return{$$typeof:D,toString:e,valueOf:e}}((function(){throw e||(e=!0,r("r:"+(Xn++).toString(36))),Error(s(355))})),r=gs(t)[1];return 0===(2&es.mode)&&(es.flags|=516,ms(5,(function(){r("r:"+(Xn++).toString(36))}),void 0,null)),t}return gs(t="r:"+(Xn++).toString(36)),t},unstable_isNewReconciler:!1},Bs={readContext:so,useCallback:Ts,useContext:so,useEffect:Ss,useImperativeHandle:Is,useLayoutEffect:Ms,useMemo:Rs,useReducer:ls,useRef:vs,useState:function(){return ls(hs)},useDebugValue:ks,useDeferredValue:function(e){var t=ls(hs),r=t[0],n=t[1];return Ss((function(){var t=Qo.transition;Qo.transition=1;try{n(e)}finally{Qo.transition=t}}),[e]),r},useTransition:function(){var e=ls(hs)[0];return[vs().current,e]},useMutableSource:ys,useOpaqueIdentifier:function(){return ls(hs)[0]},unstable_isNewReconciler:!1},Ds={readContext:so,useCallback:Ts,useContext:so,useEffect:Ss,useImperativeHandle:Is,useLayoutEffect:Ms,useMemo:Rs,useReducer:fs,useRef:vs,useState:function(){return fs(hs)},useDebugValue:ks,useDeferredValue:function(e){var t=fs(hs),r=t[0],n=t[1];return Ss((function(){var t=Qo.transition;Qo.transition=1;try{n(e)}finally{Qo.transition=t}}),[e]),r},useTransition:function(){var e=fs(hs)[0];return[vs().current,e]},useMutableSource:ys,useOpaqueIdentifier:function(){return fs(hs)[0]},unstable_isNewReconciler:!1},Ns=_.ReactCurrentOwner,Ls=!1;function Ks(e,t,r,n){t.child=null===e?To(t,null,r,n):ko(t,e.child,r,n)}function Us(e,t,r,n,i){r=r.render;var o=t.ref;return oo(t,i),n=as(e,t,r,n,o,i),null===e||Ls?(t.flags|=1,Ks(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,oa(e,t,i))}function js(e,t,r,n,i,o){if(null===e){var s=r.type;return"function"!==typeof s||Hu(s)||void 0!==s.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Wu(r.type,null,n,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,qs(e,t,s,n,i,o))}return s=e.child,0===(i&o)&&(i=s.memoizedProps,(r=null!==(r=r.compare)?r:fn)(i,n)&&e.ref===t.ref)?oa(e,t,o):(t.flags|=1,(e=Gu(s,n)).ref=t.ref,e.return=t,t.child=e)}function qs(e,t,r,n,i,o){if(null!==e&&fn(e.memoizedProps,n)&&e.ref===t.ref){if(Ls=!1,0===(o&i))return t.lanes=e.lanes,oa(e,t,o);0!==(16384&e.flags)&&(Ls=!0)}return Vs(e,t,r,n,o)}function Fs(e,t,r){var n=t.pendingProps,i=n.children,o=null!==e?e.memoizedState:null;if("hidden"===n.mode||"unstable-defer-without-hiding"===n.mode)if(0===(4&t.mode))t.memoizedState={baseLanes:0},Eu(t,r);else{if(0===(1073741824&r))return e=null!==o?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},Eu(t,e),null;t.memoizedState={baseLanes:0},Eu(t,null!==o?o.baseLanes:r)}else null!==o?(n=o.baseLanes|r,t.memoizedState=null):n=r,Eu(t,n);return Ks(e,t,i,r),t.child}function zs(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=128)}function Vs(e,t,r,n,i){var o=mi(r)?yi:di.current;return o=gi(t,o),oo(t,i),r=as(e,t,r,n,o,i),null===e||Ls?(t.flags|=1,Ks(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,oa(e,t,i))}function Hs(e,t,r,n,i){if(mi(r)){var o=!0;_i(t)}else o=!1;if(oo(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),wo(t,r,n),Eo(t,r,n,i),n=!0;else if(null===e){var s=t.stateNode,a=t.memoizedProps;s.props=a;var u=s.context,c=r.contextType;"object"===typeof c&&null!==c?c=so(c):c=gi(t,c=mi(r)?yi:di.current);var h=r.getDerivedStateFromProps,l="function"===typeof h||"function"===typeof s.getSnapshotBeforeUpdate;l||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==n||u!==c)&&_o(t,s,n,c),ao=!1;var f=t.memoizedState;s.state=f,po(t,n,s,i),u=t.memoizedState,a!==n||f!==u||pi.current||ao?("function"===typeof h&&(mo(t,r,h,n),u=t.memoizedState),(a=ao||vo(t,r,a,n,f,u,c))?(l||"function"!==typeof s.UNSAFE_componentWillMount&&"function"!==typeof s.componentWillMount||("function"===typeof s.componentWillMount&&s.componentWillMount(),"function"===typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"===typeof s.componentDidMount&&(t.flags|=4)):("function"===typeof s.componentDidMount&&(t.flags|=4),t.memoizedProps=n,t.memoizedState=u),s.props=n,s.state=u,s.context=c,n=a):("function"===typeof s.componentDidMount&&(t.flags|=4),n=!1)}else{s=t.stateNode,co(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Ji(t.type,a),s.props=c,l=t.pendingProps,f=s.context,"object"===typeof(u=r.contextType)&&null!==u?u=so(u):u=gi(t,u=mi(r)?yi:di.current);var d=r.getDerivedStateFromProps;(h="function"===typeof d||"function"===typeof s.getSnapshotBeforeUpdate)||"function"!==typeof s.UNSAFE_componentWillReceiveProps&&"function"!==typeof s.componentWillReceiveProps||(a!==l||f!==u)&&_o(t,s,n,u),ao=!1,f=t.memoizedState,s.state=f,po(t,n,s,i);var p=t.memoizedState;a!==l||f!==p||pi.current||ao?("function"===typeof d&&(mo(t,r,d,n),p=t.memoizedState),(c=ao||vo(t,r,c,n,f,p,u))?(h||"function"!==typeof s.UNSAFE_componentWillUpdate&&"function"!==typeof s.componentWillUpdate||("function"===typeof s.componentWillUpdate&&s.componentWillUpdate(n,p,u),"function"===typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(n,p,u)),"function"===typeof s.componentDidUpdate&&(t.flags|=4),"function"===typeof s.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!==typeof s.componentDidUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),t.memoizedProps=n,t.memoizedState=p),s.props=n,s.state=p,s.context=u,n=c):("function"!==typeof s.componentDidUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!==typeof s.getSnapshotBeforeUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=256),n=!1)}return Gs(e,t,r,n,o,i)}function Gs(e,t,r,n,i,o){zs(e,t);var s=0!==(64&t.flags);if(!n&&!s)return i&&Ei(t,r,!1),oa(e,t,o);n=t.stateNode,Ns.current=t;var a=s&&"function"!==typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&s?(t.child=ko(t,e.child,null,o),t.child=ko(t,null,a,o)):Ks(e,t,a,o),t.memoizedState=n.state,i&&Ei(t,r,!0),t.child}function Ws(e){var t=e.stateNode;t.pendingContext?vi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&vi(0,t.context,!1),Bo(e,t.containerInfo)}var Ys,Zs,Xs,Js={dehydrated:null,retryLane:0};function Qs(e,t,r){var n,i=t.pendingProps,o=Ko.current,s=!1;return(n=0!==(64&t.flags))||(n=(null===e||null!==e.memoizedState)&&0!==(2&o)),n?(s=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(o|=1),li(Ko,1&o),null===e?(void 0!==i.fallback&&Ho(t),e=i.children,o=i.fallback,s?(e=$s(t,e,o,r),t.child.memoizedState={baseLanes:r},t.memoizedState=Js,e):"number"===typeof i.unstable_expectedLoadTime?(e=$s(t,e,o,r),t.child.memoizedState={baseLanes:r},t.memoizedState=Js,t.lanes=33554432,e):((r=Zu({mode:"visible",children:e},t.mode,r,null)).return=t,t.child=r)):(e.memoizedState,s?(i=ta(e,t,i.children,i.fallback,r),s=t.child,o=e.child.memoizedState,s.memoizedState=null===o?{baseLanes:r}:{baseLanes:o.baseLanes|r},s.childLanes=e.childLanes&~r,t.memoizedState=Js,i):(r=ea(e,t,i.children,r),t.memoizedState=null,r))}function $s(e,t,r,n){var i=e.mode,o=e.child;return t={mode:"hidden",children:t},0===(2&i)&&null!==o?(o.childLanes=0,o.pendingProps=t):o=Zu(t,i,0,null),r=Yu(r,i,n,null),o.return=e,r.return=e,o.sibling=r,e.child=o,r}function ea(e,t,r,n){var i=e.child;return e=i.sibling,r=Gu(i,{mode:"visible",children:r}),0===(2&t.mode)&&(r.lanes=n),r.return=t,r.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=r}function ta(e,t,r,n,i){var o=t.mode,s=e.child;e=s.sibling;var a={mode:"hidden",children:r};return 0===(2&o)&&t.child!==s?((r=t.child).childLanes=0,r.pendingProps=a,null!==(s=r.lastEffect)?(t.firstEffect=r.firstEffect,t.lastEffect=s,s.nextEffect=null):t.firstEffect=t.lastEffect=null):r=Gu(s,a),null!==e?n=Gu(e,n):(n=Yu(n,o,i,null)).flags|=2,n.return=t,r.return=t,r.sibling=n,t.child=r,n}function ra(e,t){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),io(e.return,t)}function na(e,t,r,n,i,o){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i,lastEffect:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i,s.lastEffect=o)}function ia(e,t,r){var n=t.pendingProps,i=n.revealOrder,o=n.tail;if(Ks(e,t,n.children,r),0!==(2&(n=Ko.current)))n=1&n|2,t.flags|=64;else{if(null!==e&&0!==(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ra(e,r);else if(19===e.tag)ra(e,r);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(li(Ko,n),0===(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===Uo(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),na(t,!1,i,r,o,t.lastEffect);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Uo(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}na(t,!0,r,null,o,t.lastEffect);break;case"together":na(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function oa(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),qa|=t.lanes,0!==(r&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(s(153));if(null!==t.child){for(r=Gu(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Gu(e,e.pendingProps)).return=t;r.sibling=null}return t.child}return null}function sa(e,t){if(!Fo)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function aa(e,t,r){var n=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return mi(t.type)&&bi(),null;case 3:return Do(),hi(pi),hi(di),Xo(),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(Wo(t)?t.flags|=4:n.hydrate||(t.flags|=256)),null;case 5:Lo(t);var o=xo(Oo.current);if(r=t.type,null!==e&&null!=t.stateNode)Zs(e,t,r,n),e.ref!==t.ref&&(t.flags|=128);else{if(!n){if(null===t.stateNode)throw Error(s(166));return null}if(e=xo(Po.current),Wo(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Qn]=t,n[$n]=a,r){case"dialog":Pn("cancel",n),Pn("close",n);break;case"iframe":case"object":case"embed":Pn("load",n);break;case"video":case"audio":for(e=0;e<In.length;e++)Pn(In[e],n);break;case"source":Pn("error",n);break;case"img":case"image":case"link":Pn("error",n),Pn("load",n);break;case"details":Pn("toggle",n);break;case"input":ee(n,a),Pn("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Pn("invalid",n);break;case"textarea":ue(n,a),Pn("invalid",n)}for(var c in Me(r,a),e=null,a)a.hasOwnProperty(c)&&(o=a[c],"children"===c?"string"===typeof o?n.textContent!==o&&(e=["children",o]):"number"===typeof o&&n.textContent!==""+o&&(e=["children",""+o]):u.hasOwnProperty(c)&&null!=o&&"onScroll"===c&&Pn("scroll",n));switch(r){case"input":X(n),ne(n,a,!0);break;case"textarea":X(n),he(n);break;case"select":case"option":break;default:"function"===typeof a.onClick&&(n.onclick=jn)}n=e,t.updateQueue=n,null!==n&&(t.flags|=4)}else{switch(c=9===o.nodeType?o:o.ownerDocument,e===le&&(e=de(r)),e===le?"script"===r?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof n.is?e=c.createElement(r,{is:n.is}):(e=c.createElement(r),"select"===r&&(c=e,n.multiple?c.multiple=!0:n.size&&(c.size=n.size))):e=c.createElementNS(e,r),e[Qn]=t,e[$n]=n,Ys(e,t),t.stateNode=e,c=Ae(r,n),r){case"dialog":Pn("cancel",e),Pn("close",e),o=n;break;case"iframe":case"object":case"embed":Pn("load",e),o=n;break;case"video":case"audio":for(o=0;o<In.length;o++)Pn(In[o],e);o=n;break;case"source":Pn("error",e),o=n;break;case"img":case"image":case"link":Pn("error",e),Pn("load",e),o=n;break;case"details":Pn("toggle",e),o=n;break;case"input":ee(e,n),o=$(e,n),Pn("invalid",e);break;case"option":o=oe(e,n);break;case"select":e._wrapperState={wasMultiple:!!n.multiple},o=i({},n,{value:void 0}),Pn("invalid",e);break;case"textarea":ue(e,n),o=ae(e,n),Pn("invalid",e);break;default:o=n}Me(r,o);var h=o;for(a in h)if(h.hasOwnProperty(a)){var l=h[a];"style"===a?Ee(e,l):"dangerouslySetInnerHTML"===a?null!=(l=l?l.__html:void 0)&&me(e,l):"children"===a?"string"===typeof l?("textarea"!==r||""!==l)&&be(e,l):"number"===typeof l&&be(e,""+l):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(u.hasOwnProperty(a)?null!=l&&"onScroll"===a&&Pn("scroll",e):null!=l&&w(e,a,l,c))}switch(r){case"input":X(e),ne(e,n,!1);break;case"textarea":X(e),he(e);break;case"option":null!=n.value&&e.setAttribute("value",""+Y(n.value));break;case"select":e.multiple=!!n.multiple,null!=(a=n.value)?se(e,!!n.multiple,a,!1):null!=n.defaultValue&&se(e,!!n.multiple,n.defaultValue,!0);break;default:"function"===typeof o.onClick&&(e.onclick=jn)}zn(r,n)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Xs(0,t,e.memoizedProps,n);else{if("string"!==typeof n&&null===t.stateNode)throw Error(s(166));r=xo(Oo.current),xo(Po.current),Wo(t)?(n=t.stateNode,r=t.memoizedProps,n[Qn]=t,n.nodeValue!==r&&(t.flags|=4)):((n=(9===r.nodeType?r:r.ownerDocument).createTextNode(n))[Qn]=t,t.stateNode=n)}return null;case 13:return hi(Ko),n=t.memoizedState,0!==(64&t.flags)?(t.lanes=r,t):(n=null!==n,r=!1,null===e?void 0!==t.memoizedProps.fallback&&Wo(t):r=null!==e.memoizedState,n&&!r&&0!==(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(1&Ko.current)?0===Ka&&(Ka=3):(0!==Ka&&3!==Ka||(Ka=4),null===xa||0===(134217727&qa)&&0===(134217727&Fa)||bu(xa,Da))),(n||r)&&(t.flags|=4),null);case 4:return Do(),null===e&&On(t.stateNode.containerInfo),null;case 10:return no(t),null;case 19:if(hi(Ko),null===(n=t.memoizedState))return null;if(a=0!==(64&t.flags),null===(c=n.rendering))if(a)sa(n,!1);else{if(0!==Ka||null!==e&&0!==(64&e.flags))for(e=t.child;null!==e;){if(null!==(c=Uo(e))){for(t.flags|=64,sa(n,!1),null!==(a=c.updateQueue)&&(t.updateQueue=a,t.flags|=4),null===n.lastEffect&&(t.firstEffect=null),t.lastEffect=n.lastEffect,n=r,r=t.child;null!==r;)e=n,(a=r).flags&=2,a.nextEffect=null,a.firstEffect=null,a.lastEffect=null,null===(c=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,e=c.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return li(Ko,1&Ko.current|2),t.child}e=e.sibling}null!==n.tail&&zi()>Ga&&(t.flags|=64,a=!0,sa(n,!1),t.lanes=33554432)}else{if(!a)if(null!==(e=Uo(c))){if(t.flags|=64,a=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),sa(n,!0),null===n.tail&&"hidden"===n.tailMode&&!c.alternate&&!Fo)return null!==(t=t.lastEffect=n.lastEffect)&&(t.nextEffect=null),null}else 2*zi()-n.renderingStartTime>Ga&&1073741824!==r&&(t.flags|=64,a=!0,sa(n,!1),t.lanes=33554432);n.isBackwards?(c.sibling=t.child,t.child=c):(null!==(r=n.last)?r.sibling=c:t.child=c,n.last=c)}return null!==n.tail?(r=n.tail,n.rendering=r,n.tail=r.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=zi(),r.sibling=null,t=Ko.current,li(Ko,a?1&t|2:1&t),r):null;case 23:case 24:return Su(),null!==e&&null!==e.memoizedState!==(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==n.mode&&(t.flags|=4),null}throw Error(s(156,t.tag))}function ua(e){switch(e.tag){case 1:mi(e.type)&&bi();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Do(),hi(pi),hi(di),Xo(),0!==(64&(t=e.flags)))throw Error(s(285));return e.flags=-4097&t|64,e;case 5:return Lo(e),null;case 13:return hi(Ko),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return hi(Ko),null;case 4:return Do(),null;case 10:return no(e),null;case 23:case 24:return Su(),null;default:return null}}function ca(e,t){try{var r="",n=t;do{r+=G(n),n=n.return}while(n);var i=r}catch(o){i="\nError generating stack: "+o.message+"\n"+o.stack}return{value:e,source:t,stack:i}}function ha(e,t){try{console.error(t.value)}catch(r){setTimeout((function(){throw r}))}}Ys=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Zs=function(e,t,r,n){var o=e.memoizedProps;if(o!==n){e=t.stateNode,xo(Po.current);var s,a=null;switch(r){case"input":o=$(e,o),n=$(e,n),a=[];break;case"option":o=oe(e,o),n=oe(e,n),a=[];break;case"select":o=i({},o,{value:void 0}),n=i({},n,{value:void 0}),a=[];break;case"textarea":o=ae(e,o),n=ae(e,n),a=[];break;default:"function"!==typeof o.onClick&&"function"===typeof n.onClick&&(e.onclick=jn)}for(l in Me(r,n),r=null,o)if(!n.hasOwnProperty(l)&&o.hasOwnProperty(l)&&null!=o[l])if("style"===l){var c=o[l];for(s in c)c.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(u.hasOwnProperty(l)?a||(a=[]):(a=a||[]).push(l,null));for(l in n){var h=n[l];if(c=null!=o?o[l]:void 0,n.hasOwnProperty(l)&&h!==c&&(null!=h||null!=c))if("style"===l)if(c){for(s in c)!c.hasOwnProperty(s)||h&&h.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in h)h.hasOwnProperty(s)&&c[s]!==h[s]&&(r||(r={}),r[s]=h[s])}else r||(a||(a=[]),a.push(l,r)),r=h;else"dangerouslySetInnerHTML"===l?(h=h?h.__html:void 0,c=c?c.__html:void 0,null!=h&&c!==h&&(a=a||[]).push(l,h)):"children"===l?"string"!==typeof h&&"number"!==typeof h||(a=a||[]).push(l,""+h):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(u.hasOwnProperty(l)?(null!=h&&"onScroll"===l&&Pn("scroll",e),a||c===h||(a=[])):"object"===typeof h&&null!==h&&h.$$typeof===D?h.toString():(a=a||[]).push(l,h))}r&&(a=a||[]).push("style",r);var l=a;(t.updateQueue=l)&&(t.flags|=4)}},Xs=function(e,t,r,n){r!==n&&(t.flags|=4)};var la="function"===typeof WeakMap?WeakMap:Map;function fa(e,t,r){(r=ho(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Xa||(Xa=!0,Ja=n),ha(0,t)},r}function da(e,t,r){(r=ho(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"===typeof n){var i=t.value;r.payload=function(){return ha(0,t),n(i)}}var o=e.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(r.callback=function(){"function"!==typeof n&&(null===Qa?Qa=new Set([this]):Qa.add(this),ha(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}var pa="function"===typeof WeakSet?WeakSet:Set;function ya(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(r){ju(e,r)}else t.current=null}function ga(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var r=e.memoizedProps,n=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?r:Ji(t.type,r),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Wn(t.stateNode.containerInfo))}throw Error(s(163))}function ma(e,t,r){switch(r.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=r.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3===(3&e.tag)){var n=e.create;e.destroy=n()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=r.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;n=i.next,0!==(4&(i=i.tag))&&0!==(1&i)&&(Lu(r,e),Nu(r,e)),e=n}while(e!==t)}return;case 1:return e=r.stateNode,4&r.flags&&(null===t?e.componentDidMount():(n=r.elementType===r.type?t.memoizedProps:Ji(r.type,t.memoizedProps),e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=r.updateQueue)&&yo(r,t,e));case 3:if(null!==(t=r.updateQueue)){if(e=null,null!==r.child)switch(r.child.tag){case 5:case 1:e=r.child.stateNode}yo(r,t,e)}return;case 5:return e=r.stateNode,void(null===t&&4&r.flags&&zn(r.type,r.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===r.memoizedState&&(r=r.alternate,null!==r&&(r=r.memoizedState,null!==r&&(r=r.dehydrated,null!==r&&Et(r)))))}throw Error(s(163))}function ba(e,t){for(var r=e;;){if(5===r.tag){var n=r.stateNode;if(t)"function"===typeof(n=n.style).setProperty?n.setProperty("display","none","important"):n.display="none";else{n=r.stateNode;var i=r.memoizedProps.style;i=void 0!==i&&null!==i&&i.hasOwnProperty("display")?i.display:null,n.style.display=_e("display",i)}}else if(6===r.tag)r.stateNode.nodeValue=t?"":r.memoizedProps;else if((23!==r.tag&&24!==r.tag||null===r.memoizedState||r===e)&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function va(e,t){if(Mi&&"function"===typeof Mi.onCommitFiberUnmount)try{Mi.onCommitFiberUnmount(Si,t)}catch(o){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e=e.next;do{var n=r,i=n.destroy;if(n=n.tag,void 0!==i)if(0!==(4&n))Lu(t,r);else{n=t;try{i()}catch(o){ju(n,o)}}r=r.next}while(r!==e)}break;case 1:if(ya(t),"function"===typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(o){ju(t,o)}break;case 5:ya(t);break;case 4:Aa(e,t)}}function wa(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function _a(e){return 5===e.tag||3===e.tag||4===e.tag}function Ea(e){e:{for(var t=e.return;null!==t;){if(_a(t))break e;t=t.return}throw Error(s(160))}var r=t;switch(t=r.stateNode,r.tag){case 5:var n=!1;break;case 3:case 4:t=t.containerInfo,n=!0;break;default:throw Error(s(161))}16&r.flags&&(be(t,""),r.flags&=-17);e:t:for(r=e;;){for(;null===r.sibling;){if(null===r.return||_a(r.return)){r=null;break e}r=r.return}for(r.sibling.return=r.return,r=r.sibling;5!==r.tag&&6!==r.tag&&18!==r.tag;){if(2&r.flags)continue t;if(null===r.child||4===r.tag)continue t;r.child.return=r,r=r.child}if(!(2&r.flags)){r=r.stateNode;break e}}n?Sa(e,r,t):Ma(e,r,t)}function Sa(e,t,r){var n=e.tag,i=5===n||6===n;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!==(r=r._reactRootContainer)&&void 0!==r||null!==t.onclick||(t.onclick=jn));else if(4!==n&&null!==(e=e.child))for(Sa(e,t,r),e=e.sibling;null!==e;)Sa(e,t,r),e=e.sibling}function Ma(e,t,r){var n=e.tag,i=5===n||6===n;if(i)e=i?e.stateNode:e.stateNode.instance,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(Ma(e,t,r),e=e.sibling;null!==e;)Ma(e,t,r),e=e.sibling}function Aa(e,t){for(var r,n,i=t,o=!1;;){if(!o){o=i.return;e:for(;;){if(null===o)throw Error(s(160));switch(r=o.stateNode,o.tag){case 5:n=!1;break e;case 3:case 4:r=r.containerInfo,n=!0;break e}o=o.return}o=!0}if(5===i.tag||6===i.tag){e:for(var a=e,u=i,c=u;;)if(va(a,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===u)break e;for(;null===c.sibling;){if(null===c.return||c.return===u)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}n?(a=r,u=i.stateNode,8===a.nodeType?a.parentNode.removeChild(u):a.removeChild(u)):r.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){r=i.stateNode.containerInfo,n=!0,i.child.return=i,i=i.child;continue}}else if(va(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(o=!1)}i.sibling.return=i.return,i=i.sibling}}function Ia(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var n=r=r.next;do{3===(3&n.tag)&&(e=n.destroy,n.destroy=void 0,void 0!==e&&e()),n=n.next}while(n!==r)}return;case 1:case 12:case 17:return;case 5:if(null!=(r=t.stateNode)){n=t.memoizedProps;var i=null!==e?e.memoizedProps:n;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(r[$n]=n,"input"===e&&"radio"===n.type&&null!=n.name&&te(r,n),Ae(e,i),t=Ae(e,n),i=0;i<o.length;i+=2){var a=o[i],u=o[i+1];"style"===a?Ee(r,u):"dangerouslySetInnerHTML"===a?me(r,u):"children"===a?be(r,u):w(r,a,u,t)}switch(e){case"input":re(r,n);break;case"textarea":ce(r,n);break;case"select":e=r._wrapperState.wasMultiple,r._wrapperState.wasMultiple=!!n.multiple,null!=(o=n.value)?se(r,!!n.multiple,o,!1):e!==!!n.multiple&&(null!=n.defaultValue?se(r,!!n.multiple,n.defaultValue,!0):se(r,!!n.multiple,n.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(s(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((r=t.stateNode).hydrate&&(r.hydrate=!1,Et(r.containerInfo)));case 13:return null!==t.memoizedState&&(Ha=zi(),ba(t.child,!0)),void ka(t);case 19:return void ka(t);case 23:case 24:return void ba(t,null!==t.memoizedState)}throw Error(s(163))}function ka(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new pa),t.forEach((function(t){var n=Fu.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function Ta(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Ra=Math.ceil,Pa=_.ReactCurrentDispatcher,Ca=_.ReactCurrentOwner,Oa=0,xa=null,Ba=null,Da=0,Na=0,La=ci(0),Ka=0,Ua=null,ja=0,qa=0,Fa=0,za=0,Va=null,Ha=0,Ga=1/0;function Wa(){Ga=zi()+500}var Ya,Za=null,Xa=!1,Ja=null,Qa=null,$a=!1,eu=null,tu=90,ru=[],nu=[],iu=null,ou=0,su=null,au=-1,uu=0,cu=0,hu=null,lu=!1;function fu(){return 0!==(48&Oa)?zi():-1!==au?au:au=zi()}function du(e){if(0===(2&(e=e.mode)))return 1;if(0===(4&e))return 99===Vi()?1:2;if(0===uu&&(uu=ja),0!==Xi.transition){0!==cu&&(cu=null!==Va?Va.pendingLanes:0),e=uu;var t=4186112&~cu;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Vi(),0!==(4&Oa)&&98===e?e=jt(12,uu):e=jt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),uu),e}function pu(e,t,r){if(50<ou)throw ou=0,su=null,Error(s(185));if(null===(e=yu(e,t)))return null;zt(e,t,r),e===xa&&(Fa|=t,4===Ka&&bu(e,Da));var n=Vi();1===t?0!==(8&Oa)&&0===(48&Oa)?vu(e):(gu(e,r),0===Oa&&(Wa(),Yi())):(0===(4&Oa)||98!==n&&99!==n||(null===iu?iu=new Set([e]):iu.add(e)),gu(e,r)),Va=e}function yu(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}function gu(e,t){for(var r=e.callbackNode,n=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes;0<a;){var u=31-Vt(a),c=1<<u,h=o[u];if(-1===h){if(0===(c&n)||0!==(c&i)){h=t,Lt(c);var l=Nt;o[u]=10<=l?h+250:6<=l?h+5e3:-1}}else h<=t&&(e.expiredLanes|=c);a&=~c}if(n=Kt(e,e===xa?Da:0),t=Nt,0===n)null!==r&&(r!==Li&&ki(r),e.callbackNode=null,e.callbackPriority=0);else{if(null!==r){if(e.callbackPriority===t)return;r!==Li&&ki(r)}15===t?(r=vu.bind(null,e),null===Ui?(Ui=[r],ji=Ii(Oi,Zi)):Ui.push(r),r=Li):14===t?r=Wi(99,vu.bind(null,e)):(r=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(s(358,e))}}(t),r=Wi(r,mu.bind(null,e))),e.callbackPriority=t,e.callbackNode=r}}function mu(e){if(au=-1,cu=uu=0,0!==(48&Oa))throw Error(s(327));var t=e.callbackNode;if(Du()&&e.callbackNode!==t)return null;var r=Kt(e,e===xa?Da:0);if(0===r)return null;var n=r,i=Oa;Oa|=16;var o=Iu();for(xa===e&&Da===n||(Wa(),Mu(e,n));;)try{Ru();break}catch(u){Au(e,u)}if(ro(),Pa.current=o,Oa=i,null!==Ba?n=0:(xa=null,Da=0,n=Ka),0!==(ja&Fa))Mu(e,0);else if(0!==n){if(2===n&&(Oa|=64,e.hydrate&&(e.hydrate=!1,Wn(e.containerInfo)),0!==(r=Ut(e))&&(n=ku(e,r))),1===n)throw t=Ua,Mu(e,0),bu(e,r),gu(e,zi()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=r,n){case 0:case 1:throw Error(s(345));case 2:case 5:Ou(e);break;case 3:if(bu(e,r),(62914560&r)===r&&10<(n=Ha+500-zi())){if(0!==Kt(e,0))break;if(((i=e.suspendedLanes)&r)!==r){fu(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Hn(Ou.bind(null,e),n);break}Ou(e);break;case 4:if(bu(e,r),(4186112&r)===r)break;for(n=e.eventTimes,i=-1;0<r;){var a=31-Vt(r);o=1<<a,(a=n[a])>i&&(i=a),r&=~o}if(r=i,10<(r=(120>(r=zi()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ra(r/1960))-r)){e.timeoutHandle=Hn(Ou.bind(null,e),r);break}Ou(e);break;default:throw Error(s(329))}}return gu(e,zi()),e.callbackNode===t?mu.bind(null,e):null}function bu(e,t){for(t&=~za,t&=~Fa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Vt(t),n=1<<r;e[r]=-1,t&=~n}}function vu(e){if(0!==(48&Oa))throw Error(s(327));if(Du(),e===xa&&0!==(e.expiredLanes&Da)){var t=Da,r=ku(e,t);0!==(ja&Fa)&&(r=ku(e,t=Kt(e,t)))}else r=ku(e,t=Kt(e,0));if(0!==e.tag&&2===r&&(Oa|=64,e.hydrate&&(e.hydrate=!1,Wn(e.containerInfo)),0!==(t=Ut(e))&&(r=ku(e,t))),1===r)throw r=Ua,Mu(e,0),bu(e,t),gu(e,zi()),r;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ou(e),gu(e,zi()),null}function wu(e,t){var r=Oa;Oa|=1;try{return e(t)}finally{0===(Oa=r)&&(Wa(),Yi())}}function _u(e,t){var r=Oa;Oa&=-2,Oa|=8;try{return e(t)}finally{0===(Oa=r)&&(Wa(),Yi())}}function Eu(e,t){li(La,Na),Na|=t,ja|=t}function Su(){Na=La.current,hi(La)}function Mu(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,Gn(r)),null!==Ba)for(r=Ba.return;null!==r;){var n=r;switch(n.tag){case 1:null!==(n=n.type.childContextTypes)&&void 0!==n&&bi();break;case 3:Do(),hi(pi),hi(di),Xo();break;case 5:Lo(n);break;case 4:Do();break;case 13:case 19:hi(Ko);break;case 10:no(n);break;case 23:case 24:Su()}r=r.return}xa=e,Ba=Gu(e.current,null),Da=Na=ja=t,Ka=0,Ua=null,za=Fa=qa=0}function Au(e,t){for(;;){var r=Ba;try{if(ro(),Jo.current=Os,ns){for(var n=es.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}ns=!1}if($o=0,rs=ts=es=null,is=!1,Ca.current=null,null===r||null===r.return){Ka=1,Ua=t,Ba=null;break}e:{var o=e,s=r.return,a=r,u=t;if(t=Da,a.flags|=2048,a.firstEffect=a.lastEffect=null,null!==u&&"object"===typeof u&&"function"===typeof u.then){var c=u;if(0===(2&a.mode)){var h=a.alternate;h?(a.updateQueue=h.updateQueue,a.memoizedState=h.memoizedState,a.lanes=h.lanes):(a.updateQueue=null,a.memoizedState=null)}var l=0!==(1&Ko.current),f=s;do{var d;if(d=13===f.tag){var p=f.memoizedState;if(null!==p)d=null!==p.dehydrated;else{var y=f.memoizedProps;d=void 0!==y.fallback&&(!0!==y.unstable_avoidThisFallback||!l)}}if(d){var g=f.updateQueue;if(null===g){var m=new Set;m.add(c),f.updateQueue=m}else g.add(c);if(0===(2&f.mode)){if(f.flags|=64,a.flags|=16384,a.flags&=-2981,1===a.tag)if(null===a.alternate)a.tag=17;else{var b=ho(-1,1);b.tag=2,lo(a,b)}a.lanes|=1;break e}u=void 0,a=t;var v=o.pingCache;if(null===v?(v=o.pingCache=new la,u=new Set,v.set(c,u)):void 0===(u=v.get(c))&&(u=new Set,v.set(c,u)),!u.has(a)){u.add(a);var w=qu.bind(null,o,c,a);c.then(w,w)}f.flags|=4096,f.lanes=t;break e}f=f.return}while(null!==f);u=Error((W(a.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Ka&&(Ka=2),u=ca(u,a),f=s;do{switch(f.tag){case 3:o=u,f.flags|=4096,t&=-t,f.lanes|=t,fo(f,fa(0,o,t));break e;case 1:o=u;var _=f.type,E=f.stateNode;if(0===(64&f.flags)&&("function"===typeof _.getDerivedStateFromError||null!==E&&"function"===typeof E.componentDidCatch&&(null===Qa||!Qa.has(E)))){f.flags|=4096,t&=-t,f.lanes|=t,fo(f,da(f,o,t));break e}}f=f.return}while(null!==f)}Cu(r)}catch(S){t=S,Ba===r&&null!==r&&(Ba=r=r.return);continue}break}}function Iu(){var e=Pa.current;return Pa.current=Os,null===e?Os:e}function ku(e,t){var r=Oa;Oa|=16;var n=Iu();for(xa===e&&Da===t||Mu(e,t);;)try{Tu();break}catch(i){Au(e,i)}if(ro(),Oa=r,Pa.current=n,null!==Ba)throw Error(s(261));return xa=null,Da=0,Ka}function Tu(){for(;null!==Ba;)Pu(Ba)}function Ru(){for(;null!==Ba&&!Ti();)Pu(Ba)}function Pu(e){var t=Ya(e.alternate,e,Na);e.memoizedProps=e.pendingProps,null===t?Cu(e):Ba=t,Ca.current=null}function Cu(e){var t=e;do{var r=t.alternate;if(e=t.return,0===(2048&t.flags)){if(null!==(r=aa(r,t,Na)))return void(Ba=r);if(24!==(r=t).tag&&23!==r.tag||null===r.memoizedState||0!==(1073741824&Na)||0===(4&r.mode)){for(var n=0,i=r.child;null!==i;)n|=i.lanes|i.childLanes,i=i.sibling;r.childLanes=n}null!==e&&0===(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(r=ua(t)))return r.flags&=2047,void(Ba=r);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Ba=t);Ba=t=e}while(null!==t);0===Ka&&(Ka=5)}function Ou(e){var t=Vi();return Gi(99,xu.bind(null,e,t)),null}function xu(e,t){do{Du()}while(null!==eu);if(0!==(48&Oa))throw Error(s(327));var r=e.finishedWork;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(s(177));e.callbackNode=null;var n=r.lanes|r.childLanes,i=n,o=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var a=e.eventTimes,u=e.expirationTimes;0<o;){var c=31-Vt(o),h=1<<c;i[c]=0,a[c]=-1,u[c]=-1,o&=~h}if(null!==iu&&0===(24&n)&&iu.has(e)&&iu.delete(e),e===xa&&(Ba=xa=null,Da=0),1<r.flags?null!==r.lastEffect?(r.lastEffect.nextEffect=r,n=r.firstEffect):n=r:n=r.firstEffect,null!==n){if(i=Oa,Oa|=32,Ca.current=null,qn=Zt,mn(a=gn())){if("selectionStart"in a)u={start:a.selectionStart,end:a.selectionEnd};else e:if(u=(u=a.ownerDocument)&&u.defaultView||window,(h=u.getSelection&&u.getSelection())&&0!==h.rangeCount){u=h.anchorNode,o=h.anchorOffset,c=h.focusNode,h=h.focusOffset;try{u.nodeType,c.nodeType}catch(I){u=null;break e}var l=0,f=-1,d=-1,p=0,y=0,g=a,m=null;t:for(;;){for(var b;g!==u||0!==o&&3!==g.nodeType||(f=l+o),g!==c||0!==h&&3!==g.nodeType||(d=l+h),3===g.nodeType&&(l+=g.nodeValue.length),null!==(b=g.firstChild);)m=g,g=b;for(;;){if(g===a)break t;if(m===u&&++p===o&&(f=l),m===c&&++y===h&&(d=l),null!==(b=g.nextSibling))break;m=(g=m).parentNode}g=b}u=-1===f||-1===d?null:{start:f,end:d}}else u=null;u=u||{start:0,end:0}}else u=null;Fn={focusedElem:a,selectionRange:u},Zt=!1,hu=null,lu=!1,Za=n;do{try{Bu()}catch(I){if(null===Za)throw Error(s(330));ju(Za,I),Za=Za.nextEffect}}while(null!==Za);hu=null,Za=n;do{try{for(a=e;null!==Za;){var v=Za.flags;if(16&v&&be(Za.stateNode,""),128&v){var w=Za.alternate;if(null!==w){var _=w.ref;null!==_&&("function"===typeof _?_(null):_.current=null)}}switch(1038&v){case 2:Ea(Za),Za.flags&=-3;break;case 6:Ea(Za),Za.flags&=-3,Ia(Za.alternate,Za);break;case 1024:Za.flags&=-1025;break;case 1028:Za.flags&=-1025,Ia(Za.alternate,Za);break;case 4:Ia(Za.alternate,Za);break;case 8:Aa(a,u=Za);var E=u.alternate;wa(u),null!==E&&wa(E)}Za=Za.nextEffect}}catch(I){if(null===Za)throw Error(s(330));ju(Za,I),Za=Za.nextEffect}}while(null!==Za);if(_=Fn,w=gn(),v=_.focusedElem,a=_.selectionRange,w!==v&&v&&v.ownerDocument&&yn(v.ownerDocument.documentElement,v)){null!==a&&mn(v)&&(w=a.start,void 0===(_=a.end)&&(_=w),"selectionStart"in v?(v.selectionStart=w,v.selectionEnd=Math.min(_,v.value.length)):(_=(w=v.ownerDocument||document)&&w.defaultView||window).getSelection&&(_=_.getSelection(),u=v.textContent.length,E=Math.min(a.start,u),a=void 0===a.end?E:Math.min(a.end,u),!_.extend&&E>a&&(u=a,a=E,E=u),u=pn(v,E),o=pn(v,a),u&&o&&(1!==_.rangeCount||_.anchorNode!==u.node||_.anchorOffset!==u.offset||_.focusNode!==o.node||_.focusOffset!==o.offset)&&((w=w.createRange()).setStart(u.node,u.offset),_.removeAllRanges(),E>a?(_.addRange(w),_.extend(o.node,o.offset)):(w.setEnd(o.node,o.offset),_.addRange(w))))),w=[];for(_=v;_=_.parentNode;)1===_.nodeType&&w.push({element:_,left:_.scrollLeft,top:_.scrollTop});for("function"===typeof v.focus&&v.focus(),v=0;v<w.length;v++)(_=w[v]).element.scrollLeft=_.left,_.element.scrollTop=_.top}Zt=!!qn,Fn=qn=null,e.current=r,Za=n;do{try{for(v=e;null!==Za;){var S=Za.flags;if(36&S&&ma(v,Za.alternate,Za),128&S){w=void 0;var M=Za.ref;if(null!==M){var A=Za.stateNode;Za.tag,w=A,"function"===typeof M?M(w):M.current=w}}Za=Za.nextEffect}}catch(I){if(null===Za)throw Error(s(330));ju(Za,I),Za=Za.nextEffect}}while(null!==Za);Za=null,Ki(),Oa=i}else e.current=r;if($a)$a=!1,eu=e,tu=t;else for(Za=n;null!==Za;)t=Za.nextEffect,Za.nextEffect=null,8&Za.flags&&((S=Za).sibling=null,S.stateNode=null),Za=t;if(0===(n=e.pendingLanes)&&(Qa=null),1===n?e===su?ou++:(ou=0,su=e):ou=0,r=r.stateNode,Mi&&"function"===typeof Mi.onCommitFiberRoot)try{Mi.onCommitFiberRoot(Si,r,void 0,64===(64&r.current.flags))}catch(I){}if(gu(e,zi()),Xa)throw Xa=!1,e=Ja,Ja=null,e;return 0!==(8&Oa)||Yi(),null}function Bu(){for(;null!==Za;){var e=Za.alternate;lu||null===hu||(0!==(8&Za.flags)?et(Za,hu)&&(lu=!0):13===Za.tag&&Ta(e,Za)&&et(Za,hu)&&(lu=!0));var t=Za.flags;0!==(256&t)&&ga(e,Za),0===(512&t)||$a||($a=!0,Wi(97,(function(){return Du(),null}))),Za=Za.nextEffect}}function Du(){if(90!==tu){var e=97<tu?97:tu;return tu=90,Gi(e,Ku)}return!1}function Nu(e,t){ru.push(t,e),$a||($a=!0,Wi(97,(function(){return Du(),null})))}function Lu(e,t){nu.push(t,e),$a||($a=!0,Wi(97,(function(){return Du(),null})))}function Ku(){if(null===eu)return!1;var e=eu;if(eu=null,0!==(48&Oa))throw Error(s(331));var t=Oa;Oa|=32;var r=nu;nu=[];for(var n=0;n<r.length;n+=2){var i=r[n],o=r[n+1],a=i.destroy;if(i.destroy=void 0,"function"===typeof a)try{a()}catch(c){if(null===o)throw Error(s(330));ju(o,c)}}for(r=ru,ru=[],n=0;n<r.length;n+=2){i=r[n],o=r[n+1];try{var u=i.create;i.destroy=u()}catch(c){if(null===o)throw Error(s(330));ju(o,c)}}for(u=e.current.firstEffect;null!==u;)e=u.nextEffect,u.nextEffect=null,8&u.flags&&(u.sibling=null,u.stateNode=null),u=e;return Oa=t,Yi(),!0}function Uu(e,t,r){lo(e,t=fa(0,t=ca(r,t),1)),t=fu(),null!==(e=yu(e,1))&&(zt(e,1,t),gu(e,t))}function ju(e,t){if(3===e.tag)Uu(e,e,t);else for(var r=e.return;null!==r;){if(3===r.tag){Uu(r,e,t);break}if(1===r.tag){var n=r.stateNode;if("function"===typeof r.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===Qa||!Qa.has(n))){var i=da(r,e=ca(t,e),1);if(lo(r,i),i=fu(),null!==(r=yu(r,1)))zt(r,1,i),gu(r,i);else if("function"===typeof n.componentDidCatch&&(null===Qa||!Qa.has(n)))try{n.componentDidCatch(t,e)}catch(o){}break}}r=r.return}}function qu(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),t=fu(),e.pingedLanes|=e.suspendedLanes&r,xa===e&&(Da&r)===r&&(4===Ka||3===Ka&&(62914560&Da)===Da&&500>zi()-Ha?Mu(e,0):za|=r),gu(e,t)}function Fu(e,t){var r=e.stateNode;null!==r&&r.delete(t),0===(t=0)&&(0===(2&(t=e.mode))?t=1:0===(4&t)?t=99===Vi()?1:2:(0===uu&&(uu=ja),0===(t=qt(62914560&~uu))&&(t=4194304))),r=fu(),null!==(e=yu(e,t))&&(zt(e,t,r),gu(e,r))}function zu(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Vu(e,t,r,n){return new zu(e,t,r,n)}function Hu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Gu(e,t){var r=e.alternate;return null===r?((r=Vu(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Wu(e,t,r,n,i,o){var a=2;if(n=e,"function"===typeof e)Hu(e)&&(a=1);else if("string"===typeof e)a=5;else e:switch(e){case M:return Yu(r.children,i,o,t);case N:a=8,i|=16;break;case A:a=8,i|=1;break;case I:return(e=Vu(12,r,t,8|i)).elementType=I,e.type=I,e.lanes=o,e;case P:return(e=Vu(13,r,t,i)).type=P,e.elementType=P,e.lanes=o,e;case C:return(e=Vu(19,r,t,i)).elementType=C,e.lanes=o,e;case L:return Zu(r,i,o,t);case K:return(e=Vu(24,r,t,i)).elementType=K,e.lanes=o,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case k:a=10;break e;case T:a=9;break e;case R:a=11;break e;case O:a=14;break e;case x:a=16,n=null;break e;case B:a=22;break e}throw Error(s(130,null==e?e:typeof e,""))}return(t=Vu(a,r,t,i)).elementType=e,t.type=n,t.lanes=o,t}function Yu(e,t,r,n){return(e=Vu(7,e,n,t)).lanes=r,e}function Zu(e,t,r,n){return(e=Vu(23,e,n,t)).elementType=L,e.lanes=r,e}function Xu(e,t,r){return(e=Vu(6,e,null,t)).lanes=r,e}function Ju(e,t,r){return(t=Vu(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qu(e,t,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=r,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Ft(0),this.expirationTimes=Ft(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.mutableSourceEagerHydrationData=null}function $u(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:S,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}function ec(e,t,r,n){var i=t.current,o=fu(),a=du(i);e:if(r){t:{if(Xe(r=r._reactInternals)!==r||1!==r.tag)throw Error(s(170));var u=r;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(mi(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(s(171))}if(1===r.tag){var c=r.type;if(mi(c)){r=wi(r,c,u);break e}}r=u}else r=fi;return null===t.context?t.context=r:t.pendingContext=r,(t=ho(o,a)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),lo(i,t),pu(i,a,o),a}function tc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function rc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function nc(e,t){rc(e,t),(e=e.alternate)&&rc(e,t)}function ic(e,t,r){var n=null!=r&&null!=r.hydrationOptions&&r.hydrationOptions.mutableSources||null;if(r=new Qu(e,t,null!=r&&!0===r.hydrate),t=Vu(3,null,null,2===t?7:1===t?3:0),r.current=t,t.stateNode=r,uo(t),e[ei]=r.current,On(8===e.nodeType?e.parentNode:e),n)for(e=0;e<n.length;e++){var i=(t=n[e])._getVersion;i=i(t._source),null==r.mutableSourceEagerHydrationData?r.mutableSourceEagerHydrationData=[t,i]:r.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=r}function oc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function sc(e,t,r,n,i){var o=r._reactRootContainer;if(o){var s=o._internalRoot;if("function"===typeof i){var a=i;i=function(){var e=tc(s);a.call(e)}}ec(t,s,e,i)}else{if(o=r._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var r;r=e.lastChild;)e.removeChild(r);return new ic(e,0,t?{hydrate:!0}:void 0)}(r,n),s=o._internalRoot,"function"===typeof i){var u=i;i=function(){var e=tc(s);u.call(e)}}_u((function(){ec(t,s,e,i)}))}return tc(s)}function ac(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!oc(t))throw Error(s(200));return $u(e,t,null,r)}Ya=function(e,t,r){var n=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||pi.current)Ls=!0;else{if(0===(r&n)){switch(Ls=!1,t.tag){case 3:Ws(t),Yo();break;case 5:No(t);break;case 1:mi(t.type)&&_i(t);break;case 4:Bo(t,t.stateNode.containerInfo);break;case 10:n=t.memoizedProps.value;var i=t.type._context;li(Qi,i._currentValue),i._currentValue=n;break;case 13:if(null!==t.memoizedState)return 0!==(r&t.child.childLanes)?Qs(e,t,r):(li(Ko,1&Ko.current),null!==(t=oa(e,t,r))?t.sibling:null);li(Ko,1&Ko.current);break;case 19:if(n=0!==(r&t.childLanes),0!==(64&e.flags)){if(n)return ia(e,t,r);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),li(Ko,Ko.current),n)break;return null;case 23:case 24:return t.lanes=0,Fs(e,t,r)}return oa(e,t,r)}Ls=0!==(16384&e.flags)}else Ls=!1;switch(t.lanes=0,t.tag){case 2:if(n=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=gi(t,di.current),oo(t,r),i=as(null,t,n,e,i,r),t.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,mi(n)){var o=!0;_i(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,uo(t);var a=n.getDerivedStateFromProps;"function"===typeof a&&mo(t,n,a,e),i.updater=bo,t.stateNode=i,i._reactInternals=t,Eo(t,n,e,r),t=Gs(null,t,n,!0,o,r)}else t.tag=0,Ks(null,t,i,r),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"===typeof e)return Hu(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===R)return 11;if(e===O)return 14}return 2}(i),e=Ji(i,e),o){case 0:t=Vs(null,t,i,e,r);break e;case 1:t=Hs(null,t,i,e,r);break e;case 11:t=Us(null,t,i,e,r);break e;case 14:t=js(null,t,i,Ji(i.type,e),n,r);break e}throw Error(s(306,i,""))}return t;case 0:return n=t.type,i=t.pendingProps,Vs(e,t,n,i=t.elementType===n?i:Ji(n,i),r);case 1:return n=t.type,i=t.pendingProps,Hs(e,t,n,i=t.elementType===n?i:Ji(n,i),r);case 3:if(Ws(t),n=t.updateQueue,null===e||null===n)throw Error(s(282));if(n=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,co(e,t),po(t,n,null,r),(n=t.memoizedState.element)===i)Yo(),t=oa(e,t,r);else{if((o=(i=t.stateNode).hydrate)&&(qo=Yn(t.stateNode.containerInfo.firstChild),jo=t,o=Fo=!0),o){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(o=e[i])._workInProgressVersionPrimary=e[i+1],Zo.push(o);for(r=To(t,null,n,r),t.child=r;r;)r.flags=-3&r.flags|1024,r=r.sibling}else Ks(e,t,n,r),Yo();t=t.child}return t;case 5:return No(t),null===e&&Ho(t),n=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,Vn(n,i)?a=null:null!==o&&Vn(n,o)&&(t.flags|=16),zs(e,t),Ks(e,t,a,r),t.child;case 6:return null===e&&Ho(t),null;case 13:return Qs(e,t,r);case 4:return Bo(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=ko(t,null,n,r):Ks(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,Us(e,t,n,i=t.elementType===n?i:Ji(n,i),r);case 7:return Ks(e,t,t.pendingProps,r),t.child;case 8:case 12:return Ks(e,t,t.pendingProps.children,r),t.child;case 10:e:{n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value;var u=t.type._context;if(li(Qi,u._currentValue),u._currentValue=o,null!==a)if(u=a.value,0===(o=hn(u,o)?0:0|("function"===typeof n._calculateChangedBits?n._calculateChangedBits(u,o):1073741823))){if(a.children===i.children&&!pi.current){t=oa(e,t,r);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var c=u.dependencies;if(null!==c){a=u.child;for(var h=c.firstContext;null!==h;){if(h.context===n&&0!==(h.observedBits&o)){1===u.tag&&((h=ho(-1,r&-r)).tag=2,lo(u,h)),u.lanes|=r,null!==(h=u.alternate)&&(h.lanes|=r),io(u.return,r),c.lanes|=r;break}h=h.next}}else a=10===u.tag&&u.type===t.type?null:u.child;if(null!==a)a.return=u;else for(a=u;null!==a;){if(a===t){a=null;break}if(null!==(u=a.sibling)){u.return=a.return,a=u;break}a=a.return}u=a}Ks(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=(o=t.pendingProps).children,oo(t,r),n=n(i=so(i,o.unstable_observedBits)),t.flags|=1,Ks(e,t,n,r),t.child;case 14:return o=Ji(i=t.type,t.pendingProps),js(e,t,i,o=Ji(i.type,o),n,r);case 15:return qs(e,t,t.type,t.pendingProps,n,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ji(n,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,mi(n)?(e=!0,_i(t)):e=!1,oo(t,r),wo(t,n,i),Eo(t,n,i,r),Gs(null,t,n,!0,e,r);case 19:return ia(e,t,r);case 23:case 24:return Fs(e,t,r)}throw Error(s(156,t.tag))},ic.prototype.render=function(e){ec(e,this._internalRoot,null,null)},ic.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;ec(null,e,null,(function(){t[ei]=null}))},tt=function(e){13===e.tag&&(pu(e,4,fu()),nc(e,4))},rt=function(e){13===e.tag&&(pu(e,67108864,fu()),nc(e,67108864))},nt=function(e){if(13===e.tag){var t=fu(),r=du(e);pu(e,r,t),nc(e,r)}},it=function(e,t){return t()},ke=function(e,t,r){switch(t){case"input":if(re(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=oi(n);if(!i)throw Error(s(90));J(n),re(n,i)}}}break;case"textarea":ce(e,r);break;case"select":null!=(t=r.value)&&se(e,!!r.multiple,t,!1)}},xe=wu,Be=function(e,t,r,n,i){var o=Oa;Oa|=4;try{return Gi(98,e.bind(null,t,r,n,i))}finally{0===(Oa=o)&&(Wa(),Yi())}},De=function(){0===(49&Oa)&&(function(){if(null!==iu){var e=iu;iu=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,gu(e,zi())}))}Yi()}(),Du())},Ne=function(e,t){var r=Oa;Oa|=2;try{return e(t)}finally{0===(Oa=r)&&(Wa(),Yi())}};var uc={Events:[ni,ii,oi,Ce,Oe,Du,{current:!1}]},cc={findFiberByHostInstance:ri,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},hc={bundleType:cc.bundleType,version:cc.version,rendererPackageName:cc.rendererPackageName,rendererConfig:cc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=$e(e))?null:e.stateNode},findFiberByHostInstance:cc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lc.isDisabled&&lc.supportsFiber)try{Si=lc.inject(hc),Mi=lc}catch(ge){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uc,t.createPortal=ac,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(s(188));throw Error(s(268,Object.keys(e)))}return e=null===(e=$e(t))?null:e.stateNode},t.flushSync=function(e,t){var r=Oa;if(0!==(48&r))return e(t);Oa|=1;try{if(e)return Gi(99,e.bind(null,t))}finally{Oa=r,Yi()}},t.hydrate=function(e,t,r){if(!oc(t))throw Error(s(200));return sc(null,e,t,!0,r)},t.render=function(e,t,r){if(!oc(t))throw Error(s(200));return sc(null,e,t,!1,r)},t.unmountComponentAtNode=function(e){if(!oc(e))throw Error(s(40));return!!e._reactRootContainer&&(_u((function(){sc(null,null,e,!1,(function(){e._reactRootContainer=null,e[ei]=null}))})),!0)},t.unstable_batchedUpdates=wu,t.unstable_createPortal=function(e,t){return ac(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!oc(r))throw Error(s(200));if(null==e||void 0===e._reactInternals)throw Error(s(38));return sc(e,t,r,!1,n)},t.version="17.0.2"},54164:(e,t,r)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=r(34463)},66374:(e,t,r)=>{"use strict";r(31725);var n=r(72791),i=60103;if(60107,"function"===typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),o("react.fragment")}var s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,o={},c=null,h=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(h=t.ref),t)a.call(t,n)&&!u.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===o[n]&&(o[n]=t[n]);return{$$typeof:i,type:e,key:c,ref:h,props:o,_owner:s.current}}t.jsx=c,t.jsxs=c},59117:(e,t,r)=>{"use strict";var n=r(31725),i=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var s=60109,a=60110,u=60112;t.Suspense=60113;var c=60115,h=60116;if("function"===typeof Symbol&&Symbol.for){var l=Symbol.for;i=l("react.element"),o=l("react.portal"),t.Fragment=l("react.fragment"),t.StrictMode=l("react.strict_mode"),t.Profiler=l("react.profiler"),s=l("react.provider"),a=l("react.context"),u=l("react.forward_ref"),t.Suspense=l("react.suspense"),c=l("react.memo"),h=l("react.lazy")}var f="function"===typeof Symbol&&Symbol.iterator;function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y={};function g(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||p}function m(){}function b(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||p}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(d(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=g.prototype;var v=b.prototype=new m;v.constructor=b,n(v,g.prototype),v.isPureReactComponent=!0;var w={current:null},_=Object.prototype.hasOwnProperty,E={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,r){var n,o={},s=null,a=null;if(null!=t)for(n in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(s=""+t.key),t)_.call(t,n)&&!E.hasOwnProperty(n)&&(o[n]=t[n]);var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){for(var c=Array(u),h=0;h<u;h++)c[h]=arguments[h+2];o.children=c}if(e&&e.defaultProps)for(n in u=e.defaultProps)void 0===o[n]&&(o[n]=u[n]);return{$$typeof:i,type:e,key:s,ref:a,props:o,_owner:w.current}}function M(e){return"object"===typeof e&&null!==e&&e.$$typeof===i}var A=/\/+/g;function I(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function k(e,t,r,n,s){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var u=!1;if(null===e)u=!0;else switch(a){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case i:case o:u=!0}}if(u)return s=s(u=e),e=""===n?"."+I(u,0):n,Array.isArray(s)?(r="",null!=e&&(r=e.replace(A,"$&/")+"/"),k(s,t,r,"",(function(e){return e}))):null!=s&&(M(s)&&(s=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(s,r+(!s.key||u&&u.key===s.key?"":(""+s.key).replace(A,"$&/")+"/")+e)),t.push(s)),1;if(u=0,n=""===n?".":n+":",Array.isArray(e))for(var c=0;c<e.length;c++){var h=n+I(a=e[c],c);u+=k(a,t,r,h,s)}else if(h=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e),"function"===typeof h)for(e=h.call(e),c=0;!(a=e.next()).done;)u+=k(a=a.value,t,r,h=n+I(a,c++),s);else if("object"===a)throw t=""+e,Error(d(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return u}function T(e,t,r){if(null==e)return e;var n=[],i=0;return k(e,n,"","",(function(e){return t.call(r,e,i++)})),n}function R(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var P={current:null};function C(){var e=P.current;if(null===e)throw Error(d(321));return e}var O={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:n};t.Children={map:T,forEach:function(e,t,r){T(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return T(e,(function(){t++})),t},toArray:function(e){return T(e,(function(e){return e}))||[]},only:function(e){if(!M(e))throw Error(d(143));return e}},t.Component=g,t.PureComponent=b,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O,t.cloneElement=function(e,t,r){if(null===e||void 0===e)throw Error(d(267,e));var o=n({},e.props),s=e.key,a=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,u=w.current),void 0!==t.key&&(s=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(h in t)_.call(t,h)&&!E.hasOwnProperty(h)&&(o[h]=void 0===t[h]&&void 0!==c?c[h]:t[h])}var h=arguments.length-2;if(1===h)o.children=r;else if(1<h){c=Array(h);for(var l=0;l<h;l++)c[l]=arguments[l+2];o.children=c}return{$$typeof:i,type:e.type,key:s,ref:a,props:o,_owner:u}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:a,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=S,t.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=M,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:R}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return C().useCallback(e,t)},t.useContext=function(e,t){return C().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return C().useEffect(e,t)},t.useImperativeHandle=function(e,t,r){return C().useImperativeHandle(e,t,r)},t.useLayoutEffect=function(e,t){return C().useLayoutEffect(e,t)},t.useMemo=function(e,t){return C().useMemo(e,t)},t.useReducer=function(e,t,r){return C().useReducer(e,t,r)},t.useRef=function(e){return C().useRef(e)},t.useState=function(e){return C().useState(e)},t.version="17.0.2"},72791:(e,t,r)=>{"use strict";e.exports=r(59117)},80184:(e,t,r)=>{"use strict";e.exports=r(66374)},14003:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"===typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s,a;if("string"===typeof t&&(o="not ",t.substr(!s||s<0?0:+s,o.length)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var u=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(u," ").concat(i," ").concat(n(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},48749:(e,t,r)=>{"use strict";var n=r(1426),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=h;var o=r(26978),s=r(51704);r(12534)(h,o);for(var a=i(s.prototype),u=0;u<a.length;u++){var c=a[u];h.prototype[c]||(h.prototype[c]=s.prototype[c])}function h(e){if(!(this instanceof h))return new h(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},95627:(e,t,r)=>{"use strict";e.exports=i;var n=r(4784);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(12534)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},26978:(e,t,r)=>{"use strict";var n,i=r(1426);e.exports=A,A.ReadableState=M;r(47465).EventEmitter;var o=function(e,t){return e.listeners(t).length},s=r(76184),a=r(19778).Buffer,u=r.g.Uint8Array||function(){};var c,h=r(94616);c=h&&h.debuglog?h.debuglog("stream"):function(){};var l,f,d,p=r(25566),y=r(32644),g=r(5730).getHighWaterMark,m=r(14003).q,b=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(12534)(A,s);var E=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function M(e,t,i){n=n||r(48749),e=e||{},"boolean"!==typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(15948).s),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function A(e){if(n=n||r(48749),!(this instanceof A))return new A(e);var t=this instanceof n;this._readableState=new M(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function I(e,t,r,n,i){c("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?P(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}(e,s);else if(i||(o=function(e,t){var r;n=t,a.isBuffer(n)||n instanceof u||"string"===typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(s,t)),o)E(e,o);else if(s.objectMode||t&&t.length>0)if("string"===typeof t||s.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)s.endEmitted?E(e,new _):k(e,s,t,!0);else if(s.ended)E(e,new v);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?k(e,s,t,!1):O(e,s)):k(e,s,t,!1)}else n||(s.reading=!1,O(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function k(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&P(e)),O(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=y.destroy,A.prototype._undestroy=y.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"===typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=a.from(e,t),t=""),r=!0),I(this,e,t,!1,r)},A.prototype.unshift=function(e){return I(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(e){l||(l=r(15948).s);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var T=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function P(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(C,e))}function C(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function O(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(x,e,t))}function x(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function B(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){c("readable nexttick read 0"),e.read(0)}function N(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function K(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function U(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(j,t,e))}function j(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function q(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}A.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):P(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?K(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){E(this,new w("_read()"))},A.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,t);var s=(!t||!1!==t.end)&&e!==i.stdout&&e!==i.stderr?u:g;function a(t,i){c("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",y),e.removeListener("drain",h),e.removeListener("error",d),e.removeListener("unpipe",a),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function u(){c("onend"),e.end()}n.endEmitted?i.nextTick(s):r.once("end",s),e.on("unpipe",a);var h=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",h);var l=!1;function f(t){c("ondata");var i=e.write(t);c("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==q(n.pipes,e))&&!l&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){c("onerror",t),g(),e.removeListener("error",d),0===o(e,"error")&&E(e,t)}function p(){e.removeListener("finish",y),g()}function y(){c("onfinish"),e.removeListener("close",p),g()}function g(){c("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",p),e.once("finish",y),e.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=q(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},A.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?P(this):n.reading||i.nextTick(D,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(B,this),r},A.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(B,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(N,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause())))})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<S.length;o++)e.on(S[o],this.emit.bind(this,S[o]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"===typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(79150)),f(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=K,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"===typeof Symbol&&(A.from=function(e,t){return void 0===d&&(d=r(74886)),d(A,e,t)})},4784:(e,t,r)=>{"use strict";e.exports=h;var n=r(14003).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(48749);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function h(e){if(!(this instanceof h))return new h(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"===typeof e.transform&&(this._transform=e.transform),"function"===typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!==typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,r){f(e,t,r)}))}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(12534)(h,u),h.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},h.prototype._transform=function(e,t,r){r(new i("_transform()"))},h.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},h.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},h.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},51704:(e,t,r)=>{"use strict";var n,i=r(1426);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=A,A.WritableState=M;var s={deprecate:r(89515)},a=r(76184),u=r(19778).Buffer,c=r.g.Uint8Array||function(){};var h,l=r(32644),f=r(5730).getHighWaterMark,d=r(14003).q,p=d.ERR_INVALID_ARG_TYPE,y=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,E=l.errorOrDestroy;function S(){}function M(e,t,s){n=n||r(48749),e=e||{},"boolean"!==typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!==typeof o)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(C,e,t),e._writableState.errorEmitted=!0,E(e,n)):(o(n),e._writableState.errorEmitted=!0,E(e,n),C(e,t))}(e,r,n,t,o);else{var s=R(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?i.nextTick(k,e,r,s,o):k(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(e){var t=this instanceof(n=n||r(48749));if(!t&&!h.call(A,this))return new A(e);this._writableState=new M(e,this,t),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),a.call(this)}function I(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function k(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),C(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,I(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,h=r.encoding,l=r.callback;if(I(e,t,!1,t.objectMode?1:c.length,c,h,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function P(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),C(e,t)}))}function C(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!==typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(P,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(12534)(A,a),M.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(M.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===A&&(e&&e._writableState instanceof M)}})):h=function(e){return e instanceof this},A.prototype.pipe=function(){E(this,new m)},A.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,u.isBuffer(n)||n instanceof c);return a&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"===typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!==typeof r&&(r=S),o.ending?function(e,t){var r=new w;E(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new v:"string"===typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(E(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=u.from(t,r));return t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var h=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},h?h.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else I(e,t,!1,a,n,i,o);return c}(this,o,a,e,t,r)),s},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"===typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,r){var n=this._writableState;return"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,C(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(e,t){t(e)}},79150:(e,t,r)=>{"use strict";var n,i=r(1426);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(45762),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),h=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function y(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[l]=null,e[a]=null,e[u]=null,t(p(r,!1)))}}function g(e){i.nextTick(y,e)}var m=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[h])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[c]?r(e[c]):t(p(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[h]?r(p(void 0,!0)):t[f](r,n)}),n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[f])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(b,(o(t={},d,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,h,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var n=r[d].read();n?(r[l]=null,r[a]=null,r[u]=null,e(p(n,!1))):(r[a]=e,r[u]=t)},writable:!0}),t));return r[l]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[l]=null,r[a]=null,r[u]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[u]=null,n(p(void 0,!0))),r[h]=!0})),e.on("readable",g.bind(null,r)),r}},25566:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}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)}}var s=r(19778).Buffer,a=r(52361).inspect,u=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,c;return t=e,r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],r&&o(t.prototype,r),c&&o(t,c),e}()},32644:(e,t,r)=>{"use strict";var n=r(1426);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},45762:(e,t,r)=>{"use strict";var n=r(14003).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"===typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||h()},c=t._writableState&&t._writableState.finished,h=function(){a=!1,c=!0,s||o.call(t)},l=t._readableState&&t._readableState.endEmitted,f=function(){s=!1,l=!0,a||o.call(t)},d=function(e){o.call(t,e)},p=function(){var e;return s&&!l?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on("finish",h)};return!function(e){return e.setHeader&&"function"===typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",h),t.on("abort",p),t.req?y():t.on("request",y)),t.on("end",f),t.on("finish",h),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",h),t.removeListener("abort",p),t.removeListener("request",y),t.req&&t.req.removeListener("finish",h),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",h),t.removeListener("end",f),t.removeListener("error",d),t.removeListener("close",p)}}},74886:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},34541:(e,t,r)=>{"use strict";var n;var i=r(14003).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(45762)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&"function"===typeof e.abort}(e)?e.abort():"function"===typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}function c(e){e()}function h(e,t){return e.pipe(t)}function l(e){return e.length?"function"!==typeof e[e.length-1]?a:e.pop():a}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=l(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var s=t.map((function(e,r){var o=r<t.length-1;return u(e,o,r>0,(function(e){n||(n=e),e&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return t.reduce(h)}},5730:(e,t,r)=>{"use strict";var n=r(14003).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},76184:(e,t,r)=>{e.exports=r(47465).EventEmitter},90723:(e,t,r)=>{(t=e.exports=r(26978)).Stream=t,t.Readable=t,t.Writable=r(51704),t.Duplex=r(48749),t.Transform=r(4784),t.PassThrough=r(95627),t.finished=r(45762),t.pipeline=r(34541)},83375:(e,t,r)=>{"use strict";var n=r(19778).Buffer,i=r(12534),o=r(86266),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],h=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function y(e,t,r,n,i,o,s,a){return p(e+(t^r^n)+o+s|0,a)+i|0}function g(e,t,r,n,i,o,s,a){return p(e+(t&r|~t&n)+o+s|0,a)+i|0}function m(e,t,r,n,i,o,s,a){return p(e+((t|~r)^n)+o+s|0,a)+i|0}function b(e,t,r,n,i,o,s,a){return p(e+(t&n|r&~n)+o+s|0,a)+i|0}function v(e,t,r,n,i,o,s,a){return p(e+(t^(r|~n))+o+s|0,a)+i|0}i(d,o),d.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,E=0|this._c,S=0|this._d,M=0|this._e,A=0;A<80;A+=1){var I,k;A<16?(I=y(r,n,i,o,d,e[a[A]],l[0],c[A]),k=v(w,_,E,S,M,e[u[A]],f[0],h[A])):A<32?(I=g(r,n,i,o,d,e[a[A]],l[1],c[A]),k=b(w,_,E,S,M,e[u[A]],f[1],h[A])):A<48?(I=m(r,n,i,o,d,e[a[A]],l[2],c[A]),k=m(w,_,E,S,M,e[u[A]],f[2],h[A])):A<64?(I=b(r,n,i,o,d,e[a[A]],l[3],c[A]),k=g(w,_,E,S,M,e[u[A]],f[3],h[A])):(I=v(r,n,i,o,d,e[a[A]],l[4],c[A]),k=y(w,_,E,S,M,e[u[A]],f[4],h[A])),r=d,d=o,o=p(i,10),i=n,n=I,w=M,M=S,S=p(E,10),E=_,_=k}var T=this._b+i+S|0;this._b=this._c+o+M|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+n+E|0,this._a=T},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},82543:(e,t,r)=>{var n=r(19778),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},39138:(e,t,r)=>{"use strict";var n,i=r(1426),o=r(19778),s=o.Buffer,a={};for(n in o)o.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=o[n]);var u=a.Buffer={};for(n in s)s.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(u[n]=s[n]);if(a.Buffer.prototype=s.prototype,u.from&&u.from!==Uint8Array.from||(u.from=function(e,t,r){if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&"undefined"===typeof e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return s(e,t,r)}),u.alloc||(u.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=s(e);return t&&0!==t.length?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=i.binding("buffer").kStringMaxLength}catch(c){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a},36813:(e,t)=>{"use strict";var r,n,i,o;if("object"===typeof performance&&"function"===typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}if("undefined"===typeof window||"function"!==typeof MessageChannel){var c=null,h=null,l=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(r){throw setTimeout(l,0),r}};r=function(e){null!==c?setTimeout(r,0,e):(c=e,setTimeout(l,0))},n=function(e,t){h=setTimeout(e,t)},i=function(){clearTimeout(h)},t.unstable_shouldYield=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var f=window.setTimeout,d=window.clearTimeout;if("undefined"!==typeof console){var p=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!==typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var y=!1,g=null,m=-1,b=5,v=0;t.unstable_shouldYield=function(){return t.unstable_now()>=v},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<e?Math.floor(1e3/e):5};var w=new MessageChannel,_=w.port2;w.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();v=e+b;try{g(!0,e)?_.postMessage(null):(y=!1,g=null)}catch(r){throw _.postMessage(null),r}}else y=!1},r=function(e){g=e,y||(y=!0,_.postMessage(null))},n=function(e,r){m=f((function(){e(t.unstable_now())}),r)},i=function(){d(m),m=-1}}function E(e,t){var r=e.length;e.push(t);e:for(;;){var n=r-1>>>1,i=e[n];if(!(void 0!==i&&0<A(i,t)))break e;e[n]=t,e[r]=i,r=n}}function S(e){return void 0===(e=e[0])?null:e}function M(e){var t=e[0];if(void 0!==t){var r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length;n<i;){var o=2*(n+1)-1,s=e[o],a=o+1,u=e[a];if(void 0!==s&&0>A(s,r))void 0!==u&&0>A(u,s)?(e[n]=u,e[a]=r,n=a):(e[n]=s,e[o]=r,n=o);else{if(!(void 0!==u&&0>A(u,r)))break e;e[n]=u,e[a]=r,n=a}}}return t}return null}function A(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var I=[],k=[],T=1,R=null,P=3,C=!1,O=!1,x=!1;function B(e){for(var t=S(k);null!==t;){if(null===t.callback)M(k);else{if(!(t.startTime<=e))break;M(k),t.sortIndex=t.expirationTime,E(I,t)}t=S(k)}}function D(e){if(x=!1,B(e),!O)if(null!==S(I))O=!0,r(N);else{var t=S(k);null!==t&&n(D,t.startTime-e)}}function N(e,r){O=!1,x&&(x=!1,i()),C=!0;var o=P;try{for(B(r),R=S(I);null!==R&&(!(R.expirationTime>r)||e&&!t.unstable_shouldYield());){var s=R.callback;if("function"===typeof s){R.callback=null,P=R.priorityLevel;var a=s(R.expirationTime<=r);r=t.unstable_now(),"function"===typeof a?R.callback=a:R===S(I)&&M(I),B(r)}else M(I);R=S(I)}if(null!==R)var u=!0;else{var c=S(k);null!==c&&n(D,c.startTime-r),u=!1}return u}finally{R=null,P=o,C=!1}}var L=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){O||C||(O=!0,r(N))},t.unstable_getCurrentPriorityLevel=function(){return P},t.unstable_getFirstCallbackNode=function(){return S(I)},t.unstable_next=function(e){switch(P){case 1:case 2:case 3:var t=3;break;default:t=P}var r=P;P=t;try{return e()}finally{P=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=L,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=P;P=e;try{return t()}finally{P=r}},t.unstable_scheduleCallback=function(e,o,s){var a=t.unstable_now();switch("object"===typeof s&&null!==s?s="number"===typeof(s=s.delay)&&0<s?a+s:a:s=a,e){case 1:var u=-1;break;case 2:u=250;break;case 5:u=1073741823;break;case 4:u=1e4;break;default:u=5e3}return e={id:T++,callback:o,priorityLevel:e,startTime:s,expirationTime:u=s+u,sortIndex:-1},s>a?(e.sortIndex=s,E(k,e),null===S(I)&&e===S(k)&&(x?i():x=!0,n(D,s-a))):(e.sortIndex=u,E(I,e),O||C||(O=!0,r(N))),e},t.unstable_wrapCallback=function(e){var t=P;return function(){var r=P;P=t;try{return e.apply(this,arguments)}finally{P=r}}}},45296:(e,t,r)=>{"use strict";e.exports=r(36813)},82145:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Nouns=t.Adjectives=void 0,t.Adjectives=["Adorable","Adventurous","Agressive","Alert","Alive","Amused","Angry","Annoyed","Annoying","silent","empty","dry","dark","summer","icy","delicate","quiet","white","cool","spring","winter","patient","twilight","dawn","crimson","wispy","weathered","blue","billowing","broken","cold","damp","falling","frosty","green","long","late","lingering","bold","little","morning","muddy","old","red","rough","still","small","sparkling","throbbing","shy","wandering","withered","wild","black","young","holy","solitary","fragrant","aged","snowy","proud","floral","restless","divine","polished","ancient","purple","lively","nameless"],t.Nouns=["waterfall","river","breeze","moon","rain","wind","sea","morning","snow","lake","sunset","pine","shadow","leaf","dawn","glitter","forest","hill","cloud","meadow","sun","glade","bird","brook","butterfly","bush","dew","dust","field","fire","flower","firefly","feather","grass","haze","mountain","night","pond","darkness","snowflake","silence","sound","sky","shape","surf","thunder","violet","water","wildflower","wave","water","resonance","sun","wood","dream","cherry","tree","fog","frost","voice","paper","frog","smoke","star"]},22861:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(82145);t.default=()=>n.Adjectives[Math.floor(Math.random()*n.Adjectives.length)]+" "+n.Nouns[Math.floor(Math.random()*n.Nouns.length)]},68555:(e,t,r)=>{"use strict";var n=r(22861);Object.defineProperty(t,"R",{enumerable:!0,get:function(){return n.default}})},14454:(e,t,r)=>{var n=r(82543).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"===typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,s=this._len,a=0;a<o;){for(var u=s%i,c=Math.min(o-a,i-u),h=0;h<c;h++)r[u+h]=e[a+h];a+=c,(s+=c)%i===0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},85730:(e,t,r)=>{var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(29940),n.sha1=r(97453),n.sha224=r(68633),n.sha256=r(97101),n.sha384=r(713),n.sha512=r(23884)},29940:(e,t,r)=>{var n=r(12534),i=r(14454),o=r(82543).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function c(e){return e<<30|e>>>2}function h(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var f=0;f<80;++f){var d=~~(f/20),p=0|((t=n)<<5|t>>>27)+h(d,i,o,a)+u+r[f]+s[d];u=a,a=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},97453:(e,t,r)=>{var n=r(12534),i=r(14454),o=r(82543).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function h(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=(t=r[f-3]^r[f-8]^r[f-14]^r[f-16])<<1|t>>>31;for(var d=0;d<80;++d){var p=~~(d/20),y=c(n)+l(p,i,o,a)+u+r[d]+s[p]|0;u=a,a=o,o=h(i),i=n,n=y}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},68633:(e,t,r)=>{var n=r(12534),i=r(97101),o=r(14454),s=r(82543).Buffer,a=new Array(64);function u(){this.init(),this._w=a,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},97101:(e,t,r)=>{var n=r(12534),i=r(14454),o=r(82543).Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function u(){this.init(),this._w=a,i.call(this,64,56)}function c(e,t,r){return r^e&(t^r)}function h(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,p=0|this._f,y=0|this._g,g=0|this._h,m=0;m<16;++m)r[m]=e.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((t=r[m-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[m-7]+d(r[m-15])+r[m-16];for(var b=0;b<64;++b){var v=g+f(u)+c(u,p,y)+s[b]+r[b]|0,w=l(n)+h(n,i,o)|0;g=y,y=p,p=u,u=a+v|0,a=o,o=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},713:(e,t,r)=>{var n=r(12534),i=r(23884),o=r(14454),s=r(82543).Buffer,a=new Array(160);function u(){this.init(),this._w=a,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=s.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},23884:(e,t,r)=>{var n=r(12534),i=r(14454),o=r(82543).Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function u(){this.init(),this._w=a,i.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function h(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0<t>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,b=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,E=0|this._cl,S=0|this._dl,M=0|this._el,A=0|this._fl,I=0|this._gl,k=0|this._hl,T=0;T<32;T+=2)t[T]=e.readInt32BE(4*T),t[T+1]=e.readInt32BE(4*T+4);for(;T<160;T+=2){var R=t[T-30],P=t[T-30+1],C=d(R,P),O=p(P,R),x=y(R=t[T-4],P=t[T-4+1]),B=g(P,R),D=t[T-14],N=t[T-14+1],L=t[T-32],K=t[T-32+1],U=O+N|0,j=C+D+m(U,O)|0;j=(j=j+x+m(U=U+B|0,B)|0)+L+m(U=U+K|0,K)|0,t[T]=j,t[T+1]=U}for(var q=0;q<160;q+=2){j=t[q],U=t[q+1];var F=h(r,n,i),z=h(w,_,E),V=l(r,w),H=l(w,r),G=f(a,M),W=f(M,a),Y=s[q],Z=s[q+1],X=c(a,u,b),J=c(M,A,I),Q=k+W|0,$=v+G+m(Q,k)|0;$=($=($=$+X+m(Q=Q+J|0,J)|0)+Y+m(Q=Q+Z|0,Z)|0)+j+m(Q=Q+U|0,U)|0;var ee=H+z|0,te=V+F+m(ee,H)|0;v=b,k=I,b=u,I=A,u=a,A=M,a=o+$+m(M=S+Q|0,S)|0,o=i,S=E,i=n,E=_,n=r,_=w,r=$+te+m(w=Q+ee|0,Q)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+M|0,this._fl=this._fl+A|0,this._gl=this._gl+I|0,this._hl=this._hl+k|0,this._ah=this._ah+r+m(this._al,w)|0,this._bh=this._bh+n+m(this._bl,_)|0,this._ch=this._ch+i+m(this._cl,E)|0,this._dh=this._dh+o+m(this._dl,S)|0,this._eh=this._eh+a+m(this._el,M)|0,this._fh=this._fh+u+m(this._fl,A)|0,this._gh=this._gh+b+m(this._gl,I)|0,this._hh=this._hh+v+m(this._hl,k)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},41064:(e,t,r)=>{e.exports=i;var n=r(47465).EventEmitter;function i(){n.call(this)}r(12534)(i,n),i.Readable=r(26978),i.Writable=r(51704),i.Duplex=r(48749),i.Transform=r(4784),i.PassThrough=r(95627),i.finished=r(45762),i.pipeline=r(34541),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"===typeof e.destroy&&e.destroy())}function c(e){if(h(),0===n.listenerCount(this,"error"))throw e}function h(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),e.removeListener("close",h)}return r.on("error",c),e.on("error",c),r.on("end",h),r.on("close",h),e.on("close",h),e.emit("pipe",r),e}},15948:(e,t,r)=>{"use strict";var n=r(14331).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!==typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=h,this.end=l,t=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function h(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\ufffd":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},14331:(e,t,r)=>{var n=r(19778),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},89515:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(n){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},84753:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DUMP_SESSION_KEYS=t.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG=t.NOISE_MSG_MAX_LENGTH_BYTES=void 0,t.NOISE_MSG_MAX_LENGTH_BYTES=65535,t.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG=t.NOISE_MSG_MAX_LENGTH_BYTES-16,t.DUMP_SESSION_KEYS={NODE_ENV:"production",PUBLIC_URL:"/js-waku",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.DUMP_SESSION_KEYS},20724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decryptStream=t.encryptStream=void 0;const n=r(29536),i=r(84753);t.encryptStream=function(e){return async function*(t){for await(const r of t){const t=n.Buffer.from(r.buffer,r.byteOffset,r.length);for(let r=0;r<t.length;r+=i.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG){let n=r+i.NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG;n>t.length&&(n=t.length);const o=e.encrypt(t.slice(r,n),e.session);yield o}}}},t.decryptStream=function(e){return async function*(t){for await(const r of t){const t=n.Buffer.from(r.buffer,r.byteOffset,r.length);for(let r=0;r<t.length;r+=i.NOISE_MSG_MAX_LENGTH_BYTES){let n=r+i.NOISE_MSG_MAX_LENGTH_BYTES;n>t.length&&(n=t.length);const o=t.slice(r,n),{plaintext:s,valid:a}=await e.decrypt(o,e.session);if(!a)throw new Error("Failed to validate decrypted chunk");yield s}}}}},13675:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode2=t.decode1=t.decode0=t.encode2=t.encode1=t.encode0=t.uint16BEDecode=t.uint16BEEncode=void 0;const n=r(29536);t.uint16BEEncode=(e,t,r)=>((t=t||n.Buffer.allocUnsafe(2)).writeUInt16BE(e,r),t),t.uint16BEEncode.bytes=2;t.uint16BEDecode=e=>{if(e.length<2)throw RangeError("Could not decode int16BE");return e.readUInt16BE(0)},t.uint16BEDecode.bytes=2,t.encode0=function(e){return n.Buffer.concat([e.ne,e.ciphertext])},t.encode1=function(e){return n.Buffer.concat([e.ne,e.ns,e.ciphertext])},t.encode2=function(e){return n.Buffer.concat([e.ns,e.ciphertext])},t.decode0=function(e){if(e.length<32)throw new Error("Cannot decode stage 0 MessageBuffer: length less than 32 bytes.");return{ne:e.slice(0,32),ciphertext:e.slice(32,e.length),ns:n.Buffer.alloc(0)}},t.decode1=function(e){if(e.length<80)throw new Error("Cannot decode stage 1 MessageBuffer: length less than 80 bytes.");return{ne:e.slice(0,32),ns:e.slice(32,80),ciphertext:e.slice(80,e.length)}},t.decode2=function(e){if(e.length<48)throw new Error("Cannot decode stage 2 MessageBuffer: length less than 48 bytes.");return{ne:n.Buffer.alloc(0),ns:e.slice(0,48),ciphertext:e.slice(48,e.length)}}},47006:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FailedIKError=void 0;class r extends Error{constructor(e,t){super(t),this.initialMsg=e,this.name="FailedIKhandshake"}}t.FailedIKError=r},63757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IKHandshake=void 0;const n=r(28820),i=r(29536),o=r(13675),s=r(43123),a=r(47006),u=r(31550);t.IKHandshake=class{constructor(e,t,r,o,s,a,u,c){this.isInitiator=e,this.payload=i.Buffer.from(t),this.prologue=r,this.staticKeypair=o,this.connection=s,u&&(this.remotePeer=u),this.ik=null!==c&&void 0!==c?c:new n.IK,this.session=this.ik.initSession(this.isInitiator,this.prologue,this.staticKeypair,a),this.remoteEarlyData=i.Buffer.alloc(0)}async stage0(){if(u.logLocalStaticKeys(this.session.hs.s),u.logRemoteStaticKey(this.session.hs.rs),this.isInitiator){u.logger("IK Stage 0 - Initiator sending message...");const e=this.ik.sendMessage(this.session,this.payload);this.connection.writeLP(o.encode1(e)),u.logger("IK Stage 0 - Initiator sent message."),u.logLocalEphemeralKeys(this.session.hs.e)}else{u.logger("IK Stage 0 - Responder receiving message...");const t=await this.connection.readLP();try{const e=o.decode1(t.slice()),{plaintext:r,valid:n}=this.ik.recvMessage(this.session,e);if(!n)throw new Error("ik handshake stage 0 decryption validation fail");u.logger("IK Stage 0 - Responder got message, going to verify payload.");const i=await s.decodePayload(r);this.remotePeer=this.remotePeer||await s.getPeerIdFromPayload(i),await s.verifySignedPayload(this.session.hs.rs,i,this.remotePeer),this.setRemoteEarlyData(i.data),u.logger("IK Stage 0 - Responder successfully verified payload!"),u.logRemoteEphemeralKey(this.session.hs.re)}catch(e){const r=e;throw u.logger("Responder breaking up with IK handshake in stage 0."),new a.FailedIKError(t,"Error occurred while verifying initiator's signed payload: ".concat(r.message))}}}async stage1(){if(this.isInitiator){u.logger("IK Stage 1 - Initiator receiving message...");const t=(await this.connection.readLP()).slice(),r=o.decode0(i.Buffer.from(t)),{plaintext:n,valid:c}=this.ik.recvMessage(this.session,r);u.logger("IK Stage 1 - Initiator got message, going to verify payload.");try{if(!c)throw new Error("ik stage 1 decryption validation fail");const e=await s.decodePayload(n);this.remotePeer=this.remotePeer||await s.getPeerIdFromPayload(e),await s.verifySignedPayload(r.ns.slice(0,32),e,this.remotePeer),this.setRemoteEarlyData(e.data),u.logger("IK Stage 1 - Initiator successfully verified payload!"),u.logRemoteEphemeralKey(this.session.hs.re)}catch(e){const r=e;throw u.logger("Initiator breaking up with IK handshake in stage 1."),new a.FailedIKError(t,"Error occurred while verifying responder's signed payload: ".concat(r.message))}}else{u.logger("IK Stage 1 - Responder sending message...");const e=this.ik.sendMessage(this.session,this.payload);this.connection.writeLP(o.encode0(e)),u.logger("IK Stage 1 - Responder sent message..."),u.logLocalEphemeralKeys(this.session.hs.e)}u.logCipherState(this.session)}decrypt(e,t){const r=this.getCS(t,!1);return this.ik.decryptWithAd(r,i.Buffer.alloc(0),e)}encrypt(e,t){const r=this.getCS(t);return this.ik.encryptWithAd(r,i.Buffer.alloc(0),e)}getLocalEphemeralKeys(){if(!this.session.hs.e)throw new Error("Ephemeral keys do not exist.");return this.session.hs.e}getCS(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e.cs1||!e.cs2)throw new Error("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?t?e.cs1:e.cs2:t?e.cs2:e.cs1}setRemoteEarlyData(e){e&&(this.remoteEarlyData=i.Buffer.from(e.buffer,e.byteOffset,e.length))}}},36127:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XXFallbackHandshake=void 0;const n=r(29536),i=r(11460),o=r(43123),s=r(31550),a=r(13675);class u extends i.XXHandshake{constructor(e,t,r,n,i,o,s,a,u){super(e,t,r,n,i,s,u),a&&(this.ephemeralKeys=a),this.initialMsg=o}async propose(){if(this.isInitiator)this.xx.sendMessage(this.session,n.Buffer.alloc(0),this.ephemeralKeys),s.logger("XX Fallback Stage 0 - Initialized state as the first message was sent by initiator."),s.logLocalEphemeralKeys(this.session.hs.e);else{s.logger("XX Fallback Stage 0 - Responder decoding initial msg from IK.");const e=a.decode0(this.initialMsg),{valid:t}=this.xx.recvMessage(this.session,{ne:e.ne,ns:n.Buffer.alloc(0),ciphertext:n.Buffer.alloc(0)});if(!t)throw new Error("xx fallback stage 0 decryption validation fail");s.logger("XX Fallback Stage 0 - Responder used received message from IK."),s.logRemoteEphemeralKey(this.session.hs.re)}}async exchange(){if(this.isInitiator){const t=a.decode1(this.initialMsg),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,t);if(!n)throw new Error("xx fallback stage 1 decryption validation fail");s.logger("XX Fallback Stage 1 - Initiator used received message from IK."),s.logRemoteEphemeralKey(this.session.hs.re),s.logRemoteStaticKey(this.session.hs.rs),s.logger("Initiator going to check remote's signature...");try{const e=await o.decodePayload(r);this.remotePeer=this.remotePeer||await o.getPeerIdFromPayload(e),await o.verifySignedPayload(this.session.hs.rs,e,this.remotePeer),this.setRemoteEarlyData(e.data)}catch(e){throw new Error("Error occurred while verifying signed payload from responder: ".concat(e.message))}s.logger("All good with the signature!")}else s.logger("XX Fallback Stage 1 - Responder start"),await super.exchange(),s.logger("XX Fallback Stage 1 - Responder end")}}t.XXFallbackHandshake=u},11460:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XXHandshake=void 0;const n=r(29536),i=r(59997),o=r(43123),s=r(31550),a=r(13675);t.XXHandshake=class{constructor(e,t,r,o,s,a,u){this.isInitiator=e,this.payload=t,this.prologue=r,this.staticKeypair=o,this.connection=s,a&&(this.remotePeer=a),this.xx=null!==u&&void 0!==u?u:new i.XX,this.session=this.xx.initSession(this.isInitiator,this.prologue,this.staticKeypair),this.remoteEarlyData=n.Buffer.alloc(0)}async propose(){if(s.logLocalStaticKeys(this.session.hs.s),this.isInitiator){s.logger("Stage 0 - Initiator starting to send first message.");const e=this.xx.sendMessage(this.session,n.Buffer.alloc(0));this.connection.writeLP(a.encode0(e)),s.logger("Stage 0 - Initiator finished sending first message."),s.logLocalEphemeralKeys(this.session.hs.e)}else{s.logger("Stage 0 - Responder waiting to receive first message...");const e=a.decode0((await this.connection.readLP()).slice()),{valid:t}=this.xx.recvMessage(this.session,e);if(!t)throw new Error("xx handshake stage 0 validation fail");s.logger("Stage 0 - Responder received first message."),s.logRemoteEphemeralKey(this.session.hs.re)}}async exchange(){if(this.isInitiator){s.logger("Stage 1 - Initiator waiting to receive first message from responder...");const t=a.decode1((await this.connection.readLP()).slice()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,t);if(!n)throw new Error("xx handshake stage 1 validation fail");s.logger("Stage 1 - Initiator received the message."),s.logRemoteEphemeralKey(this.session.hs.re),s.logRemoteStaticKey(this.session.hs.rs),s.logger("Initiator going to check remote's signature...");try{const e=await o.decodePayload(r);this.remotePeer=this.remotePeer||await o.getPeerIdFromPayload(e),this.remotePeer=await o.verifySignedPayload(t.ns,e,this.remotePeer),this.setRemoteEarlyData(e.data)}catch(e){throw new Error("Error occurred while verifying signed payload: ".concat(e.message))}s.logger("All good with the signature!")}else{s.logger("Stage 1 - Responder sending out first message with signed payload and static key.");const e=this.xx.sendMessage(this.session,this.payload);this.connection.writeLP(a.encode1(e)),s.logger("Stage 1 - Responder sent the second handshake message with signed payload."),s.logLocalEphemeralKeys(this.session.hs.e)}}async finish(){if(this.isInitiator){s.logger("Stage 2 - Initiator sending third handshake message.");const e=this.xx.sendMessage(this.session,this.payload);this.connection.writeLP(a.encode2(e)),s.logger("Stage 2 - Initiator sent message with signed payload.")}else{s.logger("Stage 2 - Responder waiting for third handshake message...");const t=a.decode2((await this.connection.readLP()).slice()),{plaintext:r,valid:n}=this.xx.recvMessage(this.session,t);if(!n)throw new Error("xx handshake stage 2 validation fail");s.logger("Stage 2 - Responder received the message, finished handshake.");try{const e=await o.decodePayload(r);this.remotePeer=this.remotePeer||await o.getPeerIdFromPayload(e),await o.verifySignedPayload(this.session.hs.rs,e,this.remotePeer),this.setRemoteEarlyData(e.data)}catch(e){throw new Error("Error occurred while verifying signed payload: ".concat(e.message))}}s.logCipherState(this.session)}encrypt(e,t){const r=this.getCS(t);return this.xx.encryptWithAd(r,n.Buffer.alloc(0),e)}decrypt(e,t){const r=this.getCS(t,!1);return this.xx.decryptWithAd(r,n.Buffer.alloc(0),e)}getRemoteStaticKey(){return this.session.hs.rs}getCS(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e.cs1||!e.cs2)throw new Error("Handshake not completed properly, cipher state does not exist.");return this.isInitiator?t?e.cs1:e.cs2:t?e.cs2:e.cs1}setRemoteEarlyData(e){e&&(this.remoteEarlyData=n.Buffer.from(e.buffer,e.byteOffset,e.length))}}},87766:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractHandshake=t.MIN_NONCE=void 0;const s=r(29536),a=o(r(63059)),u=o(r(51558)),c=r(64776),h=r(43123),l=r(31550);t.MIN_NONCE=0;t.AbstractHandshake=class{encryptWithAd(e,t,r){const n=this.encrypt(e.k,e.n,t,r);return this.setNonce(e,this.incrementNonce(e.n)),n}decryptWithAd(e,t,r){const{plaintext:n,valid:i}=this.decrypt(e.k,e.n,t,r);return this.setNonce(e,this.incrementNonce(e.n)),{plaintext:n,valid:i}}hasKey(e){return!this.isEmptyKey(e.k)}setNonce(e,t){e.n=t}createEmptyKey(){return s.Buffer.alloc(32)}isEmptyKey(e){return this.createEmptyKey().equals(e)}incrementNonce(e){return e+1}nonceToBytes(e){const t=s.Buffer.alloc(12);return t.writeUInt32LE(e,4),t}encrypt(e,t,r,n){const i=this.nonceToBytes(t),o=new c.ChaCha20Poly1305(e).seal(i,n,r);return s.Buffer.from(o.buffer,o.byteOffset,o.length)}encryptAndHash(e,t){let r;return r=this.hasKey(e.cs)?this.encryptWithAd(e.cs,e.h,t):t,this.mixHash(e,r),r}decrypt(e,t,r,n){const i=this.nonceToBytes(t),o=new c.ChaCha20Poly1305(e).open(i,n,r);return o?{plaintext:s.Buffer.from(o.buffer,o.byteOffset,o.length),valid:!0}:{plaintext:s.Buffer.from(""),valid:!1}}decryptAndHash(e,t){let r,n=!0;return this.hasKey(e.cs)?({plaintext:r,valid:n}=this.decryptWithAd(e.cs,e.h,t)):r=t,this.mixHash(e,t),{plaintext:r,valid:n}}dh(e,t){try{const r=a.sharedKey(e,t),n=s.Buffer.from(r.buffer,r.byteOffset,r.length),i=s.Buffer.alloc(32);return n.copy(i),i}catch(r){return l.logger(r.message),s.Buffer.alloc(32)}}mixHash(e,t){e.h=this.getHash(e.h,t)}getHash(e,t){const r=u.hash(s.Buffer.from([...e,...t]));return s.Buffer.from(r.buffer,r.byteOffset,r.length)}mixKey(e,t){const[r,n]=h.getHkdf(e.ck,t);e.cs=this.initializeKey(n),e.ck=r}initializeKey(e){return{k:e,n:t.MIN_NONCE}}initializeSymmetric(e){const t=s.Buffer.from(e,"utf-8"),r=this.hashProtocolName(t),n=r,i=this.createEmptyKey();return{cs:this.initializeKey(i),ck:n,h:r}}hashProtocolName(e){if(e.length<=32){const t=s.Buffer.alloc(32);return e.copy(t),t}return this.getHash(e,s.Buffer.alloc(0))}split(e){const[t,r]=h.getHkdf(e.ck,s.Buffer.alloc(0));return{cs1:this.initializeKey(t),cs2:this.initializeKey(r)}}writeMessageRegular(e,t){const r=this.encryptWithAd(e,s.Buffer.alloc(0),t);return{ne:this.createEmptyKey(),ns:s.Buffer.alloc(0),ciphertext:r}}readMessageRegular(e,t){return this.decryptWithAd(e,s.Buffer.alloc(0),t.ciphertext)}}},28820:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IK=void 0;const n=r(29536),i=r(43123),o=r(87766);class s extends o.AbstractHandshake{initSession(e,t,r,n){const i=this.createEmptyKey();let o;return o=e?this.initializeInitiator(t,r,n,i):this.initializeResponder(t,r,n,i),{hs:o,i:e,mc:0}}sendMessage(e,t){let r;if(0===e.mc)r=this.writeMessageA(e.hs,t);else if(1===e.mc){const{messageBuffer:n,h:i,cs1:o,cs2:s}=this.writeMessageB(e.hs,t);r=n,e.h=i,e.cs1=o,e.cs2=s}else{if(!(e.mc>1))throw new Error("Session invalid.");if(e.i){if(!e.cs1)throw new Error("CS1 (cipher state) is not defined");r=this.writeMessageRegular(e.cs1,t)}else{if(!e.cs2)throw new Error("CS2 (cipher state) is not defined");r=this.writeMessageRegular(e.cs2,t)}}return e.mc++,r}recvMessage(e,t){let r=n.Buffer.alloc(0),i=!1;if(0===e.mc&&({plaintext:r,valid:i}=this.readMessageA(e.hs,t)),1===e.mc){const{plaintext:n,valid:o,h:s,cs1:a,cs2:u}=this.readMessageB(e.hs,t);r=n,i=o,e.h=s,e.cs1=a,e.cs2=u}return e.mc++,{plaintext:r,valid:i}}writeMessageA(e,t){e.e=i.generateKeypair();const r=e.e.publicKey;this.mixHash(e.ss,r),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));const o=n.Buffer.from(e.s.publicKey),s=this.encryptAndHash(e.ss,o);this.mixKey(e.ss,this.dh(e.s.privateKey,e.rs));return{ne:r,ns:s,ciphertext:this.encryptAndHash(e.ss,t)}}writeMessageB(e,t){e.e=i.generateKeypair();const r=e.e.publicKey;this.mixHash(e.ss,r),this.mixKey(e.ss,this.dh(e.e.privateKey,e.re)),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));const n=this.encryptAndHash(e.ss,t),o={ne:r,ns:this.createEmptyKey(),ciphertext:n},{cs1:s,cs2:a}=this.split(e.ss);return{messageBuffer:o,cs1:s,cs2:a,h:e.ss.h}}readMessageA(e,t){i.isValidPublicKey(t.ne)&&(e.re=t.ne),this.mixHash(e.ss,e.re),this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));const{plaintext:r,valid:n}=this.decryptAndHash(e.ss,t.ns);n&&32===r.length&&i.isValidPublicKey(r)&&(e.rs=r),this.mixKey(e.ss,this.dh(e.s.privateKey,e.rs));const{plaintext:o,valid:s}=this.decryptAndHash(e.ss,t.ciphertext);return{plaintext:o,valid:n&&s}}readMessageB(e,t){if(i.isValidPublicKey(t.ne)&&(e.re=t.ne),this.mixHash(e.ss,e.re),!e.e)throw new Error("Handshake state should contain ephemeral key by now.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.re)),this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));const{plaintext:r,valid:n}=this.decryptAndHash(e.ss,t.ciphertext),{cs1:o,cs2:s}=this.split(e.ss);return{h:e.ss.h,valid:n,plaintext:r,cs1:o,cs2:s}}initializeInitiator(e,t,r,i){const o=this.initializeSymmetric("Noise_IK_25519_ChaChaPoly_SHA256");this.mixHash(o,e),this.mixHash(o,r);return{ss:o,s:t,rs:r,re:n.Buffer.alloc(32),psk:i}}initializeResponder(e,t,r,i){const o=this.initializeSymmetric("Noise_IK_25519_ChaChaPoly_SHA256");this.mixHash(o,e),this.mixHash(o,t.publicKey);return{ss:o,s:t,rs:r,re:n.Buffer.alloc(32),psk:i}}}t.IK=s},59997:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XX=void 0;const n=r(29536),i=r(43123),o=r(87766);class s extends o.AbstractHandshake{initializeInitiator(e,t,r,i){const o=this.initializeSymmetric("Noise_XX_25519_ChaChaPoly_SHA256");this.mixHash(o,e);return{ss:o,s:t,rs:r,psk:i,re:n.Buffer.alloc(32)}}initializeResponder(e,t,r,i){const o=this.initializeSymmetric("Noise_XX_25519_ChaChaPoly_SHA256");this.mixHash(o,e);return{ss:o,s:t,rs:r,psk:i,re:n.Buffer.alloc(32)}}writeMessageA(e,t,r){const o=n.Buffer.alloc(0);e.e=void 0!==r?r:i.generateKeypair();const s=e.e.publicKey;this.mixHash(e.ss,s);return{ne:s,ns:o,ciphertext:this.encryptAndHash(e.ss,t)}}writeMessageB(e,t){e.e=i.generateKeypair();const r=e.e.publicKey;this.mixHash(e.ss,r),this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));const o=n.Buffer.from(e.s.publicKey),s=this.encryptAndHash(e.ss,o);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));return{ne:r,ns:s,ciphertext:this.encryptAndHash(e.ss,t)}}writeMessageC(e,t){const r=n.Buffer.from(e.s.publicKey),i=this.encryptAndHash(e.ss,r);this.mixKey(e.ss,this.dh(e.s.privateKey,e.re));const o=this.encryptAndHash(e.ss,t),s={ne:this.createEmptyKey(),ns:i,ciphertext:o},{cs1:a,cs2:u}=this.split(e.ss);return{h:e.ss.h,messageBuffer:s,cs1:a,cs2:u}}readMessageA(e,t){return i.isValidPublicKey(t.ne)&&(e.re=t.ne),this.mixHash(e.ss,e.re),this.decryptAndHash(e.ss,t.ciphertext)}readMessageB(e,t){if(i.isValidPublicKey(t.ne)&&(e.re=t.ne),this.mixHash(e.ss,e.re),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.re));const{plaintext:r,valid:n}=this.decryptAndHash(e.ss,t.ns);n&&32===r.length&&i.isValidPublicKey(r)&&(e.rs=r),this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));const{plaintext:o,valid:s}=this.decryptAndHash(e.ss,t.ciphertext);return{plaintext:o,valid:n&&s}}readMessageC(e,t){const{plaintext:r,valid:n}=this.decryptAndHash(e.ss,t.ns);if(n&&32===r.length&&i.isValidPublicKey(r)&&(e.rs=r),!e.e)throw new Error("Handshake state `e` param is missing.");this.mixKey(e.ss,this.dh(e.e.privateKey,e.rs));const{plaintext:o,valid:s}=this.decryptAndHash(e.ss,t.ciphertext),{cs1:a,cs2:u}=this.split(e.ss);return{h:e.ss.h,plaintext:o,valid:n&&s,cs1:a,cs2:u}}initSession(e,t,r){const i=this.createEmptyKey(),o=n.Buffer.alloc(32);let s;return s=e?this.initializeInitiator(t,r,o,i):this.initializeResponder(t,r,o,i),{hs:s,i:e,mc:0}}sendMessage(e,t,r){let n;if(0===e.mc)n=this.writeMessageA(e.hs,t,r);else if(1===e.mc)n=this.writeMessageB(e.hs,t);else if(2===e.mc){const{h:r,messageBuffer:i,cs1:o,cs2:s}=this.writeMessageC(e.hs,t);n=i,e.h=r,e.cs1=o,e.cs2=s}else{if(!(e.mc>2))throw new Error("Session invalid.");if(e.i){if(!e.cs1)throw new Error("CS1 (cipher state) is not defined");n=this.writeMessageRegular(e.cs1,t)}else{if(!e.cs2)throw new Error("CS2 (cipher state) is not defined");n=this.writeMessageRegular(e.cs2,t)}}return e.mc++,n}recvMessage(e,t){let r=n.Buffer.alloc(0),i=!1;if(0===e.mc)({plaintext:r,valid:i}=this.readMessageA(e.hs,t));else if(1===e.mc)({plaintext:r,valid:i}=this.readMessageB(e.hs,t));else if(2===e.mc){const{h:n,plaintext:o,valid:s,cs1:a,cs2:u}=this.readMessageC(e.hs,t);r=o,i=s,e.h=n,e.cs1=a,e.cs2=u}return e.mc++,{plaintext:r,valid:i}}}t.XX=s},23952:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyCache=void 0;const r=new class{constructor(){this.storage=new Map}store(e,t){this.storage.set(e.id,t)}load(e){var t;return e&&null!==(t=this.storage.get(e.id))&&void 0!==t?t:null}resetStorage(){this.storage.clear()}};t.KeyCache=r},31550:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.logCipherState=t.logRemoteEphemeralKey=t.logRemoteStaticKey=t.logLocalEphemeralKeys=t.logLocalStaticKeys=t.logger=void 0;const i=n(r(39287)),o=r(84753);let s;t.logger=i.default("libp2p:noise"),s=o.DUMP_SESSION_KEYS?t.logger:()=>{},t.logLocalStaticKeys=function(e){s("LOCAL_STATIC_PUBLIC_KEY ".concat(e.publicKey.toString("hex"))),s("LOCAL_STATIC_PRIVATE_KEY ".concat(e.privateKey.toString("hex")))},t.logLocalEphemeralKeys=function(e){e?(s("LOCAL_PUBLIC_EPHEMERAL_KEY ".concat(e.publicKey.toString("hex"))),s("LOCAL_PRIVATE_EPHEMERAL_KEY ".concat(e.privateKey.toString("hex")))):s("Missing local ephemeral keys.")},t.logRemoteStaticKey=function(e){s("REMOTE_STATIC_PUBLIC_KEY ".concat(e.toString("hex")))},t.logRemoteEphemeralKey=function(e){s("REMOTE_EPHEMERAL_PUBLIC_KEY ".concat(e.toString("hex")))},t.logCipherState=function(e){e.cs1&&e.cs2?(s("CIPHER_STATE_1 ".concat(e.cs1.n," ").concat(e.cs1.k.toString("hex"))),s("CIPHER_STATE_2 ".concat(e.cs2.n," ").concat(e.cs2.k.toString("hex")))):s("Missing cipher state.")}},72913:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Noise=void 0;const a=o(r(63059)),u=r(29536),c=s(r(54146)),h=s(r(91764)),l=s(r(46881)),f=s(r(91522)),d=r(4666),p=r(11460),y=r(63757),g=r(36127),m=r(43123),b=r(13675),v=r(20724),w=r(23952),_=r(31550),E=r(84753);t.Noise=class{constructor(e,t){if(this.protocol="/noise",this.prologue=u.Buffer.alloc(0),this.earlyData=null!==t&&void 0!==t?t:u.Buffer.alloc(0),this.useNoisePipes=!1,e){const t=a.generateKeyPairFromSeed(e);this.staticKeys={privateKey:u.Buffer.from(t.secretKey.buffer,t.secretKey.byteOffset,t.secretKey.length),publicKey:u.Buffer.from(t.publicKey.buffer,t.publicKey.byteOffset,t.publicKey.length)}}else this.staticKeys=m.generateKeypair()}async secureOutbound(e,t,r){const n=c.default(t,{lengthEncoder:b.uint16BEEncode,lengthDecoder:b.uint16BEDecode,maxDataLength:E.NOISE_MSG_MAX_LENGTH_BYTES}),i=await this.performHandshake({connection:n,isInitiator:!0,localPeer:e,remotePeer:r});return{conn:await this.createSecureConnection(n,i),remoteEarlyData:i.remoteEarlyData,remotePeer:i.remotePeer}}async secureInbound(e,t,r){const n=c.default(t,{lengthEncoder:b.uint16BEEncode,lengthDecoder:b.uint16BEDecode,maxDataLength:E.NOISE_MSG_MAX_LENGTH_BYTES}),i=await this.performHandshake({connection:n,isInitiator:!1,localPeer:e,remotePeer:r});return{conn:await this.createSecureConnection(n,i),remoteEarlyData:i.remoteEarlyData,remotePeer:i.remotePeer}}async performHandshake(e){var t;const r=await m.getPayload(e.localPeer,this.staticKeys.publicKey,this.earlyData);let n=this.useNoisePipes;if(e.isInitiator&&null===w.KeyCache.load(e.remotePeer)&&(n=!1),!n)return await this.performXXHandshake(e,r);{const{remotePeer:n,connection:o,isInitiator:s}=e,a=new y.IKHandshake(s,r,this.prologue,this.staticKeys,o,null!==(t=w.KeyCache.load(e.remotePeer))&&void 0!==t?t:u.Buffer.alloc(32),n);try{return await this.performIKHandshake(a)}catch(i){let t;return e.isInitiator&&(t=a.getLocalEphemeralKeys()),await this.performXXFallbackHandshake(e,r,i.initialMsg,t)}}}async performXXFallbackHandshake(e,t,r,n){const{isInitiator:i,remotePeer:o,connection:s}=e,a=new g.XXFallbackHandshake(i,t,this.prologue,this.staticKeys,s,r,o,n);try{await a.propose(),await a.exchange(),await a.finish()}catch(u){_.logger(u);throw new Error("Error occurred during XX Fallback handshake: ".concat(u.message))}return a}async performXXHandshake(e,t){const{isInitiator:r,remotePeer:n,connection:i}=e,o=new p.XXHandshake(r,t,this.prologue,this.staticKeys,i,n);try{await o.propose(),await o.exchange(),await o.finish(),this.useNoisePipes&&o.remotePeer&&w.KeyCache.store(o.remotePeer,o.getRemoteStaticKey())}catch(s){throw new Error("Error occurred during XX handshake: ".concat(s.message))}return o}async performIKHandshake(e){return await e.stage0(),await e.stage1(),e}async createSecureConnection(e,t){const[r,n]=h.default(),i=e.unwrap();return await f.default(r,l.default,v.encryptStream(t),d.encode({lengthEncoder:b.uint16BEEncode}),i,d.decode({lengthDecoder:b.uint16BEDecode}),l.default,v.decryptStream(t),r),n}}},50952:function(e,t,r){"use strict";var n,i,o;i=[r(6018)],void 0===(o="function"===typeof(n=function(e){var t=e.Reader,r=e.Writer,n=e.util,i=e.roots["libp2p-noise"]||(e.roots["libp2p-noise"]={});return i.pb=function(){var o={};return o.NoiseHandshakePayload=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return o.prototype.identityKey=n.newBuffer([]),o.prototype.identitySig=n.newBuffer([]),o.prototype.data=n.newBuffer([]),o.create=function(e){return new o(e)},o.encode=function(e,t){return t||(t=r.create()),null!=e.identityKey&&Object.hasOwnProperty.call(e,"identityKey")&&t.uint32(10).bytes(e.identityKey),null!=e.identitySig&&Object.hasOwnProperty.call(e,"identitySig")&&t.uint32(18).bytes(e.identitySig),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(26).bytes(e.data),t},o.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var n=void 0===r?e.len:e.pos+r,o=new i.pb.NoiseHandshakePayload;e.pos<n;){var s=e.uint32();switch(s>>>3){case 1:o.identityKey=e.bytes();break;case 2:o.identitySig=e.bytes();break;case 3:o.data=e.bytes();break;default:e.skipType(7&s)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=new t(e)),this.decode(e,e.uint32())},o.verify=function(e){return"object"!==typeof e||null===e?"object expected":null!=e.identityKey&&e.hasOwnProperty("identityKey")&&!(e.identityKey&&"number"===typeof e.identityKey.length||n.isString(e.identityKey))?"identityKey: buffer expected":null!=e.identitySig&&e.hasOwnProperty("identitySig")&&!(e.identitySig&&"number"===typeof e.identitySig.length||n.isString(e.identitySig))?"identitySig: buffer expected":null!=e.data&&e.hasOwnProperty("data")&&!(e.data&&"number"===typeof e.data.length||n.isString(e.data))?"data: buffer expected":null},o.fromObject=function(e){if(e instanceof i.pb.NoiseHandshakePayload)return e;var t=new i.pb.NoiseHandshakePayload;return null!=e.identityKey&&("string"===typeof e.identityKey?n.base64.decode(e.identityKey,t.identityKey=n.newBuffer(n.base64.length(e.identityKey)),0):e.identityKey.length&&(t.identityKey=e.identityKey)),null!=e.identitySig&&("string"===typeof e.identitySig?n.base64.decode(e.identitySig,t.identitySig=n.newBuffer(n.base64.length(e.identitySig)),0):e.identitySig.length&&(t.identitySig=e.identitySig)),null!=e.data&&("string"===typeof e.data?n.base64.decode(e.data,t.data=n.newBuffer(n.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),t},o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.identityKey="":(r.identityKey=[],t.bytes!==Array&&(r.identityKey=n.newBuffer(r.identityKey))),t.bytes===String?r.identitySig="":(r.identitySig=[],t.bytes!==Array&&(r.identitySig=n.newBuffer(r.identitySig))),t.bytes===String?r.data="":(r.data=[],t.bytes!==Array&&(r.data=n.newBuffer(r.data)))),null!=e.identityKey&&e.hasOwnProperty("identityKey")&&(r.identityKey=t.bytes===String?n.base64.encode(e.identityKey,0,e.identityKey.length):t.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey),null!=e.identitySig&&e.hasOwnProperty("identitySig")&&(r.identitySig=t.bytes===String?n.base64.encode(e.identitySig,0,e.identitySig.length):t.bytes===Array?Array.prototype.slice.call(e.identitySig):e.identitySig),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?n.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o}(),i})?n.apply(t,i):n)||(e.exports=o)},43123:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isValidPublicKey=t.getHkdf=t.verifySignedPayload=t.getHandshakePayload=t.decodePayload=t.getPeerIdFromPayload=t.signPayload=t.createHandshakePayload=t.getPayload=t.generateKeypair=void 0;const a=r(48455),u=r(51558),c=o(r(63059)),h=r(29536),l=s(r(40213)),f=r(50952),d=r(26874),p=f.pb.NoiseHandshakePayload;function y(e,t,r){const n=p.create({identityKey:h.Buffer.from(e),identitySig:t,data:null!==r&&void 0!==r?r:null});return h.Buffer.from(p.encode(n).finish())}async function g(e,t){return h.Buffer.from(await e.privKey.sign(t))}function m(e){return h.Buffer.concat([h.Buffer.from("noise-libp2p-static-key:"),e])}t.generateKeypair=function(){const e=c.generateKeyPair();return{publicKey:h.Buffer.from(e.publicKey.buffer,e.publicKey.byteOffset,e.publicKey.length),privateKey:h.Buffer.from(e.secretKey.buffer,e.secretKey.byteOffset,e.secretKey.length)}},t.getPayload=async function(e,t,r){const n=await g(e,m(t)),i=null!==r&&void 0!==r?r:h.Buffer.alloc(0);return y(e.marshalPubKey(),n,i)},t.createHandshakePayload=y,t.signPayload=g,t.getPeerIdFromPayload=async function(e){return await l.default.createFromPubKey(h.Buffer.from(e.identityKey))},t.decodePayload=function(e){return p.toObject(p.decode(h.Buffer.from(e)))},t.getHandshakePayload=m,t.verifySignedPayload=async function(e,t,r){const n=h.Buffer.from(t.identityKey);if(!await async function(e,t){const r=await l.default.createFromPubKey(t);return d.equals(r.id,e)}(r.id,n))throw new Error("Peer ID doesn't match libp2p public key.");const i=m(e),o=await l.default.createFromPubKey(n);if(!t.identitySig||!o.pubKey.verify(i,h.Buffer.from(t.identitySig)))throw new Error("Static key doesn't match to peer that signed payload!");return o},t.getHkdf=function(e,t){const r=new a.HKDF(u.SHA256,t,e).expand(96),n=h.Buffer.from(r.buffer,r.byteOffset,r.length);return[n.slice(0,32),n.slice(32,64),n.slice(64,96)]},t.isValidPublicKey=function(e){return!!h.Buffer.isBuffer(e)&&32===e.length}},33780:(e,t,r)=>{"use strict";const{concat:n}=r(45938),{fromString:i}=r(75528),o=r(85037);e.exports={create:function(){let{algorithm:e="AES-GCM",nonceLength:t=12,keyLength:r=16,digest:s="SHA-256",saltLength:a=16,iterations:u=32767}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=o.get();async function h(o,h){const l=c.getRandomValues(new Uint8Array(a)),f=c.getRandomValues(new Uint8Array(t)),d={name:e,iv:f},p={name:"PBKDF2",salt:l,iterations:u,hash:{name:s}},y=await c.subtle.importKey("raw",i(h),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),g=await c.subtle.deriveKey(p,y,{name:e,length:r},!0,["encrypt"]),m=await c.subtle.encrypt(d,g,o);return n([l,d.iv,new Uint8Array(m)])}async function l(n,o){const h=n.slice(0,a),l=n.slice(a,a+t),f=n.slice(a+t),d={name:e,iv:l},p={name:"PBKDF2",salt:h,iterations:u,hash:{name:s}},y=await c.subtle.importKey("raw",i(o),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),g=await c.subtle.deriveKey(p,y,{name:e,length:r},!0,["decrypt"]),m=await c.subtle.decrypt(d,g,f);return new Uint8Array(m)}return r*=8,{encrypt:h,decrypt:l}}}},47688:(e,t,r)=>{"use strict";const n=r(85037),i=r(69264),o={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"};t.create=async function(e,t){const r=o[e],s=await n.get().subtle.importKey("raw",t,{name:"HMAC",hash:{name:r}},!1,["sign"]);return{digest:async e=>(async(e,t)=>{const r=await n.get().subtle.sign({name:"HMAC"},e,t);return new Uint8Array(r,r.byteOffset,r.byteLength)})(s,e),length:i[e]}}},69264:e=>{"use strict";e.exports={SHA1:20,SHA256:32,SHA512:64}},2252:(e,t,r)=>{"use strict";const n=r(61446),i=r(85037),{base64urlToBuffer:o}=r(76517),s=r(33760),{toString:a}=r(6398),{concat:u}=r(45938),{equals:c}=r(26874),h={"P-256":256,"P-384":384,"P-521":521};t.generateEphmeralKeyPair=async function(e){s(Object.keys(h),e);const t=await i.get().subtle.generateKey({name:"ECDH",namedCurve:e},!0,["deriveBits"]);return{key:f(await i.get().subtle.exportKey("jwk",t.publicKey)),genSharedKey:async(r,n)=>{let o;o=n?await i.get().subtle.importKey("jwk",p(e,n),{name:"ECDH",namedCurve:e},!1,["deriveBits"]):t.privateKey;const s=[await i.get().subtle.importKey("jwk",d(e,r),{name:"ECDH",namedCurve:e},!1,[]),o],a=await i.get().subtle.deriveBits({name:"ECDH",namedCurve:e,public:s[0]},s[1],h[e]);return new Uint8Array(a,a.byteOffset,a.byteLength)}}};const l={"P-256":32,"P-384":48,"P-521":66};function f(e){const t=l[e.crv];return u([Uint8Array.from([4]),o(e.x,t),o(e.y,t)],1+2*t)}function d(e,t){const r=l[e];if(c(!t.slice(0,1),Uint8Array.from([4])))throw n(new Error("Cannot unmarshal public key - invalid key format"),"ERR_INVALID_KEY_FORMAT");return{kty:"EC",crv:e,x:a(t.slice(1,r+1),"base64url"),y:a(t.slice(1+r),"base64url"),ext:!0}}const p=(e,t)=>({...d(e,t.public),d:a(t.private,"base64url")})},81427:(e,t,r)=>{"use strict";const n=r(61446),{equals:i}=r(26874),{sha256:o}=r(27678),{base58btc:s}=r(59376),{identity:a}=r(4991),u=r(13232),c=r(97143),h=r(14620);class l{constructor(e){this._key=d(e,u.publicKeyLength)}async verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return this._key}get bytes(){return c.PublicKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(e){return i(this.bytes,e.bytes)}async hash(){const{bytes:e}=await o.digest(this.bytes);return e}}class f{constructor(e,t){this._key=d(e,u.privateKeyLength),this._publicKey=d(t,u.publicKeyLength)}async sign(e){return u.hashAndSign(this._key,e)}get public(){return new l(this._publicKey)}marshal(){return this._key}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(e){return i(this.bytes,e.bytes)}async hash(){const{bytes:e}=await o.digest(this.bytes);return e}async id(){const e=await a.digest(this.public.bytes);return s.encode(e.bytes).substring(1)}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"libp2p-key";if("libp2p-key"===t)return h.export(this.bytes,e);throw n(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}function d(e,t){if((e=Uint8Array.from(e||[])).length!==t)throw n(new Error("Key must be a Uint8Array of length ".concat(t,", got ").concat(e.length)),"ERR_INVALID_KEY_TYPE");return e}e.exports={Ed25519PublicKey:l,Ed25519PrivateKey:f,unmarshalEd25519PrivateKey:function(e){if(e.length>u.privateKeyLength){const t=(e=d(e,u.privateKeyLength+u.publicKeyLength)).slice(0,u.privateKeyLength),r=e.slice(u.privateKeyLength,e.length);return new f(t,r)}const t=(e=d(e,u.privateKeyLength)).slice(0,u.privateKeyLength),r=e.slice(u.publicKeyLength);return new f(t,r)},unmarshalEd25519PublicKey:function(e){return e=d(e,u.publicKeyLength),new l(e)},generateKeyPair:async function(){const{privateKey:e,publicKey:t}=await u.generateKey();return new f(e,t)},generateKeyPairFromSeed:async function(e){const{privateKey:t,publicKey:r}=await u.generateKeyFromSeed(e);return new f(t,r)}}},13232:(e,t,r)=>{"use strict";const n=r(12877);function i(e,r){const n=new Uint8Array(t.privateKeyLength);for(let t=0;t<32;t++)n[t]=e[t],n[32+t]=r[t];return n}t.publicKeyLength=32,t.privateKeyLength=64,t.generateKey=async function(){const e=n.utils.randomPrivateKey(),t=await n.getPublicKey(e);return{privateKey:i(e,t),publicKey:t}},t.generateKeyFromSeed=async function(e){if(32!==e.length)throw new TypeError('"seed" must be 32 bytes in length.');if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');const t=e,r=await n.getPublicKey(t);return{privateKey:i(t,r),publicKey:r}},t.hashAndSign=function(e,t){const r=e.slice(0,32);return n.sign(t,r)},t.hashAndVerify=function(e,t,r){return n.verify(t,r,e)}},14819:(e,t,r)=>{"use strict";const n=r(2252);e.exports=async e=>n.generateEphmeralKeyPair(e)},14620:(e,t,r)=>{"use strict";const{base64:n}=r(86443),i=r(33780);e.exports={export:async function(e,t){const r=i.create(),o=await r.encrypt(e,t);return n.encode(o)}}},6424:(e,t,r)=>{"use strict";const{base64:n}=r(86443),i=r(33780);e.exports={import:async function(e,t){const r=n.decode(e),o=i.create();return await o.decrypt(r,t)}}},67390:(e,t,r)=>{"use strict";const n=r(97143);r(93758),r(79850);const i=r(5525),o=r(61446),{fromString:s}=r(75528),a=r(6424),u={rsa:r(6783),ed25519:r(81427),secp256k1:r(41267)(n,r(99737))},c="secp256k1 support requires libp2p-crypto-secp256k1 package",h="ERR_MISSING_PACKAGE";function l(e){const t=u[e.toLowerCase()];if(!t){const t=Object.keys(u).join(" / ");throw o(new Error("invalid or unsupported key type ".concat(e,". Must be ").concat(t)),"ERR_UNSUPPORTED_KEY_TYPE")}return t}const f=async e=>{const t=n.PrivateKey.decode(e),r=t.Data;switch(t.Type){case n.KeyType.RSA:return u.rsa.unmarshalRsaPrivateKey(r);case n.KeyType.Ed25519:return u.ed25519.unmarshalEd25519PrivateKey(r);case n.KeyType.Secp256k1:if(u.secp256k1)return u.secp256k1.unmarshalSecp256k1PrivateKey(r);throw o(new Error(c),h);default:l(t.Type)}};e.exports={supportedKeys:u,keysPBM:n,keyStretcher:r(3821),generateEphemeralKeyPair:r(14819),generateKeyPair:async(e,t)=>l(e).generateKeyPair(t),generateKeyPairFromSeed:async(e,t,r)=>{const n=l(e);if("ed25519"!==e.toLowerCase())throw o(new Error("Seed key derivation is unimplemented for RSA or secp256k1"),"ERR_UNSUPPORTED_KEY_DERIVATION_TYPE");return n.generateKeyPairFromSeed(t,r)},unmarshalPublicKey:e=>{const t=n.PublicKey.decode(e),r=t.Data;switch(t.Type){case n.KeyType.RSA:return u.rsa.unmarshalRsaPublicKey(r);case n.KeyType.Ed25519:return u.ed25519.unmarshalEd25519PublicKey(r);case n.KeyType.Secp256k1:if(u.secp256k1)return u.secp256k1.unmarshalSecp256k1PublicKey(r);throw o(new Error(c),h);default:l(t.Type)}},marshalPublicKey:(e,t)=>(l(t=(t||"rsa").toLowerCase()),e.bytes),unmarshalPrivateKey:f,marshalPrivateKey:(e,t)=>(l(t=(t||"rsa").toLowerCase()),e.bytes),import:async(e,t)=>{try{const r=await a.import(e,t);return f(r)}catch(c){}const r=i.pki.decryptRsaPrivateKey(e,t);if(null===r)throw o(new Error("Cannot read the key, most likely the password is wrong or not a RSA key"),"ERR_CANNOT_DECRYPT_PEM");let n=i.asn1.toDer(i.pki.privateKeyToAsn1(r));return n=s(n.getBytes(),"ascii"),u.rsa.unmarshalRsaPrivateKey(n)}}},70810:(e,t,r)=>{"use strict";r(95842);const n=r(5525),{base64urlToBigInteger:i}=r(76517);function o(e,t){return t.map((t=>i(e[t])))}e.exports={jwk2pub:function(e){return n.pki.setRsaPublicKey(...o(e,["n","e"]))},jwk2priv:function(e){return n.pki.setRsaPrivateKey(...o(e,["n","e","d","p","q","dp","dq","qi"]))}}},3821:(e,t,r)=>{"use strict";const n=r(61446),{concat:i}=r(45938),{fromString:o}=r(75528),s=r(47688),a={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};e.exports=async(e,t,r)=>{const u=a[e];if(!u){const t=Object.keys(a).join(" / ");throw n(new Error("unknown cipher type '".concat(e,"'. Must be ").concat(t)),"ERR_INVALID_CIPHER_TYPE")}if(!t)throw n(new Error("missing hash type"),"ERR_MISSING_HASH_TYPE");const c=u.keySize,h=u.ivSize,l=o("key expansion"),f=2*(h+c+20),d=await s.create(t,r);let p=await d.digest(l);const y=[];let g=0;for(;g<f;){const e=await d.digest(i([p,l]));let t=e.length;g+t>f&&(t=f-g),y.push(e),g+=t,p=await d.digest(p)}const m=f/2,b=i(y),v=b.slice(0,m),w=b.slice(m,f),_=e=>({iv:e.slice(0,h),cipherKey:e.slice(h,h+c),macKey:e.slice(h+c)});return{k1:_(v),k2:_(w)}}},97143:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-crypto-keys"]||(n.roots["libp2p-crypto-keys"]={});a.KeyType=function(){var e={},t=Object.create(e);return t[e[0]="RSA"]=0,t[e[1]="Ed25519"]=1,t[e[2]="Secp256k1"]=2,t}(),a.PublicKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.Type=0,e.prototype.Data=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(8).int32(e.Type),t.uint32(18).bytes(e.Data),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PublicKey;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw s.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw s.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PublicKey)return e;var t=new a.PublicKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?s.base64.decode(e.Data,t.Data=s.newBuffer(s.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=s.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?a.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?s.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),a.PrivateKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.Type=0,e.prototype.Data=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(8).int32(e.Type),t.uint32(18).bytes(e.Data),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PrivateKey;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw s.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw s.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PrivateKey)return e;var t=new a.PrivateKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?s.base64.decode(e.Data,t.Data=s.newBuffer(s.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=s.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?a.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?s.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},16024:(e,t,r)=>{"use strict";const n=r(85037),i=r(99737),{toString:o}=r(6398),{fromString:s}=r(75528);function a(e){return Promise.all([n.get().subtle.exportKey("jwk",e.privateKey),n.get().subtle.exportKey("jwk",e.publicKey)])}t.utils=r(56161),t.generateKey=async function(e){const t=await n.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await a(t);return{privateKey:r[0],publicKey:r[1]}},t.unmarshalPrivateKey=async function(e){const t=[await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await(r=e,n.get().subtle.importKey("jwk",{kty:r.kty,n:r.n,e:r.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"]))];var r;const i=await a({privateKey:t[0],publicKey:t[1]});return{privateKey:i[0],publicKey:i[1]}},t.getRandomValues=i,t.hashAndSign=async function(e,t){const r=await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),i=await n.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(t));return new Uint8Array(i,i.byteOffset,i.byteLength)},t.hashAndVerify=async function(e,t,r){const i=await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return n.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},i,t,r)};const{jwk2pub:u,jwk2priv:c}=r(70810);function h(e,t,r,n){const i=t?u(e):c(e),a=n(o(Uint8Array.from(r),"ascii"),i);return s(a,"ascii")}t.encrypt=function(e,t){return h(e,!0,t,((e,t)=>t.encrypt(e)))},t.decrypt=function(e,t){return h(e,!1,t,((e,t)=>t.decrypt(e)))}},6783:(e,t,r)=>{"use strict";const{sha256:n}=r(27678),i=r(61446),{equals:o}=r(26874),{toString:s}=r(6398);r(16654);const a=r(5525),u=r(16024),c=r(97143),h=r(14620);class l{constructor(e){this._key=e}async verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return u.utils.jwkToPkix(this._key)}get bytes(){return c.PublicKey.encode({Type:c.KeyType.RSA,Data:this.marshal()}).finish()}encrypt(e){return u.encrypt(this._key,e)}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}}class f{constructor(e,t){this._key=e,this._publicKey=t}genSecret(){return u.getRandomValues(16)}async sign(e){return u.hashAndSign(this._key,e)}get public(){if(!this._publicKey)throw i(new Error("public key not provided"),"ERR_PUBKEY_NOT_PROVIDED");return new l(this._publicKey)}decrypt(e){return u.decrypt(this._key,e)}marshal(){return u.utils.jwkToPkcs1(this._key)}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.RSA,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}async id(){const e=await this.public.hash();return s(e,"base58btc")}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pkcs-8";if("pkcs-8"===t){const t=new a.util.ByteBuffer(this.marshal()),r=a.asn1.fromDer(t),n=a.pki.privateKeyFromAsn1(r),i={algorithm:"aes256",count:1e4,saltSize:16,prfAlgorithm:"sha512"};return a.pki.encryptRsaPrivateKey(n,e,i)}if("libp2p-key"===t)return h.export(this.bytes,e);throw i(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}e.exports={RsaPublicKey:l,RsaPrivateKey:f,unmarshalRsaPublicKey:function(e){const t=u.utils.pkixToJwk(e);return new l(t)},unmarshalRsaPrivateKey:async function(e){const t=u.utils.pkcs1ToJwk(e),r=await u.unmarshalPrivateKey(t);return new f(r.privateKey,r.publicKey)},generateKeyPair:async function(e){const t=await u.generateKey(e);return new f(t.privateKey,t.publicKey)},fromJwk:async function(e){const t=await u.unmarshalPrivateKey(e);return new f(t.privateKey,t.publicKey)}}},56161:(e,t,r)=>{"use strict";r(93758),r(95842);const n=r(5525),{bigIntegerToUintBase64url:i,base64urlToBigInteger:o}=r(76517),{fromString:s}=r(75528),{toString:a}=r(6398);t.pkcs1ToJwk=function(e){const t=n.asn1.fromDer(a(e,"ascii")),r=n.pki.privateKeyFromAsn1(t);return{kty:"RSA",n:i(r.n),e:i(r.e),d:i(r.d),p:i(r.p),q:i(r.q),dp:i(r.dP),dq:i(r.dQ),qi:i(r.qInv),alg:"RS256",kid:"2011-04-29"}},t.jwkToPkcs1=function(e){const t=n.pki.privateKeyToAsn1({n:o(e.n),e:o(e.e),d:o(e.d),p:o(e.p),q:o(e.q),dP:o(e.dp),dQ:o(e.dq),qInv:o(e.qi)});return s(n.asn1.toDer(t).getBytes(),"ascii")},t.pkixToJwk=function(e){const t=n.asn1.fromDer(a(e,"ascii")),r=n.pki.publicKeyFromAsn1(t);return{kty:"RSA",n:i(r.n),e:i(r.e),alg:"RS256",kid:"2011-04-29"}},t.jwkToPkix=function(e){const t=n.pki.publicKeyToAsn1({n:o(e.n),e:o(e.e)});return s(n.asn1.toDer(t).getBytes(),"ascii")}},41267:(e,t,r)=>{"use strict";const{sha256:n}=r(27678),i=r(61446),{equals:o}=r(26874),{toString:s}=r(6398),a=r(14620);e.exports=(e,t,u)=>{u=u||r(4417)();class c{constructor(e){u.validatePublicKey(e),this._key=e}verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return u.compressPublicKey(this._key)}get bytes(){return e.PublicKey.encode({Type:e.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}}class h{constructor(e,t){this._key=e,this._publicKey=t||u.computePublicKey(e),u.validatePrivateKey(this._key),u.validatePublicKey(this._publicKey)}sign(e){return u.hashAndSign(this._key,e)}get public(){return new c(this._publicKey)}marshal(){return this._key}get bytes(){return e.PrivateKey.encode({Type:e.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}async id(){const e=await this.public.hash();return s(e,"base58btc")}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"libp2p-key";if("libp2p-key"===t)return a.export(this.bytes,e);throw i(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}return{Secp256k1PublicKey:c,Secp256k1PrivateKey:h,unmarshalSecp256k1PrivateKey:function(e){return new h(e)},unmarshalSecp256k1PublicKey:function(e){return new c(e)},generateKeyPair:async function(){const e=await u.generateKey();return new h(e)}}}},4417:(e,t,r)=>{"use strict";const n=r(61446),i=r(46440),{sha256:o}=r(27678);e.exports=()=>({generateKey:function(){return i.utils.randomPrivateKey()},privateKeyLength:32,hashAndSign:async function(e,t){const{digest:r}=await o.digest(t);try{return await i.sign(r,e)}catch(s){throw n(s,"ERR_INVALID_INPUT")}},hashAndVerify:async function(e,t,r){try{const{digest:n}=await o.digest(r);return i.verify(t,n,e)}catch(s){throw n(s,"ERR_INVALID_INPUT")}},compressPublicKey:function(e){return i.Point.fromHex(e).toRawBytes(!0)},decompressPublicKey:function(e){return i.Point.fromHex(e).toRawBytes(!1)},validatePrivateKey:function(e){try{i.getPublicKey(e,!0)}catch(t){throw n(t,"ERR_INVALID_PRIVATE_KEY")}},validatePublicKey:function(e){try{i.Point.fromHex(e)}catch(t){throw n(t,"ERR_INVALID_PUBLIC_KEY")}},computePublicKey:function(e){try{return i.getPublicKey(e,!0)}catch(t){throw n(t,"ERR_INVALID_PRIVATE_KEY")}}})},33760:(e,t,r)=>{"use strict";const n=r(61446);e.exports=function(e,t){if(!e.includes(t)){const r=e.join(" / ");throw n(new Error("Unknown curve: ".concat(t,". Must be ").concat(r)),"ERR_INVALID_CURVE")}}},99737:(e,t,r)=>{"use strict";const n=r(6543),i=r(61446);e.exports=function(e){if(isNaN(e)||e<=0)throw i(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return n(e)}},76517:(e,t,r)=>{"use strict";r(35139),r(24926);const n=r(5525),{fromString:i}=r(75528),{toString:o}=r(6398),{concat:s}=r(45938);t.bigIntegerToUintBase64url=(e,t)=>{let r=Uint8Array.from(e.abs().toByteArray());if(r=0===r[0]?r.slice(1):r,null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=s([new Uint8Array(t-r.length),r])}return o(r,"base64url")},t.base64urlToBigInteger=e=>{const r=t.base64urlToBuffer(e);return new n.jsbn.BigInteger(o(r,"base16"),16)},t.base64urlToBuffer=(e,t)=>{let r=i(e,"base64urlpad");if(null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=s([new Uint8Array(t-r.length),r])}return r}},85037:(e,t)=>{"use strict";t.get=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:globalThis;const t=e.crypto;if(!t||!t.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return t}},40213:(e,t,r)=>{"use strict";const{CID:n}=r(91759),i=r(36206),o=r(29936),s=r(59376),a=r(86443),{base58btc:u}=r(59376),{base32:c}=r(36206),{base16:h}=r(9092),l=r(27893),f=r(67390),d=r(93077),{PeerIdProto:p}=r(27186),{equals:y}=r(26874),{fromString:g}=r(75528),{toString:m}=r(6398),{identity:b}=r(4991),v={...i,...o,...s,...a},w=Object.keys(v).reduce(((e,t)=>e.or(v[t])),c.decoder);const _=d(class{constructor(e,t,r){if(!(e instanceof Uint8Array))throw new Error("invalid id provided");if(t&&r&&!y(t.public.bytes,r.bytes))throw new Error("inconsistent arguments");this._id=e,this._idB58String=u.encode(this.id).substring(1),this._privKey=t,this._pubKey=r}get id(){return this._id}set id(e){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(e){this._privKey=e}get pubKey(){if(this._pubKey)return this._pubKey;if(this._privKey)return this._privKey.public;try{const e=l.decode(this.id);e.code===b.code&&(this._pubKey=f.unmarshalPublicKey(e.digest))}catch(e){}return this._pubKey}set pubKey(e){this._pubKey=e}marshalPubKey(){if(this.pubKey)return f.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return f.marshalPrivateKey(this.privKey)}marshal(e){return p.encode({id:this.toBytes(),pubKey:this.marshalPubKey(),privKey:e?null:this.marshalPrivKey()}).finish()}toPrint(){let e=this.toB58String();e.startsWith("Qm")&&(e=e.slice(2));let t=6;return e.length<t&&(t=e.length),"<peer.ID "+e.substr(0,t)+">"}toJSON(){return{id:this.toB58String(),privKey:A(this.marshalPrivKey()),pubKey:A(this.marshalPubKey())}}toHexString(){return h.encode(this.id).substring(1)}toBytes(){return this.id}toB58String(){return this._idB58String}toString(){if(!this._idCIDString){const e=n.createV1(114,l.decode(this.id));Object.defineProperty(this,"_idCIDString",{value:e.toString(),enumerable:!1})}return this._idCIDString}equals(e){if(e instanceof Uint8Array)return y(this.id,e);if(e.id)return y(this.id,e.id);throw new Error("not valid Id")}isEqual(e){return this.equals(e)}isValid(){return Boolean(this.privKey&&this.privKey.public&&this.privKey.public.bytes&&this.pubKey.bytes instanceof Uint8Array&&y(this.privKey.public.bytes,this.pubKey.bytes))}hasInlinePublicKey(){try{if(l.decode(this.id).code===b.code)return!0}catch(e){}return!1}},{className:"PeerId",symbolName:"@libp2p/js-peer-id/PeerId"});t=e.exports=_;const E=e=>e.bytes.length<=42?l.create(b.code,e.bytes).bytes:e.hash(),S=async(e,t)=>{const r=await E(t);return new _(r,e,t)};t.create=async e=>{(e=e||{}).bits=e.bits||2048,e.keyType=e.keyType||"RSA";const t=await f.generateKeyPair(e.keyType,e.bits);return S(t,t.public)},t.createFromHexString=e=>new _(h.decode("f"+e)),t.createFromBytes=e=>{try{const r=n.decode(e);if(!M(r))throw new Error("Supplied PeerID CID is invalid");return t.createFromCID(r)}catch{if(l.decode(e).code!==b.code)throw new Error("Supplied PeerID CID is invalid");return new _(e)}},t.createFromB58String=e=>t.createFromBytes(u.decode("z"+e));const M=e=>114===e.code||112===e.code;function A(e){if(e)return m(e,"base64pad")}t.createFromCID=e=>{if(!(e=n.asCID(e))||!M(e))throw new Error("Supplied PeerID CID is invalid");return new _(e.multihash.bytes)},t.createFromPubKey=async e=>{let t=e;if("string"===typeof t&&(t=g(e,"base64pad")),!(t instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");const r=await f.unmarshalPublicKey(t);return S(void 0,r)},t.createFromPrivKey=async e=>{if("string"===typeof e&&(e=g(e,"base64pad")),!(e instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");const t=await f.unmarshalPrivateKey(e);return S(t,t.public)},t.createFromJSON=async e=>{const t=u.decode("z"+e.id),r=e.privKey&&g(e.privKey,"base64pad"),n=e.pubKey&&g(e.pubKey,"base64pad"),i=n&&await f.unmarshalPublicKey(n);if(!r)return new _(t,void 0,i);const o=await f.unmarshalPrivateKey(r),s=await E(o.public);let a;if(i&&(a=await E(i)),i&&!y(s,a))throw new Error("Public and private key do not match");if(t&&!y(s,t))throw new Error("Id and private key do not match");return new _(t,o,i)},t.createFromProtobuf=async e=>{"string"===typeof e&&(e=g(e,"base16"));let t,r,{id:n,privKey:i,pubKey:o}=p.decode(e);if(i=!!i&&await f.unmarshalPrivateKey(i),o=!!o&&await f.unmarshalPublicKey(o),i&&(r=await E(i.public)),o&&(t=await E(o)),i){if(o&&!y(r,t))throw new Error("Public and private key do not match");return new _(r,i,i.public)}if(o)return new _(t,void 0,o);if(n)return new _(n);throw new Error("Protobuf did not contain any usable key material")},t.parse=e=>("1"!==e.charAt(0)&&"Q"!==e.charAt(0)||(e="z".concat(e)),t.createFromBytes(w.decode(e))),t.isPeerId=e=>Boolean("object"===typeof e&&e._id&&e._idB58String)},27186:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-peer-id"]||(n.roots["libp2p-peer-id"]={});a.PeerIdProto=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.id=s.newBuffer([]),e.prototype.pubKey=s.newBuffer([]),e.prototype.privKey=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(10).bytes(e.id),null!=e.pubKey&&Object.hasOwnProperty.call(e,"pubKey")&&t.uint32(18).bytes(e.pubKey),null!=e.privKey&&Object.hasOwnProperty.call(e,"privKey")&&t.uint32(26).bytes(e.privKey),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PeerIdProto;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.pubKey=e.bytes();break;case 3:n.privKey=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("id"))throw s.ProtocolError("missing required 'id'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PeerIdProto)return e;var t=new a.PeerIdProto;return null!=e.id&&("string"===typeof e.id?s.base64.decode(e.id,t.id=s.newBuffer(s.base64.length(e.id)),0):e.id.length&&(t.id=e.id)),null!=e.pubKey&&("string"===typeof e.pubKey?s.base64.decode(e.pubKey,t.pubKey=s.newBuffer(s.base64.length(e.pubKey)),0):e.pubKey.length&&(t.pubKey=e.pubKey)),null!=e.privKey&&("string"===typeof e.privKey?s.base64.decode(e.privKey,t.privKey=s.newBuffer(s.base64.length(e.privKey)),0):e.privKey.length&&(t.privKey=e.privKey)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=s.newBuffer(r.id))),t.bytes===String?r.pubKey="":(r.pubKey=[],t.bytes!==Array&&(r.pubKey=s.newBuffer(r.pubKey))),t.bytes===String?r.privKey="":(r.privKey=[],t.bytes!==Array&&(r.privKey=s.newBuffer(r.privKey)))),null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?s.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.pubKey&&e.hasOwnProperty("pubKey")&&(r.pubKey=t.bytes===String?s.base64.encode(e.pubKey,0,e.pubKey.length):t.bytes===Array?Array.prototype.slice.call(e.pubKey):e.pubKey),null!=e.privKey&&e.hasOwnProperty("privKey")&&(r.privKey=t.bytes===String?s.base64.encode(e.privKey,0,e.privKey.length):t.bytes===Array?Array.prototype.slice.call(e.privKey):e.privKey),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},92981:e=>{const t=/^(\d{1,3}\.){3,3}\d{1,3}$/,r=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,n={name:"v4",size:4,isFormat:e=>t.test(e),encode(e,t,r){r=~~r,t=t||new Uint8Array(r+4);const n=e.length;let i=0;for(let o=0;o<n;){const n=e.charCodeAt(o++);46===n?(t[r++]=i,i=0):i=10*i+(n-48)}return t[r]=i,t},decode:(e,t)=>(t=~~t,"".concat(e[t++],".").concat(e[t++],".").concat(e[t++],".").concat(e[t]))},i={name:"v6",size:16,isFormat:e=>e.length>0&&r.test(e),encode(e,t,r){let n=(r=~~r)+16,i=-1,o=0,s=0,a=!0,u=!1;t=t||new Uint8Array(r+16);for(let c=0;c<e.length;c++){let h=e.charCodeAt(c);58===h?(a?-1!==i?(r<n&&(t[r]=0),r<n-1&&(t[r+1]=0),r+=2):r<n&&(i=r):(!0===u?(r<n&&(t[r]=s),r++):(r<n&&(t[r]=o>>8),r<n-1&&(t[r+1]=255&o),r+=2),o=0,s=0),a=!0,u=!1):46===h?(r<n&&(t[r]=s),r++,s=0,o=0,a=!1,u=!0):(a=!1,h>=97?h-=87:h>=65?h-=55:(h-=48,s=10*s+h),o=(o<<4)+h)}if(!1===a)!0===u?(r<n&&(t[r]=s),r++):(r<n&&(t[r]=o>>8),r<n-1&&(t[r+1]=255&o),r+=2);else if(0===i)r<n&&(t[r]=0),r<n-1&&(t[r+1]=0),r+=2;else if(-1!==i){r+=2;for(let e=Math.min(r-1,n-1);e>=i+2;e--)t[e]=t[e-2];t[i]=0,t[i+1]=0,i=r}if(i!==r&&-1!==i)for(r>n-2&&(r=n-2);n>i;)t[--n]=r<n&&r>i?t[--r]:0;else for(;r<n;)t[r++]=0;return t},decode(e,t){t=~~t;let r="";for(let n=0;n<16;n+=2)0!==n&&(r+=":"),r+=(e[t+n]<<8|e[t+n+1]).toString(16);return r.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};function o(e){if(n.isFormat(e))return n.size;if(i.isFormat(e))return i.size;throw Error("Invalid ip address: ".concat(e))}e.exports=Object.freeze({name:"ip",sizeOf:o,familyOf:e=>o(e)===n.size?1:2,v4:n,v6:i,encode(e,t,r){r=~~r;const s=o(e);return"function"===typeof t&&(t=t(r+s)),s===n.size?n.encode(e,t,r):i.encode(e,t,r)},decode(e,t,r){if(t=~~t,(r=r||e.length-t)===n.size)return n.decode(e,t,r);if(r===i.size)return i.decode(e,t,r);throw Error("Invalid buffer size needs to be ".concat(n.size," for v4 or ").concat(i.size," for v6."))}})},73119:e=>{"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function h(e){if("string"!==typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var r=0;if(" "!==e[r]){for(var n=0,i=0;e[r]===a;)n++,r++;for(var o=(e.length-r)*u+1>>>0,c=new Uint8Array(o);e[r];){var h=t[e.charCodeAt(r)];if(255===h)return;for(var l=0,f=o-1;(0!==h||l<i)&&-1!==f;f--,l++)h+=s*c[f]>>>0,c[f]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");i=l,r++}if(" "!==e[r]){for(var d=o-i;d!==o&&0===c[d];)d++;for(var p=new Uint8Array(n+(o-d)),y=n;d!==o;)p[y++]=c[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var u=(o-i)*c+1>>>0,h=new Uint8Array(u);i!==o;){for(var l=t[i],f=0,d=u-1;(0!==l||f<n)&&-1!==d;d--,f++)l+=256*h[d]>>>0,h[d]=l%s>>>0,l=l/s>>>0;if(0!==l)throw new Error("Non-zero carry");n=f,i++}for(var p=u-n;p!==u&&0===h[p];)p++;for(var y=a.repeat(r);p<u;++p)y+=e.charAt(h[p]);return y},decodeUnsafe:h,decode:function(e){var t=h(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},12877:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.verify=t.sign=t.getPublicKey=t.SignResult=t.Signature=t.Point=t.ExtendedPoint=t.CURVE=void 0;const i=n(r(10868)),o=BigInt(0),s=BigInt(1),a=BigInt(2),u=BigInt(8),c=BigInt(255),h={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:a**c-BigInt(19),n:a**BigInt(252)+BigInt("27742317777372353535851937790883648493"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")};t.CURVE=h;const l=32,f=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),d=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),p=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),y=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),g=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class m{constructor(e,t,r,n){this.x=e,this.y=t,this.z=r,this.t=n}static fromAffine(e){if(!(e instanceof v))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(v.ZERO)?m.ZERO:new m(e.x,e.y,s,P(e.x*e.y))}static toAffineBatch(e){const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.P;const r=e.length,n=new Array(r);let i=s;for(let s=0;s<r;s++)e[s]!==o&&(n[s]=i,i=P(i*e[s],t));i=C(i,t);for(let s=r-1;s>=0;s--){if(e[s]===o)continue;let r=P(i*e[s],t);e[s]=P(i*n[s],t),i=r}return e}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}static fromRistrettoHash(e){const t=R(e.slice(0,l)),r=this.calcElligatorRistrettoMap(t),n=R(e.slice(l,64)),i=this.calcElligatorRistrettoMap(n);return r.add(i)}static calcElligatorRistrettoMap(e){const{d:t}=h,r=P(f*e*e),n=P((r+s)*y);let i=BigInt(-1);const o=P((i-t*r)*P(r+t));let{isValid:a,value:u}=x(n,o),c=P(u*e);k(c)||(c=P(-c)),a||(u=c),a||(i=r);const l=P(i*(r-s)*g-o),p=u*u,b=P((u+u)*o),v=P(l*d),w=P(s-p),_=P(s+p);return new m(P(b*_),P(w*v),P(v*_),P(b*w))}static fromRistrettoBytes(e){const{a:t,d:r}=h,n="ExtendedPoint.fromRistrettoBytes: Cannot convert bytes to Ristretto Point",i=R(e);if(!function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(I(i,l),e)||k(i))throw new Error(n);const a=P(i*i),u=P(s+t*a),c=P(s-t*a),f=P(u*u),d=P(c*c),p=P(t*r*f-d),{isValid:y,value:g}=B(P(p*d)),b=P(g*c),v=P(g*b*p);let w=P((i+i)*b);k(w)&&(w=P(-w));const _=P(u*v),E=P(w*_);if(!y||k(E)||_===o)throw new Error(n);return new m(w,_,s,E)}toRistrettoBytes(){let{x:e,y:t,z:r,t:n}=this;const i=P(P(r+t)*P(r-t)),o=P(e*t),{value:s}=B(P(i*o**a)),u=P(s*i),c=P(s*o),h=P(u*c*n);let d;if(k(n*h)){let r=P(t*f),n=P(e*f);e=r,t=n,d=P(u*p)}else d=c;k(e*h)&&(t=P(-t));let y=P((r-t)*d);return k(y)&&(y=P(-y)),I(y,l)}equals(e){const t=e;return P(this.t*t.z)===P(t.t*this.z)}negate(){return new m(P(-this.x),this.y,this.z,P(-this.t))}double(){const e=this.x,t=this.y,r=this.z,{a:n}=h,i=P(e**a),o=P(t**a),s=P(a*r**a),u=P(n*i),c=P((e+t)**a-i-o),l=P(u+o),f=P(l-s),d=P(u-o),p=P(c*f),y=P(l*d),g=P(c*d),b=P(f*l);return new m(p,y,b,g)}add(e){const t=this.x,r=this.y,n=this.z,i=this.t,s=e.x,u=e.y,c=e.z,h=e.t,l=P((r-t)*(u+s)),f=P((r+t)*(u-s)),d=P(f-l);if(d===o)return this.double();const p=P(n*a*h),y=P(i*a*c),g=P(y+p),b=P(f+l),v=P(y-p),w=P(g*d),_=P(b*v),E=P(g*v),S=P(d*b);return new m(w,_,S,E)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){let t=q(e);if(t===s)return this;let r=m.ZERO,n=this;for(;t>o;)t&s&&(r=r.add(n)),n=n.double(),t>>=s;return r}precomputeWindow(e){const t=256/e+1;let r=[],n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(m.BASE)&&(t=v.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&b.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=m.normalizeZ(n),b.set(t,n)));let i=m.ZERO,o=m.ZERO;const a=256/r+1,u=2**(r-1),c=BigInt(2**r-1),h=2**r,l=BigInt(r);for(let f=0;f<a;f++){const t=f*u;let r=Number(e&c);if(e>>=l,r>u&&(r-=h,e+=s),0===r){let e=n[t];f%2&&(e=e.negate()),o=o.add(e)}else{let e=n[t+Math.abs(r)-1];r<0&&(e=e.negate()),i=i.add(e)}}return[i,o]}multiply(e,t){const r=q(e);return m.normalizeZ(this.wNAF(r,t))[0]}toAffine(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:C(this.z);const t=P(this.x*e),r=P(this.y*e);return new v(t,r)}}t.ExtendedPoint=m,m.BASE=new m(h.Gx,h.Gy,s,P(h.Gx*h.Gy)),m.ZERO=new m(o,s,s,o);const b=new WeakMap;class v{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,b.delete(this)}static fromHex(e){const{d:t,P:r}=h,n=e instanceof Uint8Array?e:M(e);if(32!==n.length)throw new Error("Point.fromHex: expected 32 bytes");const i=n[31],o=-129&i,a=0!==(128&i),u=T(Uint8Array.from(Array.from(n.slice(0,31)).concat(o)));if(u>=r)throw new Error("Point.fromHex expects hex <= Fp");const c=P(u*u),l=P(c-s),f=P(t*c+s);let{isValid:d,value:p}=x(l,f);if(!d)throw new Error("Point.fromHex: invalid y coordinate");return a!==((p&s)===s)&&(p=P(-p)),new v(p,u)}static async fromPrivateKey(e){const t=await j(e);return v.BASE.multiply(N(t))}toRawBytes(){const e=A(this.y),t=new Uint8Array(l);for(let n=e.length-2,i=0;i<l&&n>=0;n-=2,i++)t[i]=S(e[n]+e[n+1]);const r=this.x&s?128:0;return t[31]|=r,t}toHex(){return E(this.toRawBytes())}toX25519(){return P((s+this.y)*C(s-this.y))}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new v(P(-this.x),this.y)}add(e){return m.fromAffine(this).add(m.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return m.fromAffine(this).multiply(e,this).toAffine()}}t.Point=v,v.BASE=new v(h.Gx,h.Gy),v.ZERO=new v(o,s);class w{constructor(e,t){this.r=e,this.s=t}static fromHex(e){e=L(e);const t=v.fromHex(e.slice(0,32)),r=T(e.slice(32));if(!K(r))throw new Error("Signature.fromHex expects s <= CURVE.n");return new w(t,r)}toRawBytes(){const e=M(A(this.s)).reverse(),t=new Uint8Array(l);t.set(e);const r=new Uint8Array(64);return r.set(this.r.toRawBytes()),r.set(t,32),r}toHex(){return E(this.toRawBytes())}}function _(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(1===t.length)return t[0];const n=t.reduce(((e,t)=>e+t.length),0),i=new Uint8Array(n);for(let o=0,s=0;o<t.length;o++){const e=t[o];i.set(e,s),s+=e.length}return i}function E(e){let t="";for(let r=0;r<e.length;r++)t+=e[r].toString(16).padStart(2,"0");return t}function S(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function M(e){if("string"!==typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r;t[r]=S(e.slice(n,n+2))}return t}function A(e){const t=e.toString(16);return 1&t.length?"0".concat(t):t}function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;const r=A(e).padStart(2*t,"0");return M(r).reverse()}function k(e){return(P(e)&s)===s}function T(e){let t=o;for(let r=0;r<e.length;r++)t+=BigInt(e[r])<<u*BigInt(r);return t}function R(e){return P(T(e)&a**c-s)}function P(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.P;const r=e%t;return r>=o?r:t+r}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.P;if(e===o||t<=o)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));let r=P(e,t),n=t,i=o,a=s,u=s,c=o;for(;r!==o;){const e=n/r,t=n%r,o=i-u*e,s=a-c*e;n=r,r=t,i=u,a=c,u=o,c=s}const l=n;if(l!==s)throw new Error("invert: does not exist");return P(i,t)}function O(e,t){const{P:r}=h;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function x(e,t){const r=P(t*t*t),n=P(r*r*t);let i=P(e*r*function(e){const{P:t}=h,[r,n,i,o,u]=[5,10,20,40,80].map((e=>BigInt(e))),c=e*e%t*e%t,l=O(c,a)*c%t,f=O(l,s)*e%t,d=O(f,r)*f%t,p=O(d,n)*d%t,y=O(p,i)*p%t,g=O(y,o)*y%t,m=O(g,u)*g%t,b=O(m,u)*g%t,v=O(b,n)*d%t;return O(v,a)*e%t}(e*n));const o=P(t*i*i),u=i,c=P(i*f),l=o===e,d=o===P(-e),p=o===P(-e*f);return l&&(i=u),(d||p)&&(i=c),k(i)&&(i=P(-i)),{isValid:l||d,value:i}}function B(e){return x(s,e)}async function D(){const e=_(...arguments),r=await t.utils.sha512(e),n=T(r);return P(n,h.n)}function N(e){const t=e.slice(0,l);return t[0]&=248,t[31]&=127,t[31]|=64,P(T(t),h.n)}function L(e){return e instanceof Uint8Array?e:M(e)}function K(e){return 0<e&&e<h.n}t.Signature=w,t.SignResult=w;const U=a**BigInt(256)-s;async function j(e){return await t.utils.sha512(function(e){let t,r="Expected 32 bytes of private key";if("bigint"===typeof e||"number"===typeof e&&Number.isSafeInteger(e)){let n=BigInt(e);if(n<0||n>U)throw new Error(r);t=M(n.toString(16).padStart(64,"0"))}else if("string"===typeof e){if(64!==e.length)throw new Error(r);t=M(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error(r);t=e}return t}(e))}function q(e){if("number"===typeof e&&e>0&&Number.isSafeInteger(e))return BigInt(e);if("bigint"===typeof e&&K(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}t.getPublicKey=async function(e){const t=await v.fromPrivateKey(e);return"string"===typeof e?t.toHex():t.toRawBytes()},t.sign=async function(e,t){const r=await j(t),n=N(r),i=v.BASE.multiply(n),o=L(e),s=await D((a=r,a.slice(l)),o);var a;const u=v.BASE.multiply(s),c=P(s+await D(u.toRawBytes(),i.toRawBytes(),o)*n,h.n),f=new w(u,c);return"string"===typeof e?f.toHex():f.toRawBytes()},t.verify=async function(e,t,r){t=L(t),r instanceof v||(r=v.fromHex(r)),e instanceof w||(e=w.fromHex(e));const n=await D(e.r.toRawBytes(),r.toRawBytes(),t),i=m.fromAffine(r).multiplyUnsafe(n),o=m.BASE.multiply(e.s);return m.fromAffine(e.r).add(i).subtract(o).multiplyUnsafe(u).equals(m.ZERO)},v.BASE._setWindowSize(8);const F={node:i.default,web:"object"===typeof self&&"crypto"in self?self.crypto:void 0};t.utils={TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],randomBytes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(F.web)return F.web.getRandomValues(new Uint8Array(e));if(F.node){const{randomBytes:t}=F.node;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>t.utils.randomBytes(32),sha512:async e=>{if(F.web){const t=await F.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(t)}if(F.node)return Uint8Array.from(F.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")},precompute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v.BASE;const r=t.equals(v.BASE)?t:new v(t.x,t.y);return r._setWindowSize(e),r.multiply(s),r}}},46440:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.SignResult=t.Signature=t.Point=t.CURVE=void 0;const i=n(r(77695)),o=BigInt(0),s=BigInt(1),a=BigInt(2),u=BigInt(3),c=BigInt(8),h=a**BigInt(256),l={a:o,b:BigInt(7),P:h-a**BigInt(32)-BigInt(977),n:h-BigInt("432420386565659656852420866394968145599"),h:s,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function f(e){const{a:t,b:r}=l;return P(e**u+t*e+r)}t.CURVE=l;const d=l.a===o;class p{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof g))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new p(e.x,e.y,s)}static toAffineBatch(e){const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.P;const r=e.length,n=new Array(r);let i=s;for(let s=0;s<r;s++)e[s]!==o&&(n[s]=i,i=P(i*e[s],t));i=O(i,t);for(let s=r-1;s>=0;s--){if(e[s]===o)continue;const r=P(i*e[s],t);e[s]=P(i*n[s],t),i=r}return e}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return p.toAffineBatch(e).map(p.fromAffine)}equals(e){const t=this,r=e,n=P(t.z*t.z),i=P(t.z*n),o=P(r.z*r.z),s=P(r.z*o);return P(t.x*o)===P(n*r.x)&&P(t.y*s)===P(i*r.y)}negate(){return new p(this.x,P(-this.y),this.z)}double(){const e=this.x,t=this.y,r=this.z,n=P(e**a),i=P(t**a),o=P(i**a),s=P(a*(P(P((e+i)**a))-n-o)),h=P(u*n),l=P(h**a),f=P(l-a*s),d=P(h*(s-f)-c*o),y=P(a*t*r);return new p(f,d,y)}add(e){if(!(e instanceof p))throw new TypeError("JacobianPoint#add: expected JacobianPoint");const t=this.x,r=this.y,n=this.z,i=e.x,s=e.y,u=e.z;if(i===o||s===o)return this;if(t===o||r===o)return e;const c=P(n**a),h=P(u**a),l=P(t*h),f=P(i*c),d=P(r*u*h),y=P(P(s*n)*c),g=P(f-l),m=P(y-d);if(g===o)return m===o?this.double():p.ZERO;const b=P(g**a),v=P(g*b),w=P(l*b),_=P(m**a-v-a*w),E=P(m*(w-_)-d*v),S=P(n*u*g);return new p(_,E,S)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){let t=R(e);if(!d){let e=p.ZERO,r=this;for(;t>o;)t&s&&(e=e.add(r)),r=r.double(),t>>=s;return e}let{k1neg:r,k1:n,k2neg:i,k2:a}=D(t),u=p.ZERO,c=p.ZERO,h=this;for(;n>o||a>o;)n&s&&(u=u.add(h)),a&s&&(c=c.add(h)),h=h.double(),n>>=s,a>>=s;return r&&(u=u.negate()),i&&(c=c.negate()),c=new p(P(c.x*l.beta),c.y,c.z),u.add(c)}precomputeWindow(e){const t=d?128/e+1:256/e+1;let r=[],n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(p.BASE)&&(t=g.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&y.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=p.normalizeZ(n),y.set(t,n)));let i=p.ZERO,o=p.ZERO;const a=d?128/r+1:256/r+1,u=2**(r-1),c=BigInt(2**r-1),h=2**r,l=BigInt(r);for(let f=0;f<a;f++){const t=f*u;let r=Number(e&c);if(e>>=l,r>u&&(r-=h,e+=s),0===r){let e=n[t];f%2&&(e=e.negate()),o=o.add(e)}else{let e=n[t+Math.abs(r)-1];r<0&&(e=e.negate()),i=i.add(e)}}return{p:i,f:o}}multiply(e,t){let r,n,i=R(e);if(d){let{k1neg:e,k1:o,k2neg:s,k2:a}=D(i),{p:u,f:c}=this.wNAF(o,t),{p:h,f:f}=this.wNAF(a,t);e&&(u=u.negate()),s&&(h=h.negate()),h=new p(P(h.x*l.beta),h.y,h.z),r=u.add(h),n=c.add(f)}else{let{p:e,f:o}=this.wNAF(i,t);r=e,n=o}return p.normalizeZ([r,n])[0]}toAffine(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O(this.z);const t=e**a,r=P(this.x*t),n=P(this.y*t*e);return new g(r,n)}}p.BASE=new p(l.Gx,l.Gy,s),p.ZERO=new p(o,s,o);const y=new WeakMap;class g{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,y.delete(this)}static fromCompressedHex(e){const t=32===e.length,r=k(t?e:e.slice(1));let n=function(e){const{P:t}=l,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),c=BigInt(88),h=e*e*e%t,f=h*h*e%t,d=C(f,u)*f%t,p=C(d,u)*f%t,y=C(p,a)*h%t,g=C(y,n)*y%t,m=C(g,i)*g%t,b=C(m,s)*m%t,v=C(b,c)*b%t,w=C(v,s)*m%t,_=C(w,u)*f%t,E=C(_,o)*g%t,S=C(E,r)*h%t;return C(S,a)}(f(r));const i=(n&s)===s;if(t)i&&(n=P(-n));else{1===(1&e[0])!==i&&(n=P(-n))}const o=new g(r,n);return o.assertValidity(),o}static fromUncompressedHex(e){const t=k(e.slice(1,33)),r=k(e.slice(33)),n=new g(t,r);return n.assertValidity(),n}static fromHex(e){const t=I(e),r=t[0];if(32===t.length||33===t.length&&(2===r||3===r))return this.fromCompressedHex(t);if(65===t.length&&4===r)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ".concat(t.length))}static fromPrivateKey(e){return g.BASE.multiply(q(e))}static fromSignature(e,t,r){let n=e instanceof Uint8Array?k(e):M(e);const i=z(t),{r:o,s:s}=i;if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid yParity bit");const a=2+(1&r),u=g.fromHex("0".concat(a).concat(_(o))),c=p.fromAffine(u).multiplyUnsafe(s),h=p.BASE.multiply(n),f=O(o,l.n),d=c.subtract(h).multiplyUnsafe(f).toAffine();return d.assertValidity(),d}toRawBytes(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return A(this.toHex(e))}toHex(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=_(this.x);return e?"".concat(this.y&s?"03":"02").concat(t):"04".concat(t).concat(_(this.y))}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{P:t}=l,{x:r,y:n}=this;if(r===o||n===o||r>=t||n>=t)throw new Error(e);if((P(n*n)-f(r))%t!==o)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new g(this.x,P(-this.y))}double(){return p.fromAffine(this).double().toAffine()}add(e){return p.fromAffine(this).add(p.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return p.fromAffine(this).multiply(e,this).toAffine()}}function m(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}t.Point=g,g.BASE=new g(l.Gx,l.Gy),g.ZERO=new g(o,o);class b{constructor(e,t){this.r=e,this.s=t}static fromCompact(e){if("string"!==typeof e&&!(e instanceof Uint8Array))throw new TypeError("Signature.fromCompact: Expected string or Uint8Array");const t=e instanceof Uint8Array?w(e):e;if(128!==t.length)throw new Error("Signature.fromCompact: Expected 64-byte hex");const r=new b(M(t.slice(0,64)),M(t.slice(64,128)));return r.assertValidity(),r}static fromDER(e){const t="Signature.fromDER";if("string"!==typeof e&&!(e instanceof Uint8Array))throw new TypeError("".concat(t,": Expected string or Uint8Array"));const r=e instanceof Uint8Array?w(e):e,n=T(r.slice(2,4));if("30"!==r.slice(0,2)||n!==r.length-4||"02"!==r.slice(4,6))throw new Error("".concat(t,": Invalid signature ").concat(r));const i=T(r.slice(6,8)),o=8+i,s=r.slice(8,o);if(s.startsWith("00")&&T(s.slice(2,4))<=127)throw new Error("".concat(t,": Invalid r with trailing length"));const a=M(s);if("02"!==r.slice(o,o+2))throw new Error("".concat(t,": Invalid r-s separator"));const u=T(r.slice(o+2,o+4)),c=n-u-i-10;if(c>0||-4===c)throw new Error("".concat(t,": Invalid total length"));if(u>n-i-4)throw new Error("".concat(t,": Invalid s"));const h=o+4,l=r.slice(h,h+u);if(l.startsWith("00")&&T(l.slice(2,4))<=127)throw new Error("".concat(t,": Invalid s with trailing length"));const f=M(l),d=new b(a,f);return d.assertValidity(),d}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!U(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!U(t))throw new Error("Invalid Signature: s must be 0 < s < n")}toDERRawBytes(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return A(this.toDERHex(e))}toDERHex(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=m(S(this.s));if(e)return t;const r=m(S(this.r)),n=S(r.length/2),i=S(t.length/2),o=S(r.length/2+t.length/2+4);return"30".concat(o,"02").concat(n).concat(r,"02").concat(i).concat(t)}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return A(this.toCompactHex())}toCompactHex(){return _(this.r)+_(this.s)}}function v(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(1===t.length)return t[0];const n=t.reduce(((e,t)=>e+t.length),0),i=new Uint8Array(n);for(let o=0,s=0;o<t.length;o++){const e=t[o];i.set(e,s),s+=e.length}return i}function w(e){let t="";for(let r=0;r<e.length;r++)t+=e[r].toString(16).padStart(2,"0");return t}function _(e){return e.toString(16).padStart(64,"0")}function E(e){return A(_(e))}function S(e){const t=e.toString(16);return 1&t.length?"0".concat(t):t}function M(e){if("string"!==typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt("0x".concat(e))}function A(e){if("string"!==typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r;t[r]=Number.parseInt(e.slice(n,n+2),16)}return t}function I(e){return e instanceof Uint8Array?e:A(e)}function k(e){return M(w(e))}function T(e){return 2*Number.parseInt(e,16)}function R(e){if("number"===typeof e&&e>0&&Number.isSafeInteger(e))return BigInt(e);if("bigint"===typeof e&&U(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function P(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.P;const r=e%t;return r>=0?r:t+r}function C(e,t){const{P:r}=l;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function O(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.P;if(e===o||t<=o)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));let r=P(e,t),n=t,i=o,a=s,u=s,c=o;for(;r!==o;){const e=n/r,t=n%r,o=i-u*e,s=a-c*e;n=r,r=t,i=u,a=c,u=o,c=s}const h=n;if(h!==s)throw new Error("invert: does not exist");return P(i,t)}t.Signature=b,t.SignResult=b;const x=(e,t)=>(e+t/a)/t,B=a**BigInt(128);function D(e){const{n:t}=l,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-s*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=x(o*e,t),u=x(-n*e,t);let c=P(e-a*r-u*i,t),h=P(-a*n-u*o,t);const f=c>B,d=h>B;if(f&&(c=t-c),d&&(h=t-h),c>B||h>B)throw new Error("splitScalarEndo: Endomorphism failed");return{k1neg:f,k1:c,k2neg:d,k2:h}}function N(e,t){if(null==e)throw new Error('sign: expected valid msgHash, not "'.concat(e,'"'));const r=E("string"===typeof e?M(e):k(e));return{h1:r,h1n:k(r),x:E(t),v:new Uint8Array(32).fill(1),k:new Uint8Array(32).fill(0),b0:Uint8Array.from([0]),b1:Uint8Array.from([1])}}async function L(e,r){const n=q(r);let{h1:i,h1n:o,x:s,v:a,k:u,b0:c,b1:h}=N(e,n);const l=t.utils.hmacSha256;u=await l(u,a,c,s,i),a=await l(u,a),u=await l(u,a,h,s,i),a=await l(u,a);for(let t=0;t<1e3;t++){a=await l(u,a);let e=j(a,o,n);if(e)return e;u=await l(u,a,c),a=await l(u,a)}throw new TypeError("secp256k1: Tried 1,000 k values for sign(), all were invalid")}function K(e,r){const n=q(r);let{h1:i,h1n:o,x:s,v:a,k:u,b0:c,b1:h}=N(e,n);const l=t.utils.hmacSha256Sync;if(!l)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");if(u=l(u,a,c,s,i),u instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");a=l(u,a),u=l(u,a,h,s,i),a=l(u,a);for(let t=0;t<1e3;t++){a=l(u,a);let e=j(a,o,n);if(e)return e;u=l(u,a,c),a=l(u,a)}throw new TypeError("secp256k1: Tried 1,000 k values for sign(), all were invalid")}function U(e){return 0<e&&e<l.n}function j(e,t,r){const n=k(e);if(!U(n))return;const i=l.n,s=g.BASE.multiply(n),a=P(s.x,i),u=P(O(n,i)*(t+a*r),i);return a!==o&&u!==o?[s,a,u]:void 0}function q(e){let t;if("bigint"===typeof e)t=e;else if("number"===typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"===typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=M(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=k(e)}if(!U(t))throw new Error("Expected private key: 0 < key < n");return t}function F(e){return e instanceof g?(e.assertValidity(),e):g.fromHex(e)}function z(e){return e instanceof b?(e.assertValidity(),e):b.fromDER(e)}function V(e){const t=e instanceof Uint8Array,r="string"===typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof g}function H(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const[n,i,o]=e;let{canonical:a,der:u,recovered:c}=t,h=(n.x===i?0:2)|Number(n.y&s),f=o;const d=l.n>>s;o>d&&a&&(f=l.n-o,h^=1);const p=new b(i,f);p.assertValidity();const y=!1===u?p.toCompactHex():p.toDERHex(),g=r?y:A(y);return c?[g,h]:g}async function G(e){const r=new Uint8Array(e.split("").map((e=>e.charCodeAt(0)))),n=await t.utils.sha256(r);for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];const a=await t.utils.sha256(v(n,n,...o));return k(a)}async function W(e,t,r){const n=E(e);return P(await G("BIP0340/challenge",n,t.toRawX(),r),l.n)}function Y(e){return P(e.y,a)===o}t.getPublicKey=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=g.fromPrivateKey(e);return"string"===typeof e?r.toHex(t):r.toRawBytes(t)},t.recoverPublicKey=function(e,t,r){const n=g.fromSignature(e,t,r);return"string"===typeof e?n.toHex():n.toRawBytes()},t.getSharedSecret=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(V(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!V(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=F(t);n.assertValidity();const i=n.multiply(q(e));return"string"===typeof e?i.toHex(r):i.toRawBytes(r)},t.sign=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return H(await L(e,t),r,"string"===typeof e)},t.signSync=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return H(K(e,t),r,"string"===typeof e)},t.verify=function(e,t,r){const{n:n}=l;let i;try{i=z(e)}catch(m){return!1}const{r:s,s:a}=i,u=function(e){"string"!==typeof e&&(e=w(e));let t=M(e||"0");const r=e.length/2*8-256;return r>0&&(t>>=BigInt(r)),t>=l.n&&(t-=l.n),t}(t);if(u===o)return!1;const c=p.fromAffine(F(r)),h=O(a,n),f=P(u*h,n),d=P(s*h,n),y=p.BASE.multiply(f),g=c.multiplyUnsafe(d);return P(y.add(g).toAffine().x,n)===s};class Z{constructor(e,t){if(this.r=e,this.s=t,e<=o||t<=o||e>=l.P||t>=l.n)throw new Error("Invalid signature")}static fromHex(e){const t=I(e);if(64!==t.length)throw new TypeError("SchnorrSignature.fromHex: expected 64 bytes, not ".concat(t.length));const r=k(t.slice(0,32)),n=k(t.slice(32));return new Z(r,n)}toHex(){return _(this.r)+_(this.s)}toRawBytes(){return A(this.toHex())}}async function X(e,t,r){const n=e instanceof Z?e:Z.fromHex(e),i="string"===typeof t?A(t):t,o=F(r),s=await W(n.r,o,i),a=g.fromPrivateKey(n.s),u=o.multiply(s),c=a.subtract(u);return!(c.equals(g.BASE)||!Y(c)||c.x!==n.r)}t.schnorr={Signature:Z,getPublicKey:function(e){const t=g.fromPrivateKey(e);return"string"===typeof e?t.toHexX():t.toRawX()},sign:async function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.utils.randomBytes();if(null==e)throw new TypeError('sign: Expected valid message, not "'.concat(e,'"'));r||(r=o);const{n:i}=l,s=I(e),a=q(r),u=I(n);if(32!==u.length)throw new TypeError("sign: Expected 32 bytes of aux randomness");const c=g.fromPrivateKey(a),h=Y(c)?a:i-a,f=await G("BIP0340/aux",u),d=h^f,p=await G("BIP0340/nonce",E(d),c.toRawX(),s),y=P(p,i);if(y===o)throw new Error("sign: Creation of signature failed. k is zero");const m=g.fromPrivateKey(y),b=Y(m)?y:i-y,v=await W(m.x,c,s),w=new Z(m.x,P(b+v*h,i)),_=await X(w.toRawBytes(),s,c.toRawX());if(!_)throw new Error("sign: Invalid signature produced");return"string"===typeof e?w.toHex():w.toRawBytes()},verify:X},g.BASE._setWindowSize(8);const J={node:i.default,web:"object"===typeof self&&"crypto"in self?self.crypto:void 0};t.utils={isValidPrivateKey(e){try{return q(e),!0}catch(t){return!1}},randomBytes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(J.web)return J.web.getRandomValues(new Uint8Array(e));if(J.node){const{randomBytes:t}=J.node;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>{let e=8;for(;e--;){const e=t.utils.randomBytes(32),r=k(e);if(U(r)&&r!==s)return e}throw new Error("Valid private key was not found in 8 iterations. PRNG is broken")},sha256:async e=>{if(J.web){const t=await J.web.subtle.digest("SHA-256",e.buffer);return new Uint8Array(t)}if(J.node){const{createHash:t}=J.node;return Uint8Array.from(t("sha256").update(e).digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(J.web){const t=await J.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=v(...r),i=await J.web.subtle.sign("HMAC",t,n);return new Uint8Array(i)}if(J.node){const{createHmac:t}=J.node,n=t("sha256",e);for(let e of r)n.update(e);return Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,precompute(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.BASE;const r=t===g.BASE?t:new g(t.x,t.y);return r._setWindowSize(e),r.multiply(u),r}}},32308:e=>{"use strict";e.exports=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,o=!0;for(;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,s){r[n]=function(e){if(o)if(o=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(a){o&&(o=!1,s(a))}}))}},36227:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),o=0;o<64;)i[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,r){for(var i,o=null,s=[],a=0,u=0;t<r;){var c=e[t++];switch(u){case 0:s[a++]=n[c>>2],i=(3&c)<<4,u=1;break;case 1:s[a++]=n[i|c>>4],i=(15&c)<<2,u=2;break;case 2:s[a++]=n[i|c>>6],s[a++]=n[63&c],u=0}a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=n[i],s[a++]=61,1===u&&(s[a++]=61)),o?(a&&o.push(String.fromCharCode.apply(String,s.slice(0,a))),o.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";r.decode=function(e,t,r){for(var n,o=r,a=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&a>1)break;if(void 0===(c=i[c]))throw Error(s);switch(a){case 0:n=c,a=1;break;case 1:t[r++]=n<<2|(48&c)>>4,n=c,a=2;break;case 2:t[r++]=(15&n)<<4|(60&c)>>2,n=c,a=3;break;case 3:t[r++]=(3&n)<<6|c,a=0}}if(1===a)throw Error(s);return r-o},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},38001:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},98572:e=>{"use strict";function t(e){return"undefined"!==typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function o(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function a(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:o,e.writeFloatBE=n?o:i,e.readFloatLE=n?s:a,e.readFloatBE=n?a:s}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function s(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,s=8388607&n;return 255===o?s?NaN:i*(1/0):0===o?1401298464324817e-60*i*s:i*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=s.bind(null,i),e.readFloatBE=s.bind(null,o)}(),"undefined"!==typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function s(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function a(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?s:a,e.readDoubleBE=n?a:s}():function(){function t(e,t,r,n,i,o){var s=n<0?1:0;if(s&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((s<<31|2146435072)>>>0,i,o+r);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,i,o+t),e((s<<31|a/4294967296)>>>0,i,o+r);else{var u=Math.floor(Math.log(n)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=n*Math.pow(2,-u))>>>0,i,o+t),e((s<<31|u+1023<<20|1048576*a&1048575)>>>0,i,o+r)}}}function s(e,t,r,n,i){var o=e(n,i+t),s=e(n,i+r),a=2*(s>>31)+1,u=s>>>20&2047,c=4294967296*(1048575&s)+o;return 2047===u?c?NaN:a*(1/0):0===u?5e-324*a*c:a*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=s.bind(null,i,0,4),e.readDoubleBE=s.bind(null,o,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},49329:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},42338:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(r){if(r<1||r>i)return e(r);s+r>n&&(o=e(n),s=0);var a=t.call(o,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},41122:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296===(64512&r)&&56320===(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,o=[],s=0;t<r;)(n=e[t++])<128?o[s++]=n:n>191&&n<224?o[s++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[s++]=55296+(n>>10),o[s++]=56320+(1023&n)):o[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))},r.write=function(e,t,r){for(var n,i,o=r,s=0;s<e.length;++s)(n=e.charCodeAt(s))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296===(64512&n)&&56320===(64512&(i=e.charCodeAt(s+1)))?(n=65536+((1023&n)<<10)+(1023&i),++s,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},29332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(27774);function i(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function o(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function s(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function u(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function c(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function h(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function l(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function f(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),h(e/4294967296>>>0,t,r),h(e>>>0,t,r+4),t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),l(e>>>0,t,r),l(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=o,t.writeInt16LE=o,t.readInt32BE=s,t.readUint32BE=a,t.readInt32LE=u,t.readUint32LE=c,t.writeUint32BE=h,t.writeInt32BE=h,t.writeUint32LE=l,t.writeInt32LE=l,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=s(e,t),n=s(e,t+4);return 4294967296*r+n-4294967296*(n>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=u(e,t);return 4294967296*u(e,t+4)+r-4294967296*(r>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=c(e,t);return 4294967296*c(e,t+4)+r},t.writeUint64BE=f,t.writeInt64BE=f,t.writeUint64LE=d,t.writeInt64LE=d,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=e/8+r-1;o>=r;o--)n+=t[o]*i,i*=256;return n},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+e/8;o++)n+=t[o]*i,i*=256;return n},t.writeUintBE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var o=1,s=e/8+i-1;s>=i;s--)r[s]=t/o&255,o*=256;return r},t.writeUintLE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s<i+e/8;s++)r[s]=t/o&255,o*=256;return r},t.readFloat32BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)},t.readFloat32LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)},t.readFloat64BE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)},t.readFloat64LE=function(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)},t.writeFloat32BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e),t},t.writeFloat32LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e,!0),t},t.writeFloat64BE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e),t},t.writeFloat64LE=function(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e,!0),t}},96533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(29332),i=r(21230);function o(e,t,r){for(var i=1634760805,o=857760878,s=2036477234,a=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],h=r[11]<<24|r[10]<<16|r[9]<<8|r[8],l=r[15]<<24|r[14]<<16|r[13]<<8|r[12],f=r[19]<<24|r[18]<<16|r[17]<<8|r[16],d=r[23]<<24|r[22]<<16|r[21]<<8|r[20],p=r[27]<<24|r[26]<<16|r[25]<<8|r[24],y=r[31]<<24|r[30]<<16|r[29]<<8|r[28],g=t[3]<<24|t[2]<<16|t[1]<<8|t[0],m=t[7]<<24|t[6]<<16|t[5]<<8|t[4],b=t[11]<<24|t[10]<<16|t[9]<<8|t[8],v=t[15]<<24|t[14]<<16|t[13]<<8|t[12],w=i,_=o,E=s,S=a,M=u,A=c,I=h,k=l,T=f,R=d,P=p,C=y,O=g,x=m,B=b,D=v,N=0;N<20;N+=2)M=(M^=T=T+(O=(O^=w=w+M|0)>>>16|O<<16)|0)>>>20|M<<12,A=(A^=R=R+(x=(x^=_=_+A|0)>>>16|x<<16)|0)>>>20|A<<12,I=(I^=P=P+(B=(B^=E=E+I|0)>>>16|B<<16)|0)>>>20|I<<12,k=(k^=C=C+(D=(D^=S=S+k|0)>>>16|D<<16)|0)>>>20|k<<12,I=(I^=P=P+(B=(B^=E=E+I|0)>>>24|B<<8)|0)>>>25|I<<7,k=(k^=C=C+(D=(D^=S=S+k|0)>>>24|D<<8)|0)>>>25|k<<7,A=(A^=R=R+(x=(x^=_=_+A|0)>>>24|x<<8)|0)>>>25|A<<7,M=(M^=T=T+(O=(O^=w=w+M|0)>>>24|O<<8)|0)>>>25|M<<7,A=(A^=P=P+(D=(D^=w=w+A|0)>>>16|D<<16)|0)>>>20|A<<12,I=(I^=C=C+(O=(O^=_=_+I|0)>>>16|O<<16)|0)>>>20|I<<12,k=(k^=T=T+(x=(x^=E=E+k|0)>>>16|x<<16)|0)>>>20|k<<12,M=(M^=R=R+(B=(B^=S=S+M|0)>>>16|B<<16)|0)>>>20|M<<12,k=(k^=T=T+(x=(x^=E=E+k|0)>>>24|x<<8)|0)>>>25|k<<7,M=(M^=R=R+(B=(B^=S=S+M|0)>>>24|B<<8)|0)>>>25|M<<7,I=(I^=C=C+(O=(O^=_=_+I|0)>>>24|O<<8)|0)>>>25|I<<7,A=(A^=P=P+(D=(D^=w=w+A|0)>>>24|D<<8)|0)>>>25|A<<7;n.writeUint32LE(w+i|0,e,0),n.writeUint32LE(_+o|0,e,4),n.writeUint32LE(E+s|0,e,8),n.writeUint32LE(S+a|0,e,12),n.writeUint32LE(M+u|0,e,16),n.writeUint32LE(A+c|0,e,20),n.writeUint32LE(I+h|0,e,24),n.writeUint32LE(k+l|0,e,28),n.writeUint32LE(T+f|0,e,32),n.writeUint32LE(R+d|0,e,36),n.writeUint32LE(P+p|0,e,40),n.writeUint32LE(C+y|0,e,44),n.writeUint32LE(O+g|0,e,48),n.writeUint32LE(x+m|0,e,52),n.writeUint32LE(B+b|0,e,56),n.writeUint32LE(D+v|0,e,60)}function s(e,t,r,n,s){if(void 0===s&&(s=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var u,c;if(0===s){if(8!==t.length&&12!==t.length)throw new Error("ChaCha nonce must be 8 or 12 bytes");c=(u=new Uint8Array(16)).length-t.length,u.set(t,c)}else{if(16!==t.length)throw new Error("ChaCha nonce with counter must be 16 bytes");u=t,c=s}for(var h=new Uint8Array(64),l=0;l<r.length;l+=64){o(h,u,e);for(var f=l;f<l+64&&f<r.length;f++)n[f]=r[f]^h[f-l];a(u,0,c)}return i.wipe(h),0===s&&i.wipe(u),n}function a(e,t,r){for(var n=1;r--;)n=n+(255&e[t])|0,e[t]=255&n,n>>>=8,t++;if(n>0)throw new Error("ChaCha: counter overflow")}t.streamXOR=s,t.stream=function(e,t,r,n){return void 0===n&&(n=0),i.wipe(r),s(e,t,r,r,n)}},64776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(96533),i=r(93259),o=r(21230),s=r(29332),a=r(33015);t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var u=new Uint8Array(16),c=function(){function e(e){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,e.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return e.prototype.seal=function(e,t,r,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);n.stream(this._key,s,a,4);var u,c=t.length+this.tagLength;if(i){if(i.length!==c)throw new Error("ChaCha20Poly1305: incorrect destination length");u=i}else u=new Uint8Array(c);return n.streamXOR(this._key,s,t,u,4),this._authenticate(u.subarray(u.length-this.tagLength,u.length),a,u.subarray(0,u.length-this.tagLength),r),o.wipe(s),u},e.prototype.open=function(e,t,r,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(t.length<this.tagLength)return null;var s=new Uint8Array(16);s.set(e,s.length-e.length);var u=new Uint8Array(32);n.stream(this._key,s,u,4);var c=new Uint8Array(this.tagLength);if(this._authenticate(c,u,t.subarray(0,t.length-this.tagLength),r),!a.equal(c,t.subarray(t.length-this.tagLength,t.length)))return null;var h,l=t.length-this.tagLength;if(i){if(i.length!==l)throw new Error("ChaCha20Poly1305: incorrect destination length");h=i}else h=new Uint8Array(l);return n.streamXOR(this._key,s,t.subarray(0,t.length-this.tagLength),h,4),o.wipe(s),h},e.prototype.clean=function(){return o.wipe(this._key),this},e.prototype._authenticate=function(e,t,r,n){var a=new i.Poly1305(t);n&&(a.update(n),n.length%16>0&&a.update(u.subarray(n.length%16))),a.update(r),r.length%16>0&&a.update(u.subarray(r.length%16));var c=new Uint8Array(8);n&&s.writeUint64LE(n.length,c),a.update(c),s.writeUint64LE(r.length,c),a.update(c);for(var h=a.digest(),l=0;l<h.length;l++)e[l]=h[l];a.clean(),o.wipe(h),o.wipe(c)},e}();t.ChaCha20Poly1305=c},33015:(e,t)=>{"use strict";function r(e,t){if(e.length!==t.length)return 0;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return 1&r-1>>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,r){return~(e-1)&t|e-1&r},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=r,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==r(e,t)}},33156:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return"undefined"!==typeof e.saveState&&"undefined"!==typeof e.restoreState&&"undefined"!==typeof e.cleanSavedState}},48455:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(73108),i=r(21230),o=function(){function e(e,t,r,i){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=n.hmac(this._hash,r,t);this._hmac=new n.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(e){for(var t=new Uint8Array(e),r=0;r<t.length;r++)this._bufpos===this._buffer.length&&this._fillBuffer(),t[r]=this._buffer[this._bufpos++];return t},e.prototype.clean=function(){this._hmac.clean(),i.wipe(this._buffer),i.wipe(this._counter),this._bufpos=0},e}();t.HKDF=o},73108:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(33156),i=r(33015),o=r(21230),s=function(){function e(e,t){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var r=new Uint8Array(this.blockSize);t.length>this.blockSize?this._inner.update(t).finish(r).clean():r.set(t);for(var i=0;i<r.length;i++)r[i]^=54;this._inner.update(r);for(i=0;i<r.length;i++)r[i]^=106;this._outer.update(r),n.isSerializableHash(this._inner)&&n.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),o.wipe(r)}return e.prototype.reset=function(){if(!n.isSerializableHash(this._inner)||!n.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.clean=function(){n.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),n.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(e){return this._inner.update(e),this},e.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(!n.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(e){if(!n.isSerializableHash(this._inner)||!n.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(e){if(!n.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},e}();t.HMAC=s,t.hmac=function(e,t,r){var n=new s(e,t);n.update(r);var i=n.digest();return n.clean(),i},t.equal=i.equal},27774:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mul=Math.imul||function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<<t|e>>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},93259:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(33015),i=r(21230);t.DIGEST_LENGTH=16;var o=function(){function e(e){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var r=e[0]|e[1]<<8;this._r[0]=8191&r;var n=e[2]|e[3]<<8;this._r[1]=8191&(r>>>13|n<<3);var i=e[4]|e[5]<<8;this._r[2]=7939&(n>>>10|i<<6);var o=e[6]|e[7]<<8;this._r[3]=8191&(i>>>7|o<<9);var s=e[8]|e[9]<<8;this._r[4]=255&(o>>>4|s<<12),this._r[5]=s>>>1&8190;var a=e[10]|e[11]<<8;this._r[6]=8191&(s>>>14|a<<2);var u=e[12]|e[13]<<8;this._r[7]=8065&(a>>>11|u<<5);var c=e[14]|e[15]<<8;this._r[8]=8191&(u>>>8|c<<8),this._r[9]=c>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return e.prototype._blocks=function(e,t,r){for(var n=this._fin?0:2048,i=this._h[0],o=this._h[1],s=this._h[2],a=this._h[3],u=this._h[4],c=this._h[5],h=this._h[6],l=this._h[7],f=this._h[8],d=this._h[9],p=this._r[0],y=this._r[1],g=this._r[2],m=this._r[3],b=this._r[4],v=this._r[5],w=this._r[6],_=this._r[7],E=this._r[8],S=this._r[9];r>=16;){var M=e[t+0]|e[t+1]<<8;i+=8191&M;var A=e[t+2]|e[t+3]<<8;o+=8191&(M>>>13|A<<3);var I=e[t+4]|e[t+5]<<8;s+=8191&(A>>>10|I<<6);var k=e[t+6]|e[t+7]<<8;a+=8191&(I>>>7|k<<9);var T=e[t+8]|e[t+9]<<8;u+=8191&(k>>>4|T<<12),c+=T>>>1&8191;var R=e[t+10]|e[t+11]<<8;h+=8191&(T>>>14|R<<2);var P=e[t+12]|e[t+13]<<8;l+=8191&(R>>>11|P<<5);var C=e[t+14]|e[t+15]<<8,O=0,x=O;x+=i*p,x+=o*(5*S),x+=s*(5*E),x+=a*(5*_),O=(x+=u*(5*w))>>>13,x&=8191,x+=c*(5*v),x+=h*(5*b),x+=l*(5*m),x+=(f+=8191&(P>>>8|C<<8))*(5*g);var B=O+=(x+=(d+=C>>>5|n)*(5*y))>>>13;B+=i*y,B+=o*p,B+=s*(5*S),B+=a*(5*E),O=(B+=u*(5*_))>>>13,B&=8191,B+=c*(5*w),B+=h*(5*v),B+=l*(5*b),B+=f*(5*m),O+=(B+=d*(5*g))>>>13,B&=8191;var D=O;D+=i*g,D+=o*y,D+=s*p,D+=a*(5*S),O=(D+=u*(5*E))>>>13,D&=8191,D+=c*(5*_),D+=h*(5*w),D+=l*(5*v),D+=f*(5*b);var N=O+=(D+=d*(5*m))>>>13;N+=i*m,N+=o*g,N+=s*y,N+=a*p,O=(N+=u*(5*S))>>>13,N&=8191,N+=c*(5*E),N+=h*(5*_),N+=l*(5*w),N+=f*(5*v);var L=O+=(N+=d*(5*b))>>>13;L+=i*b,L+=o*m,L+=s*g,L+=a*y,O=(L+=u*p)>>>13,L&=8191,L+=c*(5*S),L+=h*(5*E),L+=l*(5*_),L+=f*(5*w);var K=O+=(L+=d*(5*v))>>>13;K+=i*v,K+=o*b,K+=s*m,K+=a*g,O=(K+=u*y)>>>13,K&=8191,K+=c*p,K+=h*(5*S),K+=l*(5*E),K+=f*(5*_);var U=O+=(K+=d*(5*w))>>>13;U+=i*w,U+=o*v,U+=s*b,U+=a*m,O=(U+=u*g)>>>13,U&=8191,U+=c*y,U+=h*p,U+=l*(5*S),U+=f*(5*E);var j=O+=(U+=d*(5*_))>>>13;j+=i*_,j+=o*w,j+=s*v,j+=a*b,O=(j+=u*m)>>>13,j&=8191,j+=c*g,j+=h*y,j+=l*p,j+=f*(5*S);var q=O+=(j+=d*(5*E))>>>13;q+=i*E,q+=o*_,q+=s*w,q+=a*v,O=(q+=u*b)>>>13,q&=8191,q+=c*m,q+=h*g,q+=l*y,q+=f*p;var F=O+=(q+=d*(5*S))>>>13;F+=i*S,F+=o*E,F+=s*_,F+=a*w,O=(F+=u*v)>>>13,F&=8191,F+=c*b,F+=h*m,F+=l*g,F+=f*y,i=x=8191&(O=(O=((O+=(F+=d*p)>>>13)<<2)+O|0)+(x&=8191)|0),o=B+=O>>>=13,s=D&=8191,a=N&=8191,u=L&=8191,c=K&=8191,h=U&=8191,l=j&=8191,f=q&=8191,d=F&=8191,t+=16,r-=16}this._h[0]=i,this._h[1]=o,this._h[2]=s,this._h[3]=a,this._h[4]=u,this._h[5]=c,this._h[6]=h,this._h[7]=l,this._h[8]=f,this._h[9]=d},e.prototype.finish=function(e,t){void 0===t&&(t=0);var r,n,i,o,s=new Uint16Array(10);if(this._leftover){for(o=this._leftover,this._buffer[o++]=1;o<16;o++)this._buffer[o]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,o=2;o<10;o++)this._h[o]+=r,r=this._h[o]>>>13,this._h[o]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,s[0]=this._h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this._h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this._h[o]=this._h[o]&n|s[o];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),i=this._h[0]+this._pad[0],this._h[0]=65535&i,o=1;o<8;o++)i=(this._h[o]+this._pad[o]|0)+(i>>>16)|0,this._h[o]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},e.prototype.update=function(e){var t,r=0,n=e.length;if(this._leftover){(t=16-this._leftover)>n&&(t=n);for(var i=0;i<t;i++)this._buffer[this._leftover+i]=e[r+i];if(n-=t,r+=t,this._leftover+=t,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(n>=16&&(t=n-n%16,this._blocks(e,r,t),r+=t,n-=t),n){for(i=0;i<n;i++)this._buffer[this._leftover+i]=e[r+i];this._leftover+=n}return this},e.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},e.prototype.clean=function(){return i.wipe(this._buffer),i.wipe(this._r),i.wipe(this._h),i.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},e}();t.Poly1305=o,t.oneTimeAuth=function(e,t){var r=new o(e);r.update(t);var n=r.digest();return r.clean(),n},t.equal=function(e,r){return e.length===t.DIGEST_LENGTH&&r.length===t.DIGEST_LENGTH&&n.equal(e,r)}},33898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(72654),i=r(29332),o=r(21230);function s(e,r){return void 0===r&&(r=t.defaultRandomSource),r.randomBytes(e)}t.defaultRandomSource=new n.SystemRandomSource,t.randomBytes=s,t.randomUint32=function(e){void 0===e&&(e=t.defaultRandomSource);var r=s(4,e),n=i.readUint32LE(r);return o.wipe(r),n};var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(e,r,n){if(void 0===r&&(r=a),void 0===n&&(n=t.defaultRandomSource),r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");for(var i="",u=r.length,c=256-256%u;e>0;){for(var h=s(Math.ceil(256*e/c),n),l=0;l<h.length&&e>0;l++){var f=h[l];f<c&&(i+=r.charAt(f%u),e--)}o.wipe(h)}return i}t.randomString=u,t.randomStringForEntropy=function(e,r,n){return void 0===r&&(r=a),void 0===n&&(n=t.defaultRandomSource),u(Math.ceil(e/(Math.log(r.length)/Math.LN2)),r,n)}},61486:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.isAvailable=!1,this.isInstantiated=!1;var e="undefined"!==typeof self?self.crypto||self.msCrypto:null;e&&e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}return e.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");for(var t=new Uint8Array(e),r=0;r<t.length;r+=65536)this._crypto.getRandomValues(t.subarray(r,r+Math.min(t.length-r,65536)));return t},e}();t.BrowserRandomSource=r},56099:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(21230),i=function(){function e(){this.isAvailable=!1,this.isInstantiated=!1;var e=r(75477);e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}return e.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");var t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");for(var r=new Uint8Array(e),i=0;i<r.length;i++)r[i]=t[i];return n.wipe(t),r},e}();t.NodeRandomSource=i},72654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(61486),i=r(56099),o=function(){function e(){return this.isAvailable=!1,this.name="",this._source=new n.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new i.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}return e.prototype.randomBytes=function(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)},e}();t.SystemRandomSource=o},51558:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(29332),i=r(21230);t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var o=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._temp),this.reset()},e.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[r++],t--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(r=a(this._temp,this._state,e,r,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[r++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t/536870912|0,o=t<<3,s=t%64<56?64:128;this._buffer[r]=128;for(var u=r+1;u<s-8;u++)this._buffer[u]=0;n.writeUint32BE(i,this._buffer,s-8),n.writeUint32BE(o,this._buffer,s-4),a(this._temp,this._state,this._buffer,0,s),this._finished=!0}for(u=0;u<this.digestLength/4;u++)n.writeUint32BE(this._state[u],e,4*u);return this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA256=o;var s=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(e,t,r,i,o){for(;o>=64;){for(var a=t[0],u=t[1],c=t[2],h=t[3],l=t[4],f=t[5],d=t[6],p=t[7],y=0;y<16;y++){var g=i+4*y;e[y]=n.readUint32BE(r,g)}for(y=16;y<64;y++){var m=e[y-2],b=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,v=((m=e[y-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3;e[y]=(b+e[y-7]|0)+(v+e[y-16]|0)}for(y=0;y<64;y++){b=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&f^~l&d)|0)+(p+(s[y]+e[y]|0)|0)|0,v=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&u^a&c^u&c)|0;p=d,d=f,f=l,l=h+b|0,h=c,c=u,u=a,a=b+v|0}t[0]+=a,t[1]+=u,t[2]+=c,t[3]+=h,t[4]+=l,t[5]+=f,t[6]+=d,t[7]+=p,i+=64,o-=64}return i}t.hash=function(e){var t=new o;t.update(e);var r=t.digest();return t.clean(),r}},21230:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t<e.length;t++)e[t]=0;return e}},63059:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(33898),i=r(21230);function o(e){var t=new Float64Array(16);if(e)for(var r=0;r<e.length;r++)t[r]=e[r];return t}t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;var s=new Uint8Array(32);s[0]=9;var a=o([56129,1]);function u(e){for(var t=1,r=0;r<16;r++){var n=e[r]+t+65535;t=Math.floor(n/65536),e[r]=n-65536*t}e[0]+=t-1+37*(t-1)}function c(e,t,r){for(var n=~(r-1),i=0;i<16;i++){var o=n&(e[i]^t[i]);e[i]^=o,t[i]^=o}}function h(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function l(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function f(e,t,r){var n,i,o=0,s=0,a=0,u=0,c=0,h=0,l=0,f=0,d=0,p=0,y=0,g=0,m=0,b=0,v=0,w=0,_=0,E=0,S=0,M=0,A=0,I=0,k=0,T=0,R=0,P=0,C=0,O=0,x=0,B=0,D=0,N=r[0],L=r[1],K=r[2],U=r[3],j=r[4],q=r[5],F=r[6],z=r[7],V=r[8],H=r[9],G=r[10],W=r[11],Y=r[12],Z=r[13],X=r[14],J=r[15];o+=(n=t[0])*N,s+=n*L,a+=n*K,u+=n*U,c+=n*j,h+=n*q,l+=n*F,f+=n*z,d+=n*V,p+=n*H,y+=n*G,g+=n*W,m+=n*Y,b+=n*Z,v+=n*X,w+=n*J,s+=(n=t[1])*N,a+=n*L,u+=n*K,c+=n*U,h+=n*j,l+=n*q,f+=n*F,d+=n*z,p+=n*V,y+=n*H,g+=n*G,m+=n*W,b+=n*Y,v+=n*Z,w+=n*X,_+=n*J,a+=(n=t[2])*N,u+=n*L,c+=n*K,h+=n*U,l+=n*j,f+=n*q,d+=n*F,p+=n*z,y+=n*V,g+=n*H,m+=n*G,b+=n*W,v+=n*Y,w+=n*Z,_+=n*X,E+=n*J,u+=(n=t[3])*N,c+=n*L,h+=n*K,l+=n*U,f+=n*j,d+=n*q,p+=n*F,y+=n*z,g+=n*V,m+=n*H,b+=n*G,v+=n*W,w+=n*Y,_+=n*Z,E+=n*X,S+=n*J,c+=(n=t[4])*N,h+=n*L,l+=n*K,f+=n*U,d+=n*j,p+=n*q,y+=n*F,g+=n*z,m+=n*V,b+=n*H,v+=n*G,w+=n*W,_+=n*Y,E+=n*Z,S+=n*X,M+=n*J,h+=(n=t[5])*N,l+=n*L,f+=n*K,d+=n*U,p+=n*j,y+=n*q,g+=n*F,m+=n*z,b+=n*V,v+=n*H,w+=n*G,_+=n*W,E+=n*Y,S+=n*Z,M+=n*X,A+=n*J,l+=(n=t[6])*N,f+=n*L,d+=n*K,p+=n*U,y+=n*j,g+=n*q,m+=n*F,b+=n*z,v+=n*V,w+=n*H,_+=n*G,E+=n*W,S+=n*Y,M+=n*Z,A+=n*X,I+=n*J,f+=(n=t[7])*N,d+=n*L,p+=n*K,y+=n*U,g+=n*j,m+=n*q,b+=n*F,v+=n*z,w+=n*V,_+=n*H,E+=n*G,S+=n*W,M+=n*Y,A+=n*Z,I+=n*X,k+=n*J,d+=(n=t[8])*N,p+=n*L,y+=n*K,g+=n*U,m+=n*j,b+=n*q,v+=n*F,w+=n*z,_+=n*V,E+=n*H,S+=n*G,M+=n*W,A+=n*Y,I+=n*Z,k+=n*X,T+=n*J,p+=(n=t[9])*N,y+=n*L,g+=n*K,m+=n*U,b+=n*j,v+=n*q,w+=n*F,_+=n*z,E+=n*V,S+=n*H,M+=n*G,A+=n*W,I+=n*Y,k+=n*Z,T+=n*X,R+=n*J,y+=(n=t[10])*N,g+=n*L,m+=n*K,b+=n*U,v+=n*j,w+=n*q,_+=n*F,E+=n*z,S+=n*V,M+=n*H,A+=n*G,I+=n*W,k+=n*Y,T+=n*Z,R+=n*X,P+=n*J,g+=(n=t[11])*N,m+=n*L,b+=n*K,v+=n*U,w+=n*j,_+=n*q,E+=n*F,S+=n*z,M+=n*V,A+=n*H,I+=n*G,k+=n*W,T+=n*Y,R+=n*Z,P+=n*X,C+=n*J,m+=(n=t[12])*N,b+=n*L,v+=n*K,w+=n*U,_+=n*j,E+=n*q,S+=n*F,M+=n*z,A+=n*V,I+=n*H,k+=n*G,T+=n*W,R+=n*Y,P+=n*Z,C+=n*X,O+=n*J,b+=(n=t[13])*N,v+=n*L,w+=n*K,_+=n*U,E+=n*j,S+=n*q,M+=n*F,A+=n*z,I+=n*V,k+=n*H,T+=n*G,R+=n*W,P+=n*Y,C+=n*Z,O+=n*X,x+=n*J,v+=(n=t[14])*N,w+=n*L,_+=n*K,E+=n*U,S+=n*j,M+=n*q,A+=n*F,I+=n*z,k+=n*V,T+=n*H,R+=n*G,P+=n*W,C+=n*Y,O+=n*Z,x+=n*X,B+=n*J,w+=(n=t[15])*N,s+=38*(E+=n*K),a+=38*(S+=n*U),u+=38*(M+=n*j),c+=38*(A+=n*q),h+=38*(I+=n*F),l+=38*(k+=n*z),f+=38*(T+=n*V),d+=38*(R+=n*H),p+=38*(P+=n*G),y+=38*(C+=n*W),g+=38*(O+=n*Y),m+=38*(x+=n*Z),b+=38*(B+=n*X),v+=38*(D+=n*J),o=(n=(o+=38*(_+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=u,e[4]=c,e[5]=h,e[6]=l,e[7]=f,e[8]=d,e[9]=p,e[10]=y,e[11]=g,e[12]=m,e[13]=b,e[14]=v,e[15]=w}function d(e,t){f(e,t,t)}function p(e,t){for(var r=new Uint8Array(32),n=new Float64Array(80),i=o(),s=o(),p=o(),y=o(),g=o(),m=o(),b=0;b<31;b++)r[b]=e[b];r[31]=127&e[31]|64,r[0]&=248,function(e,t){for(var r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(n,t);for(b=0;b<16;b++)s[b]=n[b];i[0]=y[0]=1;for(b=254;b>=0;--b){var v=r[b>>>3]>>>(7&b)&1;c(i,s,v),c(p,y,v),h(g,i,p),l(i,i,p),h(p,s,y),l(s,s,y),d(y,g),d(m,i),f(i,p,i),f(p,s,g),h(g,i,p),l(i,i,p),d(s,i),l(p,y,m),f(i,p,a),h(i,i,y),f(p,p,i),f(i,y,m),f(y,s,n),d(s,g),c(i,s,v),c(p,y,v)}for(b=0;b<16;b++)n[b+16]=i[b],n[b+32]=p[b],n[b+48]=s[b],n[b+64]=y[b];var w=n.subarray(32),_=n.subarray(16);!function(e,t){for(var r=o(),n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)d(r,r),2!==n&&4!==n&&f(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}(w,w),f(_,_,w);var E=new Uint8Array(32);return function(e,t){for(var r=o(),n=o(),i=0;i<16;i++)n[i]=t[i];u(n),u(n),u(n);for(var s=0;s<2;s++){for(r[0]=n[0]-65517,i=1;i<15;i++)r[i]=n[i]-65535-(r[i-1]>>16&1),r[i-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);var a=r[15]>>16&1;r[14]&=65535,c(n,r,1-a)}for(i=0;i<16;i++)e[2*i]=255&n[i],e[2*i+1]=n[i]>>8}(E,_),E}function y(e){return p(e,s)}function g(e){if(e.length!==t.SECRET_KEY_LENGTH)throw new Error("x25519: seed must be "+t.SECRET_KEY_LENGTH+" bytes");var r=new Uint8Array(e);return{publicKey:y(r),secretKey:r}}t.scalarMult=p,t.scalarMultBase=y,t.generateKeyPairFromSeed=g,t.generateKeyPair=function(e){var t=n.randomBytes(32,e),r=g(t);return i.wipe(t),r},t.sharedKey=function(e,r,n){if(void 0===n&&(n=!1),e.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(r.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");var i=p(e,r);if(n){for(var o=0,s=0;s<i.length;s++)o|=i[s];if(0===o)throw new Error("X25519: invalid shared key")}return i}},24014:(e,t)=>{"use strict";const r=Math.exp;e.exports=function(e){if("number"!==typeof e)throw new Error("must provide a timespan to the moving average constructor");if(e<=0)throw new Error("must provide a timespan > 0 to the moving average constructor");let t,n,i=0,o=0,s=0,a={};return a.push=function(a,u){if(n){const c=1-r(-(a-n)/e),h=u-t;t=c*u+(1-c)*t,i=(1-c)*(i+h*(c*h)),o=Math.sqrt(i),s=t+c*h}else t=u;n=a},a.movingAverage=function(){return t},a.variance=function(){return i},a.deviation=function(){return o},a.forecast=function(){return s},a}},90834:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!==typeof self?self:"undefined"!==typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},29633:e=>{e.exports=class extends Error{constructor(e,t){super(e||"The operation was aborted"),this.type="aborted",this.code=t||"ABORT_ERR"}}},1315:(e,t,r)=>{const n=r(56083),i=r(29633),o=(e,t,r)=>s(e,Array.isArray(t)?t:[{signal:t,options:r}]),s=(e,t)=>(e=n(e),t=t.map((e=>{let{signal:t,options:r}=e;return{signal:t,options:r||{}}})),async function*(){let r;const n=()=>{r&&r()};for(const{signal:e}of t)e.addEventListener("abort",n);for(;;){let s;try{for(const{signal:e,options:r}of t)if(e.aborted){const{abortMessage:e,abortCode:t}=r;throw new i(e,t)}const n=new Promise(((e,n)=>{r=()=>{const{options:e}=t.find((e=>{let{signal:t}=e;return t.aborted})),{abortMessage:r,abortCode:o}=e;n(new i(r,o))}}));s=await Promise.race([n,e.next()]),r=null}catch(o){for(const{signal:e}of t)e.removeEventListener("abort",n);const r=t.find((e=>{let{signal:t}=e;return t.aborted})),i="aborted"===o.type&&r;if(i&&r.options.onAbort&&await r.options.onAbort(e),"function"===typeof e.return&&await e.return(),i&&r.options.returnOnAbort)return;throw o}if(s.done)break;yield s.value}for(const{signal:e}of t)e.removeEventListener("abort",n)}()),a=(e,t,r)=>u(e,Array.isArray(t)?t:[{signal:t,options:r}]),u=(e,t)=>r=>e(s(r,t)),c=(e,t)=>({sink:u(e.sink,t),source:s(e.source,t)});e.exports=o,e.exports.AbortError=i,e.exports.source=o,e.exports.sink=a,e.exports.transform=a,e.exports.duplex=(e,t,r)=>c(e,Array.isArray(t)?t:[{signal:t,options:r}])},3579:(e,t,r)=>{"use strict";const n=r(13800),i=r(32475);class o extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got ".concat(typeof e));let t=(e=[...e].map((e=>e instanceof Error?e:null!==e&&"object"===typeof e?Object.assign(new Error(e.message),e):new Error(e)))).map((e=>"string"===typeof e.stack?i(e.stack).replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""):String(e))).join("\n");t="\n"+n(t,4),super(t),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:e})}*[Symbol.iterator](){for(const e of this._errors)yield e}}e.exports=o},93958:(e,t,r)=>{const{AbortController:n}=r(12023);function i(e){const t=new n;function r(){t.abort();for(const t of e)t&&t.removeEventListener&&t.removeEventListener("abort",r)}for(const n of e)if(n&&n.addEventListener){if(n.aborted){r();break}n.addEventListener("abort",r)}return t.signal}e.exports=i,e.exports.anySignal=i},26801:(e,t,r)=>{"use strict";var n=r(21964);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,s,a=r(92062).codes,u=a.ERR_AMBIGUOUS_ARGUMENT,c=a.ERR_INVALID_ARG_TYPE,h=a.ERR_INVALID_ARG_VALUE,l=a.ERR_INVALID_RETURN_VALUE,f=a.ERR_MISSING_ARGS,d=r(20758),p=r(40272).inspect,y=r(40272).types,g=y.isPromise,m=y.isRegExp,b=Object.assign?Object.assign:r(4683).assign,v=Object.is?Object.is:r(95812);new Map;function w(){var e=r(65489);o=e.isDeepEqual,s=e.isDeepStrictEqual}var _=!1,E=e.exports=I,S={};function M(e){if(e.message instanceof Error)throw e.message;throw new d(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 d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function I(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];A.apply(void 0,[I,t.length].concat(t))}E.fail=function e(t,r,i,o,s){var a,u=arguments.length;if(0===u)a="Failed";else if(1===u)i=t,t=void 0;else{if(!1===_){_=!0;var c=n.emitWarning?n.emitWarning:console.warn.bind(console);c("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===u&&(o="!=")}if(i instanceof Error)throw i;var h={actual:t,expected:r,operator:void 0===o?"fail":o,stackStartFn:s||e};void 0!==i&&(h.message=i);var l=new d(h);throw a&&(l.message=a,l.generatedMessage=!0),l},E.AssertionError=d,E.ok=I,E.equal=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");t!=r&&M({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},E.notEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");t==r&&M({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},E.deepEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===o&&w(),o(t,r)||M({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},E.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===o&&w(),o(t,r)&&M({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},E.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===o&&w(),s(t,r)||M({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},E.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===o&&w();s(t,r)&&M({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},E.strictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");v(t,r)||M({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},E.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");v(t,r)&&M({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var k=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]&&m(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function T(e,t,r,n,i,o){if(!(r in e)||!s(e[r],t[r])){if(!n){var a=new k(e,i),u=new k(t,i,e),c=new d({actual:a,expected:u,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=e,c.expected=t,c.operator=o.name,c}M({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}function R(e,t,r,n){if("function"!==typeof t){if(m(t))return t.test(e);if(2===arguments.length)throw new c("expected",["Function","RegExp"],t);if("object"!==i(e)||null===e){var s=new d({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw s.operator=n.name,s}var a=Object.keys(t);if(t instanceof Error)a.push("name","message");else if(0===a.length)throw new h("error",t,"may not be an empty object");return void 0===o&&w(),a.forEach((function(i){"string"===typeof e[i]&&m(t[i])&&t[i].test(e[i])||T(e,t,i,r,a,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 c("fn","Function",e);try{e()}catch(t){return t}return S}function C(e){return g(e)||null!==e&&"object"===i(e)&&"function"===typeof e.then&&"function"===typeof e.catch}function O(e){return Promise.resolve().then((function(){var t;if("function"===typeof e){if(!C(t=e()))throw new l("instance of Promise","promiseFn",t)}else{if(!C(e))throw new c("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return S})).catch((function(e){return e}))}))}function x(e,t,r,n){if("string"===typeof r){if(4===arguments.length)throw new c("error",["Object","Error","Function","RegExp"],r);if("object"===i(t)&&null!==t){if(t.message===r)throw new u("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new u("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 c("error",["Object","Error","Function","RegExp"],r);if(t===S){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";M({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(o),stackStartFn:e})}if(r&&!R(t,r,n,e))throw t}function B(e,t,r,n){if(t!==S){if("string"===typeof r&&(n=r,r=void 0),!r||R(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";M({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 D(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];A.apply(void 0,[D,t.length].concat(t))}E.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];x.apply(void 0,[e,P(t)].concat(n))},E.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 O(t).then((function(t){return x.apply(void 0,[e,t].concat(n))}))},E.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];B.apply(void 0,[e,P(t)].concat(n))},E.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 O(t).then((function(t){return B.apply(void 0,[e,t].concat(n))}))},E.ifError=function e(t){if(null!==t&&void 0!==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 d({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),o=t.stack;if("string"===typeof o){var s=o.split("\n");s.shift();for(var a=n.stack.split("\n"),u=0;u<s.length;u++){var c=a.indexOf(s[u]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},E.strict=b(D,E,{equal:E.strictEqual,deepEqual:E.deepStrictEqual,notEqual:E.notStrictEqual,notDeepEqual:E.notDeepStrictEqual}),E.strict.strict=E.strict},20758:(e,t,r)=>{"use strict";var n=r(21964);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 s(e,t){return!t||"object"!==d(t)&&"function"!==typeof t?a(e):t}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){var t="function"===typeof Map?new Map:void 0;return u=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("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return h(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,e)},u(e)}function c(){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}}function h(e,t,r){return h=c()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&l(i,r.prototype),i},h.apply(null,arguments)}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(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 p=r(40272).inspect,y=r(92062).codes.ERR_INVALID_ARG_TYPE;function g(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var m="",b="",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(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 p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(e,t,r){var i="",o="",s=0,a="",u=!1,c=S(e),h=c.split("\n"),l=S(t).split("\n"),f=0,p="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===h.length&&1===l.length&&h[0]!==l[0]){var y=h[0].length+l[0].length;if(y<=10){if(("object"!==d(e)||null===e)&&("object"!==d(t)||null===t)&&(0!==e||0!==t))return"".concat(_[r],"\n\n")+"".concat(h[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==r){if(y<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;h[0][f]===l[0][f];)f++;f>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)}(" ",f),"^"),f=0)}}}for(var E=h[h.length-1],M=l[l.length-1];E===M&&(f++<2?a="\n ".concat(E).concat(a):i=E,h.pop(),l.pop(),0!==h.length&&0!==l.length);)E=h[h.length-1],M=l[l.length-1];var A=Math.max(h.length,l.length);if(0===A){var I=c.split("\n");if(I.length>30)for(I[26]="".concat(m,"...").concat(w);I.length>27;)I.pop();return"".concat(_.notIdentical,"\n\n").concat(I.join("\n"),"\n")}f>3&&(a="\n".concat(m,"...").concat(w).concat(a),u=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var k=0,T=_[r]+"\n".concat(b,"+ actual").concat(w," ").concat(v,"- expected").concat(w),R=" ".concat(m,"...").concat(w," Lines skipped");for(f=0;f<A;f++){var P=f-s;if(h.length<f+1)P>1&&f>2&&(P>4?(o+="\n".concat(m,"...").concat(w),u=!0):P>3&&(o+="\n ".concat(l[f-2]),k++),o+="\n ".concat(l[f-1]),k++),s=f,i+="\n".concat(v,"-").concat(w," ").concat(l[f]),k++;else if(l.length<f+1)P>1&&f>2&&(P>4?(o+="\n".concat(m,"...").concat(w),u=!0):P>3&&(o+="\n ".concat(h[f-2]),k++),o+="\n ".concat(h[f-1]),k++),s=f,o+="\n".concat(b,"+").concat(w," ").concat(h[f]),k++;else{var C=l[f],O=h[f],x=O!==C&&(!g(O,",")||O.slice(0,-1)!==C);x&&g(C,",")&&C.slice(0,-1)===O&&(x=!1,O+=","),x?(P>1&&f>2&&(P>4?(o+="\n".concat(m,"...").concat(w),u=!0):P>3&&(o+="\n ".concat(h[f-2]),k++),o+="\n ".concat(h[f-1]),k++),s=f,o+="\n".concat(b,"+").concat(w," ").concat(O),i+="\n".concat(v,"-").concat(w," ").concat(C),k+=2):(o+=i,i="",1!==P&&0!==f||(o+="\n ".concat(O),k++))}if(k>20&&f<A-2)return"".concat(T).concat(R,"\n").concat(o,"\n").concat(m,"...").concat(w).concat(i,"\n")+"".concat(m,"...").concat(w)}return"".concat(T).concat(u?R:"","\n").concat(o).concat(i).concat(a).concat(p)}var A=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 y("options","Object",e);var i=e.message,o=e.operator,u=e.stackStartFn,c=e.actual,h=e.expected,l=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=s(this,f(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(m="\x1b[34m",b="\x1b[32m",w="\x1b[39m",v="\x1b[31m"):(m="",b="",w="",v="")),"object"===d(c)&&null!==c&&"object"===d(h)&&null!==h&&"stack"in c&&c instanceof Error&&"stack"in h&&h instanceof Error&&(c=E(c),h=E(h)),"deepStrictEqual"===o||"strictEqual"===o)r=s(this,f(t).call(this,M(c,h,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var p=_[o],g=S(c).split("\n");if("notStrictEqual"===o&&"object"===d(c)&&null!==c&&(p=_.notStrictEqualObject),g.length>30)for(g[26]="".concat(m,"...").concat(w);g.length>27;)g.pop();r=1===g.length?s(this,f(t).call(this,"".concat(p," ").concat(g[0]))):s(this,f(t).call(this,"".concat(p,"\n\n").concat(g.join("\n"),"\n")))}else{var A=S(c),I="",k=_[o];"notDeepEqual"===o||"notEqual"===o?(A="".concat(_[o],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(I="".concat(S(h)),A.length>512&&(A="".concat(A.slice(0,509),"...")),I.length>512&&(I="".concat(I.slice(0,509),"...")),"deepEqual"===o||"equal"===o?A="".concat(k,"\n\n").concat(A,"\n\nshould equal\n\n"):I=" ".concat(o," ").concat(I)),r=s(this,f(t).call(this,"".concat(A).concat(I)))}return Error.stackTraceLimit=l,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=h,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(r),u),r.stack,r.name="AssertionError",s(r)}var r,u,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&&l(e,t)}(t,e),r=t,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(e,t){return p(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}))}}],u&&o(r.prototype,u),c&&o(r,c),t}(u(Error));e.exports=A},92062:(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,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}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}var a,u,c={};function h(e,t,r){r||(r=Error);var n=function(r){function n(r,s,a){var u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),u=i(this,o(n).call(this,function(e,r,n){return"string"===typeof t?t:t(e,r,n)}(r,s,a))),u.code=e,u}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&&s(e,t)}(n,r),n}(r);c[e]=n}function l(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}h("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),h("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,s,u,c;if(void 0===a&&(a=r(26801)),a("string"===typeof e,"'name' must be a string"),"string"===typeof t&&(s="not ",t.substr(!u||u<0?0:+u,s.length)===s)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))c="The ".concat(e," ").concat(o," ").concat(l(t,"type"));else{var h=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";c='The "'.concat(e,'" ').concat(h," ").concat(o," ").concat(l(t,"type"))}return c+=". Received type ".concat(n(i))}),TypeError),h("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r(40272));var i=u.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),h("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),h("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===a&&(a=r(26801)),a(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=c},65489:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(u){i=!0,o=u}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}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=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},a=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},u=Object.is?Object.is:r(95812),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},h=Number.isNaN?Number.isNaN:r(56634);function l(e){return e.call.bind(e)}var f=l(Object.prototype.hasOwnProperty),d=l(Object.prototype.propertyIsEnumerable),p=l(Object.prototype.toString),y=r(40272).types,g=y.isAnyArrayBuffer,m=y.isArrayBufferView,b=y.isDate,v=y.isMap,w=y.isRegExp,_=y.isSet,E=y.isNativeError,S=y.isBoxedPrimitive,M=y.isNumberObject,A=y.isStringObject,I=y.isBooleanObject,k=y.isBigIntObject,T=y.isSymbolObject,R=y.isFloat32Array,P=y.isFloat64Array;function C(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function O(e){return Object.keys(e).filter(C).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function x(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function B(e,t,r,n){if(e===t)return 0!==e||(!r||u(e,t));if(r){if("object"!==i(e))return"number"===typeof e&&h(e)&&h(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var s,a,c,l,f=p(e);if(f!==p(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var d=O(e),y=O(t);return d.length===y.length&&N(e,t,r,n,1,d)}if("[object Object]"===f&&(!v(e)&&v(t)||!_(e)&&_(t)))return!1;if(b(e)){if(!b(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(c=e,l=t,!(o?c.source===l.source&&c.flags===l.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(l))))return!1}else if(E(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(m(e)){if(r||!R(e)&&!P(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===x(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var C=O(e),B=O(t);return C.length===B.length&&N(e,t,r,n,0,C)}if(_(e))return!(!_(t)||e.size!==t.size)&&N(e,t,r,n,2);if(v(e))return!(!v(t)||e.size!==t.size)&&N(e,t,r,n,3);if(g(e)){if(a=t,(s=e).byteLength!==a.byteLength||0!==x(new Uint8Array(s),new Uint8Array(a)))return!1}else if(S(e)&&!function(e,t){return M(e)?M(t)&&u(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):A(e)?A(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):I(e)?I(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):k(e)?k(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):T(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return N(e,t,r,n,0)}function D(e,t){return t.filter((function(t){return d(e,t)}))}function N(e,t,r,n,i,o){if(5===arguments.length){o=Object.keys(e);var s=Object.keys(t);if(o.length!==s.length)return!1}for(var a=0;a<o.length;a++)if(!f(t,o[a]))return!1;if(r&&5===arguments.length){var u=c(e);if(0!==u.length){var h=0;for(a=0;a<u.length;a++){var l=u[a];if(d(e,l)){if(!d(t,l))return!1;o.push(l),h++}else if(d(t,l))return!1}var p=c(t);if(u.length!==p.length&&D(t,p).length!==h)return!1}else{var y=c(t);if(0!==y.length&&0!==D(t,y).length)return!1}}if(0===o.length&&(0===i||1===i&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var g=n.val1.get(e);if(void 0!==g){var m=n.val2.get(t);if(void 0!==m)return g===m}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var b=F(e,t,r,o,n,i);return n.val1.delete(e),n.val2.delete(t),b}function L(e,t,r,n){for(var i=s(e),o=0;o<i.length;o++){var a=i[o];if(B(t,a,r,n))return e.delete(a),!0}return!1}function K(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(h(e))return!1}return!0}function U(e,t,r){var n=K(r);return null!=n?n:t.has(n)&&!e.has(n)}function j(e,t,r,n,i){var o=K(r);if(null!=o)return o;var s=t.get(o);return!(void 0===s&&!t.has(o)||!B(n,s,!1,i))&&(!e.has(o)&&B(n,s,!1,i))}function q(e,t,r,n,i,o){for(var a=s(e),u=0;u<a.length;u++){var c=a[u];if(B(r,c,i,o)&&B(n,t.get(c),i,o))return e.delete(c),!0}return!1}function F(e,t,r,o,u,c){var h=0;if(2===c){if(!function(e,t,r,n){for(var o=null,a=s(e),u=0;u<a.length;u++){var c=a[u];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!t.has(c)){if(r)return!1;if(!U(e,t,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var h=s(t),l=0;l<h.length;l++){var f=h[l];if("object"===i(f)&&null!==f){if(!L(o,f,r,n))return!1}else if(!r&&!e.has(f)&&!L(o,f,r,n))return!1}return 0===o.size}return!0}(e,t,r,u))return!1}else if(3===c){if(!function(e,t,r,o){for(var s=null,u=a(e),c=0;c<u.length;c++){var h=n(u[c],2),l=h[0],f=h[1];if("object"===i(l)&&null!==l)null===s&&(s=new Set),s.add(l);else{var d=t.get(l);if(void 0===d&&!t.has(l)||!B(f,d,r,o)){if(r)return!1;if(!j(e,t,l,f,o))return!1;null===s&&(s=new Set),s.add(l)}}}if(null!==s){for(var p=a(t),y=0;y<p.length;y++){var g=n(p[y],2),m=(l=g[0],g[1]);if("object"===i(l)&&null!==l){if(!q(s,e,l,m,r,o))return!1}else if(!r&&(!e.has(l)||!B(e.get(l),m,!1,o))&&!q(s,e,l,m,!1,o))return!1}return 0===s.size}return!0}(e,t,r,u))return!1}else if(1===c)for(;h<e.length;h++){if(!f(e,h)){if(f(t,h))return!1;for(var l=Object.keys(e);h<l.length;h++){var d=l[h];if(!f(t,d)||!B(e[d],t[d],r,u))return!1}return l.length===Object.keys(t).length}if(!f(t,h)||!B(e[h],t[h],r,u))return!1}for(h=0;h<o.length;h++){var p=o[h];if(!B(e[p],t[p],r,u))return!1}return!0}e.exports={isDeepEqual:function(e,t){return B(e,t,false)},isDeepStrictEqual:function(e,t){return B(e,t,true)}}},27229:(e,t,r)=>{e.exports=r(76656)},90685:(e,t,r)=>{"use strict";var n=r(8584),i=r(68147),o=r(32983),s=r(83745),a=r(30613),u=r(17443),c=r(3260),h=r(40974);e.exports=function(e){return new Promise((function(t,r){var l=e.data,f=e.headers,d=e.responseType;n.isFormData(l)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var y=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(y+":"+g)}var m=a(e.baseURL,e.url);function b(){if(p){var n="getAllResponseHeaders"in p?u(p.getAllResponseHeaders()):null,o={data:d&&"text"!==d&&"json"!==d?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};i(t,r,o),p=null}}if(p.open(e.method.toUpperCase(),s(m,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,"onloadend"in p?p.onloadend=b:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(b)},p.onabort=function(){p&&(r(h("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){r(h("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(h(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var v=(e.withCredentials||c(m))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;v&&(f[e.xsrfHeaderName]=v)}"setRequestHeader"in p&&n.forEach(f,(function(e,t){"undefined"===typeof l&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),d&&"json"!==d&&(p.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),r(e),p=null)})),l||(l=null),p.send(l)}))}},76656:(e,t,r)=>{"use strict";var n=r(8584),i=r(97066),o=r(5774),s=r(35817);function a(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var u=a(r(22836));u.Axios=o,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=r(91799),u.CancelToken=r(94510),u.isCancel=r(67344),u.all=function(e){return Promise.all(e)},u.spread=r(25259),u.isAxiosError=r(73569),e.exports=u,e.exports.default=u},91799:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},94510:(e,t,r)=>{"use strict";var n=r(91799);function i(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},67344:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},5774:(e,t,r)=>{"use strict";var n=r(8584),i=r(83745),o=r(47750),s=r(91676),a=r(35817),u=r(76236),c=u.validators;function h(e){this.defaults=e,this.interceptors={request:new o,response:new o}}h.prototype.request=function(e){"string"===typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"===typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!n){var h=[s,void 0];for(Array.prototype.unshift.apply(h,r),h.concat(o),i=Promise.resolve(e);h.length;)i=i.then(h.shift(),h.shift());return i}for(var l=e;r.length;){var f=r.shift(),d=r.shift();try{l=f(l)}catch(p){d(p);break}}try{i=s(l)}catch(p){return Promise.reject(p)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},h.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){h.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){h.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=h},47750:(e,t,r)=>{"use strict";var n=r(8584);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},30613:(e,t,r)=>{"use strict";var n=r(41195),i=r(19699);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},40974:(e,t,r)=>{"use strict";var n=r(85615);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},91676:(e,t,r)=>{"use strict";var n=r(8584),i=r(48421),o=r(67344),s=r(22836);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(a(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},85615:e=>{"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},35817:(e,t,r)=>{"use strict";var n=r(8584);e.exports=function(e,t){t=t||{};var r={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function u(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function c(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=u(void 0,e[i])):r[i]=u(e[i],t[i])}n.forEach(i,(function(e){n.isUndefined(t[e])||(r[e]=u(void 0,t[e]))})),n.forEach(o,c),n.forEach(s,(function(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=u(void 0,e[i])):r[i]=u(void 0,t[i])})),n.forEach(a,(function(n){n in t?r[n]=u(e[n],t[n]):n in e&&(r[n]=u(void 0,e[n]))}));var h=i.concat(o).concat(s).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===h.indexOf(e)}));return n.forEach(l,c),r}},68147:(e,t,r)=>{"use strict";var n=r(40974);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},48421:(e,t,r)=>{"use strict";var n=r(8584),i=r(22836);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},22836:(e,t,r)=>{"use strict";var n=r(21964),i=r(8584),o=r(64566),s=r(85615),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof n&&"[object process]"===Object.prototype.toString.call(n))&&(e=r(90685)),e}(),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)||t&&"application/json"===t["Content-Type"]?(u(t,"application/json"),JSON.stringify(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&i.isString(e)&&e.length)try{return JSON.parse(e)}catch(a){if(o){if("SyntaxError"===a.name)throw s(a,this,"E_JSON_PARSE");throw a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){c.headers[e]=i.merge(a)})),e.exports=c},97066:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},83745:(e,t,r)=>{"use strict";var n=r(8584);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!==e&&"undefined"!==typeof e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},19699:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},32983:(e,t,r)=>{"use strict";var n=r(8584);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},41195:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},73569:e=>{"use strict";e.exports=function(e){return"object"===typeof e&&!0===e.isAxiosError}},3260:(e,t,r)=>{"use strict";var n=r(8584);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},64566:(e,t,r)=>{"use strict";var n=r(8584);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},17443:(e,t,r)=>{"use strict";var n=r(8584),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},25259:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},76236:(e,t,r)=>{"use strict";var n=r(19521),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),i=0;i<3;i++){if(r[i]>n[i])return!0;if(r[i]<n[i])return!1}return!1}i.transitional=function(e,t,r){var i=t&&a(t);function s(e,t){return"[Axios v"+n.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,a){if(!1===e)throw new Error(s(n," has been removed in "+t));return i&&!o[n]&&(o[n]=!0,console.warn(s(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,a)}},e.exports={isOlderVersion:a,assertOptions:function(e,t,r){if("object"!==typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],s=t[o];if(s){var a=e[o],u=void 0===a||s(a,o,e);if(!0!==u)throw new TypeError("option "+o+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},8584:(e,t,r)=>{"use strict";var n=r(97066),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return"undefined"===typeof e}function a(e){return null!==e&&"object"===typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function h(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!==typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"===typeof e},isNumber:function(e){return"number"===typeof e},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)},forEach:h,merge:function e(){var t={};function r(r,n){u(t[n])&&u(r)?t[n]=e(t[n],r):u(r)?t[n]=e({},r):o(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)h(arguments[n],r);return t},extend:function(e,t,r){return h(t,(function(t,i){e[i]=r&&"function"===typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},79198:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=u(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),h=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[h++]=255&t);1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(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("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},78310:(e,t,r)=>{"use strict";var n=r(29536).Buffer;var i=r(73658);function o(e,t){return void 0===t&&(t="utf8"),n.isBuffer(e)?a(e.toString("base64")):a(n.from(e,t).toString("base64"))}function s(e){return e=e.toString(),i.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function a(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var u=o;u.encode=o,u.decode=function(e,t){return void 0===t&&(t="utf8"),n.from(s(e),"base64").toString(t)},u.toBase64=s,u.fromBase64=a,u.toBuffer=function(e){return n.from(s(e),"base64")},t.default=u},73658:(e,t,r)=>{"use strict";var n=r(29536).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.length,r=t%4;if(!r)return e;var i=t,o=4-r,s=t+o,a=n.alloc(s);for(a.write(e);o--;)a.write("=",i++);return a.toString()}},39390:(e,t,r)=>{e.exports=r(78310).default,e.exports.default=e.exports},17786:(e,t,r)=>{"use strict";var n=r(29536).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toBigIntLE=function(e){{const t=n.from(e);t.reverse();const r=t.toString("hex");return 0===r.length?BigInt(0):BigInt("0x".concat(r))}},t.toBigIntBE=function(e){{const t=e.toString("hex");return 0===t.length?BigInt(0):BigInt("0x".concat(t))}},t.toBufferLE=function(e,t){{const r=e.toString(16),i=n.from(r.padStart(2*t,"0").slice(0,2*t),"hex");return i.reverse(),i}},t.toBufferBE=function(e,t){{const r=e.toString(16);return n.from(r.padStart(2*t,"0").slice(0,2*t),"hex")}}},35438:function(e,t,r){var n;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,u=Math.floor,c="[BigNumber Error] ",h=c+"Number primitive has more than 15 significant digits: ",l=1e14,f=14,d=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,g=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function b(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=f-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function v(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,u=e.e,c=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=u==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function w(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function _(e){var t=e.c.length-1;return m(e.e/f)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function S(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}o=function e(t){var r,n,i,o=N.prototype={constructor:N,toString:null,valueOf:null},M=new N(1),A=20,I=4,k=-7,T=21,R=-1e7,P=1e7,C=!1,O=1,x=0,B={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},D="0123456789abcdefghijklmnopqrstuvwxyz";function N(e,t){var r,o,a,c,l,p,y,g,m=this;if(!(m instanceof N))return new N(e,t);if(null==t){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>P?m.c=m.e=null:e.e<R?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,l=e;l>=10;l/=10,c++);return void(c>P?m.c=m.e=null:(m.e=c,m.c=[e]))}g=String(e)}else{if(!s.test(g=String(e)))return i(m,g,p);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(c=g.indexOf("."))>-1&&(g=g.replace(".","")),(l=g.search(/e/i))>0?(c<0&&(c=l),c+=+g.slice(l+1),g=g.substring(0,l)):c<0&&(c=g.length)}else{if(w(t,2,D.length,"Base"),10==t)return j(m=new N(e),A+m.e+1,I);if(g=String(e),p="number"==typeof e){if(0*e!=0)return i(m,g,p,t);if(m.s=1/e<0?(g=g.slice(1),-1):1,N.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(h+e)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=D.slice(0,t),c=l=0,y=g.length;l<y;l++)if(r.indexOf(o=g.charAt(l))<0){if("."==o){if(l>c){c=y;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,l=-1,c=0;continue}return i(m,String(e),p,t)}p=!1,(c=(g=n(g,t,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):c=g.length}for(l=0;48===g.charCodeAt(l);l++);for(y=g.length;48===g.charCodeAt(--y););if(g=g.slice(l,++y)){if(y-=l,p&&N.DEBUG&&y>15&&(e>d||e!==u(e)))throw Error(h+m.s*e);if((c=c-l-1)>P)m.c=m.e=null;else if(c<R)m.c=[m.e=0];else{if(m.e=c,m.c=[],l=(c+1)%f,c<0&&(l+=f),l<y){for(l&&m.c.push(+g.slice(0,l)),y-=f;l<y;)m.c.push(+g.slice(l,l+=f));l=f-(g=g.slice(l)).length}else l-=y;for(;l--;g+="0");m.c.push(+g)}}else m.c=[m.e=0]}function L(e,t,r,n){var i,o,s,a,u;if(null==r?r=I:w(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)u=b(e.c),u=1==n||2==n&&(s<=k||s>=T)?E(u,s):S(u,s,"0");else if(o=(e=j(new N(e),t,r)).e,a=(u=b(e.c)).length,1==n||2==n&&(t<=o||o<=k)){for(;a<t;u+="0",a++);u=E(u,o)}else if(t-=s,u=S(u,o,"0"),o+1>a){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-a)>0)for(o+1==a&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function K(e,t){for(var r,n=1,i=new N(e[0]);n<e.length;n++){if(!(r=new N(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function U(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*f-1)>P?e.c=e.e=null:r<R?e.c=[e.e=0]:(e.e=r,e.c=t),e}function j(e,t,r,n){var i,o,s,c,h,d,y,g=e.c,m=p;if(g){e:{for(i=1,c=g[0];c>=10;c/=10,i++);if((o=t-i)<0)o+=f,s=t,y=(h=g[d=0])/m[i-s-1]%10|0;else if((d=a((o+1)/f))>=g.length){if(!n)break e;for(;g.length<=d;g.push(0));h=y=0,i=1,s=(o%=f)-f+1}else{for(h=c=g[d],i=1;c>=10;c/=10,i++);y=(s=(o%=f)-f+i)<0?0:h/m[i-s-1]%10|0}if(n=n||t<0||null!=g[d+1]||(s<0?h:h%m[i-s-1]),n=r<4?(y||n)&&(0==r||r==(e.s<0?3:2)):y>5||5==y&&(4==r||n||6==r&&(o>0?s>0?h/m[i-s]:0:g[d-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=m[(f-t%f)%f],e.e=-t||0):g[0]=e.e=0,e;if(0==o?(g.length=d,c=1,d--):(g.length=d+1,c=m[f-o],g[d]=s>0?u(h/m[i-s]%m[s])*c:0),n)for(;;){if(0==d){for(o=1,s=g[0];s>=10;s/=10,o++);for(s=g[0]+=c,c=1;s>=10;s/=10,c++);o!=c&&(e.e++,g[0]==l&&(g[0]=1));break}if(g[d]+=c,g[d]!=l)break;g[d--]=0,c=1}for(o=g.length;0===g[--o];g.pop());}e.e>P?e.c=e.e=null:e.e<R&&(e.c=[e.e=0])}return e}function q(e){var t,r=e.e;return null===r?e.toString():(t=b(e.c),t=r<=k||r>=T?E(t,r):S(t,r,"0"),e.s<0?"-"+t:t)}return N.clone=e,N.ROUND_UP=0,N.ROUND_DOWN=1,N.ROUND_CEIL=2,N.ROUND_FLOOR=3,N.ROUND_HALF_UP=4,N.ROUND_HALF_DOWN=5,N.ROUND_HALF_EVEN=6,N.ROUND_HALF_CEIL=7,N.ROUND_HALF_FLOOR=8,N.EUCLID=9,N.config=N.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(w(r=e[t],0,g,t),A=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(w(r=e[t],0,8,t),I=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(w(r[0],-g,0,t),w(r[1],0,g,t),k=r[0],T=r[1]):(w(r,-g,g,t),k=-(T=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)w(r[0],-g,-1,t),w(r[1],1,g,t),R=r[0],P=r[1];else{if(w(r,-g,g,t),!r)throw Error(c+t+" cannot be zero: "+r);R=-(P=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw C=!r,Error(c+"crypto unavailable");C=r}else C=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(w(r=e[t],0,9,t),O=r),e.hasOwnProperty(t="POW_PRECISION")&&(w(r=e[t],0,g,t),x=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);B=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);D=r}}return{DECIMAL_PLACES:A,ROUNDING_MODE:I,EXPONENTIAL_AT:[k,T],RANGE:[R,P],CRYPTO:C,MODULO_MODE:O,POW_PRECISION:x,FORMAT:B,ALPHABET:D}},N.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!N.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%f)<1&&(t+=f),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+e)},N.maximum=N.max=function(){return K(arguments,o.lt)},N.minimum=N.min=function(){return K(arguments,o.gt)},N.random=function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return u(Math.random()*e)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(e){var r,n,i,o,s,h=0,l=[],d=new N(M);if(null==e?e=A:w(e,0,g),o=a(e/f),C)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(o*=2));h<o;)(s=131072*r[h]+(r[h+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),r[h]=n[0],r[h+1]=n[1]):(l.push(s%1e14),h+=2);h=o/2}else{if(!crypto.randomBytes)throw C=!1,Error(c+"crypto unavailable");for(r=crypto.randomBytes(o*=7);h<o;)(s=281474976710656*(31&r[h])+1099511627776*r[h+1]+4294967296*r[h+2]+16777216*r[h+3]+(r[h+4]<<16)+(r[h+5]<<8)+r[h+6])>=9e15?crypto.randomBytes(7).copy(r,h):(l.push(s%1e14),h+=7);h=o/7}if(!C)for(;h<o;)(s=t())<9e15&&(l[h++]=s%1e14);for(o=l[--h],e%=f,o&&e&&(s=p[f-e],l[h]=u(o/s)*s);0===l[h];l.pop(),h--);if(h<0)l=[i=0];else{for(i=-1;0===l[0];l.splice(0,1),i-=f);for(h=1,s=l[0];s>=10;s/=10,h++);h<f&&(i-=f-h)}return d.e=i,d.c=l,d}}(),N.sum=function(){for(var e=1,t=arguments,r=new N(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,u=e.length;a<u;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var u,c,h,l,f,d,p,y,g=n.indexOf("."),m=A,v=I;for(g>=0&&(l=x,x=0,n=n.replace(".",""),d=(y=new N(i)).pow(n.length-g),x=l,y.c=t(S(b(d.c),d.e,"0"),10,o,e),y.e=y.c.length),h=l=(p=t(n,i,o,a?(u=D,e):(u=e,D))).length;0==p[--l];p.pop());if(!p[0])return u.charAt(0);if(g<0?--h:(d.c=p,d.e=h,d.s=s,p=(d=r(d,y,m,v,o)).c,f=d.r,h=d.e),g=p[c=h+m+1],l=o/2,f=f||c<0||null!=p[c+1],f=v<4?(null!=g||f)&&(0==v||v==(d.s<0?3:2)):g>l||g==l&&(4==v||f||6==v&&1&p[c-1]||v==(d.s<0?8:7)),c<1||!p[0])n=f?S(u.charAt(1),-m,u.charAt(0)):u.charAt(0);else{if(p.length=c,f)for(--o;++p[--c]>o;)p[c]=0,c||(++h,p=[1].concat(p));for(l=p.length;!p[--l];);for(g=0,n="";g<=l;n+=u.charAt(p[g++]));n=S(n,h,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,u=e.length,c=t%y,h=t/y|0;for(e=e.slice();u--;)a=((i=c*(o=e[u]%y)+(n=h*o+(s=e[u]/y|0)*c)%y*y+a)/r|0)+(n/y|0)+h*s,e[u]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,a){var c,h,d,p,y,g,b,v,w,_,E,S,M,A,I,k,T,R=n.s==i.s?1:-1,P=n.c,C=i.c;if(!P||!P[0]||!C||!C[0])return new N(n.s&&i.s&&(P?!C||P[0]!=C[0]:C)?P&&0==P[0]||!C?0*R:R/0:NaN);for(w=(v=new N(R)).c=[],R=o+(h=n.e-i.e)+1,a||(a=l,h=m(n.e/f)-m(i.e/f),R=R/f|0),d=0;C[d]==(P[d]||0);d++);if(C[d]>(P[d]||0)&&h--,R<0)w.push(1),p=!0;else{for(A=P.length,k=C.length,d=0,R+=2,(y=u(a/(C[0]+1)))>1&&(C=e(C,y,a),P=e(P,y,a),k=C.length,A=P.length),M=k,E=(_=P.slice(0,k)).length;E<k;_[E++]=0);T=C.slice(),T=[0].concat(T),I=C[0],C[1]>=a/2&&I++;do{if(y=0,(c=t(C,_,k,E))<0){if(S=_[0],k!=E&&(S=S*a+(_[1]||0)),(y=u(S/I))>1)for(y>=a&&(y=a-1),b=(g=e(C,y,a)).length,E=_.length;1==t(g,_,b,E);)y--,r(g,k<b?T:C,b,a),b=g.length,c=1;else 0==y&&(c=y=1),b=(g=C.slice()).length;if(b<E&&(g=[0].concat(g)),r(_,g,E,a),E=_.length,-1==c)for(;t(C,_,k,E)<1;)y++,r(_,k<E?T:C,E,a),E=_.length}else 0===c&&(y++,_=[0]);w[d++]=y,_[0]?_[E++]=P[M]||0:(_=[P[M]],E=1)}while((M++<A||null!=_[0])&&R--);p=null!=_[0],w[0]||w.splice(0,1)}if(a==l){for(d=1,R=w[0];R>=10;R/=10,d++);j(v,o+(v.e=d+h*f-1)+1,s,p)}else v.e=h,v.r=+p;return v}}(),i=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,r=/^\.([^.]+)$/,n=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,s,a,u){var h,l=a?s:s.replace(i,"");if(n.test(l))o.s=isNaN(l)?null:l<0?-1:1;else{if(!a&&(l=l.replace(e,(function(e,t,r){return h="x"==(r=r.toLowerCase())?16:"b"==r?2:8,u&&u!=h?e:t})),u&&(h=u,l=l.replace(t,"$1").replace(r,"0.$1")),s!=l))return new N(l,h);if(N.DEBUG)throw Error(c+"Not a"+(u?" base "+u:"")+" number: "+s);o.s=null}o.c=o.e=null}}(),o.absoluteValue=o.abs=function(){var e=new N(this);return e.s<0&&(e.s=1),e},o.comparedTo=function(e,t){return v(this,new N(e,t))},o.decimalPlaces=o.dp=function(e,t){var r,n,i,o=this;if(null!=e)return w(e,0,g),null==t?t=I:w(t,0,8),j(new N(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-m(this.e/f))*f,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},o.dividedBy=o.div=function(e,t){return r(this,new N(e,t),A,I)},o.dividedToIntegerBy=o.idiv=function(e,t){return r(this,new N(e,t),0,1)},o.exponentiatedBy=o.pow=function(e,t){var r,n,i,o,s,h,l,d,p=this;if((e=new N(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+q(e));if(null!=t&&(t=new N(t)),s=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return d=new N(Math.pow(+q(p),s?2-_(e):+q(e))),t?d.mod(t):d;if(h=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new N(NaN);(n=!h&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return o=p.s<0&&_(e)?-0:0,p.e>-1&&(o=1/o),new N(h?1/o:o);x&&(o=a(x/f+2))}for(s?(r=new N(.5),h&&(e.s=1),l=_(e)):l=(i=Math.abs(+q(e)))%2,d=new N(M);;){if(l){if(!(d=d.times(p)).c)break;o?d.c.length>o&&(d.c.length=o):n&&(d=d.mod(t))}if(i){if(0===(i=u(i/2)))break;l=i%2}else if(j(e=e.times(r),e.e+1,1),e.e>14)l=_(e);else{if(0===(i=+q(e)))break;l=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?d:(h&&(d=M.div(d)),t?d.mod(t):o?j(d,x,I,undefined):d)},o.integerValue=function(e){var t=new N(this);return null==e?e=I:w(e,0,8),j(t,t.e+1,e)},o.isEqualTo=o.eq=function(e,t){return 0===v(this,new N(e,t))},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(e,t){return v(this,new N(e,t))>0},o.isGreaterThanOrEqualTo=o.gte=function(e,t){return 1===(t=v(this,new N(e,t)))||0===t},o.isInteger=function(){return!!this.c&&m(this.e/f)>this.c.length-2},o.isLessThan=o.lt=function(e,t){return v(this,new N(e,t))<0},o.isLessThanOrEqualTo=o.lte=function(e,t){return-1===(t=v(this,new N(e,t)))||0===t},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&0==this.c[0]},o.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new N(e,t)).s,!a||!t)return new N(NaN);if(a!=t)return e.s=-t,s.plus(e);var u=s.e/f,c=e.e/f,h=s.c,d=e.c;if(!u||!c){if(!h||!d)return h?(e.s=-t,e):new N(d?s:NaN);if(!h[0]||!d[0])return d[0]?(e.s=-t,e):new N(h[0]?s:3==I?-0:0)}if(u=m(u),c=m(c),h=h.slice(),a=u-c){for((o=a<0)?(a=-a,i=h):(c=u,i=d),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=h.length)<(t=d.length))?a:t,a=t=0;t<n;t++)if(h[t]!=d[t]){o=h[t]<d[t];break}if(o&&(i=h,h=d,d=i,e.s=-e.s),(t=(n=d.length)-(r=h.length))>0)for(;t--;h[r++]=0);for(t=l-1;n>a;){if(h[--n]<d[n]){for(r=n;r&&!h[--r];h[r]=t);--h[r],h[n]+=l}h[n]-=d[n]}for(;0==h[0];h.splice(0,1),--c);return h[0]?U(e,h,c):(e.s=3==I?-1:1,e.c=[e.e=0],e)},o.modulo=o.mod=function(e,t){var n,i,o=this;return e=new N(e,t),!o.c||!e.s||e.c&&!e.c[0]?new N(NaN):!e.c||o.c&&!o.c[0]?new N(o):(9==O?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,O),(e=o.minus(n.times(e))).c[0]||1!=O||(e.s=o.s),e)},o.multipliedBy=o.times=function(e,t){var r,n,i,o,s,a,u,c,h,d,p,g,b,v,w,_=this,E=_.c,S=(e=new N(e,t)).c;if(!E||!S||!E[0]||!S[0])return!_.s||!e.s||E&&!E[0]&&!S||S&&!S[0]&&!E?e.c=e.e=e.s=null:(e.s*=_.s,E&&S?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=m(_.e/f)+m(e.e/f),e.s*=_.s,(u=E.length)<(d=S.length)&&(b=E,E=S,S=b,i=u,u=d,d=i),i=u+d,b=[];i--;b.push(0));for(v=l,w=y,i=d;--i>=0;){for(r=0,p=S[i]%w,g=S[i]/w|0,o=i+(s=u);o>i;)r=((c=p*(c=E[--s]%w)+(a=g*c+(h=E[s]/w|0)*p)%w*w+b[o]+r)/v|0)+(a/w|0)+g*h,b[o--]=c%v;b[o]=r}return r?++n:b.splice(0,1),U(e,b,n)},o.negated=function(){var e=new N(this);return e.s=-e.s||null,e},o.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new N(e,t)).s,!i||!t)return new N(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/f,s=e.e/f,a=n.c,u=e.c;if(!o||!s){if(!a||!u)return new N(i/0);if(!a[0]||!u[0])return u[0]?e:new N(a[0]?n:0*i)}if(o=m(o),s=m(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+u[t]+i)/l|0,a[t]=l===a[t]?0:a[t]%l;return i&&(a=[i].concat(a),++s),U(e,a,s)},o.precision=o.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return w(e,1,g),null==t?t=I:w(t,0,8),j(new N(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*f+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},o.shiftedBy=function(e){return w(e,-9007199254740991,d),this.times("1e"+e)},o.squareRoot=o.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,u=s.s,c=s.e,h=A+4,l=new N("0.5");if(1!==u||!a||!a[0])return new N(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+q(s)))||u==1/0?(((t=b(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=m((c+1)/2)-(c<0||c%2),n=new N(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new N(u+""),n.c[0])for((u=(c=n.e)+h)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(s,o,h,1))),b(o.c).slice(0,u)===(t=b(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(j(n,n.e+A+2,1),e=!n.times(n).eq(s));break}if(!i&&(j(o,o.e+A+2,0),o.times(o).eq(s))){n=o;break}h+=4,u+=4,i=1}return j(n,n.e+A+1,I,e)},o.toExponential=function(e,t){return null!=e&&(w(e,0,g),e++),L(this,e,t,1)},o.toFixed=function(e,t){return null!=e&&(w(e,0,g),e=e+this.e+1),L(this,e,t)},o.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=B;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,h=r.groupSeparator||"",l=s[0],f=s[1],d=i.s<0,p=d?l.slice(1):l,y=p.length;if(u&&(o=a,a=u,u=o,y-=o),a>0&&y>0){for(o=y%a||a,l=p.substr(0,o);o<y;o+=a)l+=h+p.substr(o,a);u>0&&(l+=h+p.slice(o)),d&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},o.toFraction=function(e){var t,n,i,o,s,a,u,h,l,d,y,g,m=this,v=m.c;if(null!=e&&(!(u=new N(e)).isInteger()&&(u.c||1!==u.s)||u.lt(M)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+q(u));if(!v)return new N(m);for(t=new N(M),l=n=new N(M),i=h=new N(M),g=b(v),s=t.e=g.length-m.e-1,t.c[0]=p[(a=s%f)<0?f+a:a],e=!e||u.comparedTo(t)>0?s>0?t:l:u,a=P,P=1/0,u=new N(g),h.c[0]=0;d=r(u,t,0,1),1!=(o=n.plus(d.times(i))).comparedTo(e);)n=i,i=o,l=h.plus(d.times(o=l)),h=o,t=u.minus(d.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),h=h.plus(o.times(l)),n=n.plus(o.times(i)),h.s=l.s=m.s,y=r(l,i,s*=2,I).minus(m).abs().comparedTo(r(h,n,s,I).minus(m).abs())<1?[l,i]:[h,n],P=a,y},o.toNumber=function(){return+q(this)},o.toPrecision=function(e,t){return null!=e&&w(e,1,g),L(this,e,t,2)},o.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=k||o>=T?E(b(r.c),o):S(b(r.c),o,"0"):10===e?t=S(b((r=j(new N(r),A+o+1,I)).c),r.e,"0"):(w(e,2,D.length,"Base"),t=n(S(b(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},o.valueOf=o.toJSON=function(){return q(this)},o._isBigNumber=!0,null!=t&&N.set(t),N}(),o.default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},64277:(e,t,r)=>{"use strict";const{Buffer:n}=r(29536),i=Symbol.for("BufferList");function o(e){if(!(this instanceof o))return new o(e);o._init.call(this,e)}o._init=function(e){Object.defineProperty(this,i,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},o.prototype._new=function(e){return new o(e)},o.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){const n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},o.prototype._reverseOffset=function(e){const t=e[0];let r=e[1];for(let n=0;n<t;n++)r+=this._bufs[n].length;return r},o.prototype.get=function(e){if(e>this.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},o.prototype.slice=function(e,t){return"number"===typeof e&&e<0&&(e+=this.length),"number"===typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},o.prototype.copy=function(e,t,r,i){if(("number"!==typeof r||r<0)&&(r=0),("number"!==typeof i||i>this.length)&&(i=this.length),r>=this.length)return e||n.alloc(0);if(i<=0)return e||n.alloc(0);const o=!!e,s=this._offset(r),a=i-r;let u=a,c=o&&t||0,h=s[1];if(0===r&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,c),c+=this._bufs[t].length;return e}if(u<=this._bufs[s[0]].length-h)return o?this._bufs[s[0]].copy(e,t,h,h+u):this._bufs[s[0]].slice(h,h+u);o||(e=n.allocUnsafe(a));for(let n=s[0];n<this._bufs.length;n++){const t=this._bufs[n].length-h;if(!(u>t)){this._bufs[n].copy(e,c,h,h+u),c+=t;break}this._bufs[n].copy(e,c,h),c+=t,u-=t,h&&(h=0)}return e.length>c?e.slice(0,c):e},o.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!==typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();const r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},o.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},o.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},o.prototype.duplicate=function(){const e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},o.prototype.append=function(e){if(null==e)return this;if(e.buffer)this._appendBuffer(n.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let t=0;t<e.length;t++)this.append(e[t]);else if(this._isBufferList(e))for(let t=0;t<e._bufs.length;t++)this.append(e._bufs[t]);else"number"===typeof e&&(e=e.toString()),this._appendBuffer(n.from(e));return this},o.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},o.prototype.indexOf=function(e,t,r){if(void 0===r&&"string"===typeof t&&(r=t,t=void 0),"function"===typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"===typeof e?e=n.from([e]):"string"===typeof e?e=n.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=n.from(e.buffer,e.byteOffset,e.byteLength):n.isBuffer(e)||(e=n.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;const i=this._offset(t);let o=i[0],s=i[1];for(;o<this._bufs.length;o++){const t=this._bufs[o];for(;s<t.length;){if(t.length-s>=e.length){const r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([o,r]);s=t.length-e.length+1}else{const t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}}s=0}return-1},o.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){const e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const t in e)!function(t){o.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.slice(r,r+e[t])[t](0)}}(t)}(),o.prototype._isBufferList=function(e){return e instanceof o||o.isBufferList(e)},o.isBufferList=function(e){return null!=e&&e[i]},e.exports=o},33248:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(33196).Buffer}catch(A){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],d=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?y+r:h[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n("undefined"!==typeof s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),c[o-a-1]=s}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],l=8191&h,f=h>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,M=E>>>13,A=0|s[5],I=8191&A,k=A>>>13,T=0|s[6],R=8191&T,P=T>>>13,C=0|s[7],O=8191&C,x=C>>>13,B=0|s[8],D=8191&B,N=B>>>13,L=0|s[9],K=8191&L,U=L>>>13,j=0|a[0],q=8191&j,F=j>>>13,z=0|a[1],V=8191&z,H=z>>>13,G=0|a[2],W=8191&G,Y=G>>>13,Z=0|a[3],X=8191&Z,J=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],le=8191&he,fe=he>>>13,de=0|a[9],pe=8191&de,ye=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(y,q)|0,o=Math.imul(y,F);var me=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(b,q)|0,o=Math.imul(b,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0;var be=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var ve=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,F))+Math.imul(k,q)|0,o=Math.imul(k,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,F))+Math.imul(P,q)|0,o=Math.imul(P,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,F))+Math.imul(x,q)|0,o=Math.imul(x,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Se=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,F))+Math.imul(N,q)|0,o=Math.imul(N,F),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Me=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(K,q),i=(i=Math.imul(K,F))+Math.imul(U,q)|0,o=Math.imul(U,F),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,H)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,fe)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(K,V),i=(i=Math.imul(K,H))+Math.imul(U,V)|0,o=Math.imul(U,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(K,W),i=(i=Math.imul(K,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,fe)|0;var ke=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(K,X),i=(i=Math.imul(K,J))+Math.imul(U,X)|0,o=Math.imul(U,J),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,fe)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(K,$),i=(i=Math.imul(K,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var Re=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(K,re),i=(i=Math.imul(K,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,fe)|0;var Pe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(K,oe),i=(i=Math.imul(K,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,fe)|0;var Ce=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(K,ue),i=(i=Math.imul(K,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,fe)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(K,le),i=(i=Math.imul(K,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var xe=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Be=(c+(n=Math.imul(K,pe))|0)+((8191&(i=(i=Math.imul(K,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ye))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ge,u[1]=me,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Se,u[8]=Me,u[9]=Ae,u[10]=Ie,u[11]=ke,u[12]=Te,u[13]=Re,u[14]=Pe,u[15]=Ce,u[16]=Oe,u[17]=xe,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;a=67108863&(f=f+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var l=u,f=c,d=0;d<s;d++){var p=r[h+d],y=n[h+d],g=r[h+d+s],m=n[h+d+s],b=l*g-f*m;m=l*m+f*g,g=b,r[h+d]=p+g,n[h+d]=y+m,r[h+d+s]=p-g,n[h+d+s]=y-m,d!==a&&(b=u*l-c*f,f=u*f+c*l,l=b)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,l,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"===typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(l)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(_,b),i(E,b),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return m[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(l,new o(1).iushln(p-g-1));f=f.redMul(m),l=m.redSqr(),d=d.redMul(l),p=g}return f},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},46804:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"===typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"===typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(38087);if("function"!==typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(s){}},29536:(e,t,r)=>{"use strict";const n=r(79198),i=r(20269),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,r)}function c(e,t,r){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!==typeof e.length||X(e.length)?a(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return h(e),a(e<0?0:0|p(e))}function f(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(X(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return Y(G(t,e.length-r),e,r,n)}function E(e,t,r,n){return Y(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return Y(W(t),e,r,n)}function M(e,t,r,n){return Y(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128===(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128===(192&r)&&128===(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128===(192&r)&&128===(192&n)&&128===(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?a(e):void 0!==t?"string"===typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},u.allocUnsafe=function(e){return l(e)},u.allocUnsafeSlow=function(e){return l(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),h=e.slice(t,r);for(let u=0;u<a;++u)if(c[u]!==h[u]){o=c[u],s=h[u];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"===typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function P(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=t;o<r;++o)i+=J[e[o]];return i}function C(e,t,r){const n=e.slice(t,r);let i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function O(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function B(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function D(e,t,r,n,i){F(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function K(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Q((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Q((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Q((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=Q((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Q((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Q((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return K(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return K(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"===typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"===typeof e){if("string"===typeof t?(n=t,t=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"===typeof e?e&=255:"boolean"===typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const U={};function j(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name="".concat(this.name," [").concat(e,"]"),this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function F(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"===typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat(8*(o+1)).concat(n):">= -(2".concat(n," ** ").concat(8*(o+1)-1).concat(n,") and < 2 ** ")+"".concat(8*(o+1)-1).concat(n):">= ".concat(t).concat(n," and <= ").concat(r).concat(n),new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function z(e,t){if("number"!==typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"===typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i),n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function Y(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!==e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Q(e){return"undefined"===typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},28136:(e,t,r)=>{"use strict";var n=r(66953),i=r(811),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"===typeof r&&o(e,".prototype.")>-1?i(r):r}},811:(e,t,r)=>{"use strict";var n=r(47022),i=r(66953),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),h=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(f){c=null}e.exports=function(e){var t=a(n,s,arguments);if(u&&c){var r=u(t,"length");r.configurable&&c(t,"length",{value:1+h(0,e.length-(arguments.length-1))})}return t};var l=function(){return a(n,o,arguments)};c?c(e.exports,"apply",{value:l}):e.exports.apply=l},93077:e=>{"use strict";e.exports=function(e,t){let{className:r,symbolName:n}=t;const i=Symbol.for(n),o={[r]:class extends e{constructor(){super(...arguments),Object.defineProperty(this,i,{value:!0})}get[Symbol.toStringTag](){return r}}}[r];return o["is".concat(r)]=e=>!(!e||!e[i]),o},e.exports.proto=function(e,t){let{className:r,symbolName:n,withoutNew:i}=t;const o=Symbol.for(n),s={[r]:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(i&&!(this instanceof s))return new s(...r);const a=e.call(this,...r)||this;return a&&!a[o]&&Object.defineProperty(a,o,{value:!0}),a}}[r];return s.prototype=Object.create(e.prototype),s.prototype.constructor=s,Object.defineProperty(s.prototype,Symbol.toStringTag,{get:()=>r}),s["is".concat(r)]=e=>!(!e||!e[o]),s}},32475:(e,t,r)=>{"use strict";const n=r(67129),i=/\s+at.*(?:\(|\s)(.*)\)?/,o=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,s="undefined"===typeof n.homedir?"":n.homedir();e.exports=(e,t)=>(t=Object.assign({pretty:!1},t),e.replace(/\\/g,"/").split("\n").filter((e=>{const t=e.match(i);if(null===t||!t[1])return!0;const r=t[1];return!r.includes(".app/Contents/Resources/electron.asar")&&!r.includes(".app/Contents/Resources/default_app.asar")&&!o.test(r)})).filter((e=>""!==e.trim())).map((e=>t.pretty?e.replace(i,((e,t)=>e.replace(t,t.replace(s,"~")))):e)).join("\n"))},39287:(e,t,r)=>{var n=r(21964);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(r){}!e&&"undefined"!==typeof n&&"env"in n&&(e={NODE_ENV:"production",PUBLIC_URL:"/js-waku",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.DEBUG);return e},t.useColors=function(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(75935)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},75935:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];if(!a.enabled)return;const o=a,s=Number(new Date),u=s-(r||s);o.diff=u,o.prev=r,o.curr=s,r=s,n[0]=t.coerce(n[0]),"string"!==typeof n[0]&&n.unshift("%O");let c=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,((e,r)=>{if("%%"===e)return"%";c++;const i=t.formatters[r];if("function"===typeof i){const t=n[c];e=i.call(o,t),n.splice(c,1),c--}return e})),t.formatArgs.call(o,n);const h=o.log||t.log;h.apply(o,n)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"===typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+("undefined"===typeof r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"===typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(18173),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},91157:(e,t,r)=>{"use strict";var n=r(59998),i="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,u=a&&function(){var e={};try{for(var t in a(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(r){return!1}}(),c=function(e,t,r,n){var i;(!(t in e)||"function"===typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(u?a(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},h=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=s.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)c(e,o[a],t[o[a]],r[o[a]])};h.supportsDescriptors=!!u,e.exports=h},38350:e=>{"use strict";function t(e,t){t=t||{};this._head=0,this._tail=0,this._capacity=t.capacity,this._capacityMask=3,this._list=new Array(4),Array.isArray(e)&&this._fromArray(e)}t.prototype.peekAt=function(e){var t=e;if(t===(0|t)){var r=this.size();if(!(t>=r||t<-r))return t<0&&(t+=r),t=this._head+t&this._capacityMask,this._list[t]}},t.prototype.get=function(e){return this.peekAt(e)},t.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]},t.prototype.peekFront=function(){return this.peek()},t.prototype.peekBack=function(){return this.peekAt(-1)},Object.defineProperty(t.prototype,"length",{get:function(){return this.size()}}),t.prototype.size=function(){return this._head===this._tail?0:this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.unshift=function(e){if(void 0===e)return this.size();var t=this._list.length;return this._head=this._head-1+t&this._capacityMask,this._list[this._head]=e,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.pop(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.shift=function(){var e=this._head;if(e!==this._tail){var t=this._list[e];return this._list[e]=void 0,this._head=e+1&this._capacityMask,e<2&&this._tail>1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),t}},t.prototype.push=function(e){if(void 0===e)return this.size();var t=this._tail;return this._list[t]=e,this._tail=t+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.pop=function(){var e=this._tail;if(e!==this._head){var t=this._list.length;this._tail=e-1+t&this._capacityMask;var r=this._list[this._tail];return this._list[this._tail]=void 0,this._head<2&&e>1e4&&e<=t>>>2&&this._shrinkArray(),r}},t.prototype.removeOne=function(e){var t=e;if(t===(0|t)&&this._head!==this._tail){var r=this.size(),n=this._list.length;if(!(t>=r||t<-r)){t<0&&(t+=r),t=this._head+t&this._capacityMask;var i,o=this._list[t];if(e<r/2){for(i=e;i>0;i--)this._list[t]=this._list[t=t-1+n&this._capacityMask];this._list[t]=void 0,this._head=this._head+1+n&this._capacityMask}else{for(i=r-1-e;i>0;i--)this._list[t]=this._list[t=t+1+n&this._capacityMask];this._list[t]=void 0,this._tail=this._tail-1+n&this._capacityMask}return o}}},t.prototype.remove=function(e,t){var r,n=e,i=t;if(n===(0|n)&&this._head!==this._tail){var o=this.size(),s=this._list.length;if(!(n>=o||n<-o||t<1)){if(n<0&&(n+=o),1===t||!t)return(r=new Array(1))[0]=this.removeOne(n),r;if(0===n&&n+t>=o)return r=this.toArray(),this.clear(),r;var a;for(n+t>o&&(t=o-n),r=new Array(t),a=0;a<t;a++)r[a]=this._list[this._head+n+a&this._capacityMask];if(n=this._head+n&this._capacityMask,e+t===o){for(this._tail=this._tail-t+s&this._capacityMask,a=t;a>0;a--)this._list[n=n+1+s&this._capacityMask]=void 0;return r}if(0===e){for(this._head=this._head+t+s&this._capacityMask,a=t-1;a>0;a--)this._list[n=n+1+s&this._capacityMask]=void 0;return r}if(n<o/2){for(this._head=this._head+e+t+s&this._capacityMask,a=e;a>0;a--)this.unshift(this._list[n=n-1+s&this._capacityMask]);for(n=this._head-1+s&this._capacityMask;i>0;)this._list[n=n-1+s&this._capacityMask]=void 0,i--;e<0&&(this._tail=n)}else{for(this._tail=n,n=n+t+s&this._capacityMask,a=o-(t+e);a>0;a--)this.push(this._list[n++]);for(n=this._tail;i>0;)this._list[n=n+1+s&this._capacityMask]=void 0,i--}return this._head<2&&this._tail>1e4&&this._tail<=s>>>2&&this._shrinkArray(),r}}},t.prototype.splice=function(e,t){var r=e;if(r===(0|r)){var n=this.size();if(r<0&&(r+=n),!(r>n)){if(arguments.length>2){var i,o,s,a=arguments.length,u=this._list.length,c=2;if(!n||r<n/2){for(o=new Array(r),i=0;i<r;i++)o[i]=this._list[this._head+i&this._capacityMask];for(0===t?(s=[],r>0&&(this._head=this._head+r+u&this._capacityMask)):(s=this.remove(r,t),this._head=this._head+r+u&this._capacityMask);a>c;)this.unshift(arguments[--a]);for(i=r;i>0;i--)this.unshift(o[i-1])}else{var h=(o=new Array(n-(r+t))).length;for(i=0;i<h;i++)o[i]=this._list[this._head+r+t+i&this._capacityMask];for(0===t?(s=[],r!=n&&(this._tail=this._head+r+u&this._capacityMask)):(s=this.remove(r,t),this._tail=this._tail-h+u&this._capacityMask);c<a;)this.push(arguments[c++]);for(i=0;i<h;i++)this.push(o[i])}return s}return this.remove(r,t)}}},t.prototype.clear=function(){this._head=0,this._tail=0},t.prototype.isEmpty=function(){return this._head===this._tail},t.prototype.toArray=function(){return this._copyArray(!1)},t.prototype._fromArray=function(e){for(var t=0;t<e.length;t++)this.push(e[t])},t.prototype._copyArray=function(e){var t,r=[],n=this._list,i=n.length;if(e||this._head>this._tail){for(t=this._head;t<i;t++)r.push(n[t]);for(t=0;t<this._tail;t++)r.push(n[t])}else for(t=this._head;t<this._tail;t++)r.push(n[t]);return r},t.prototype._growArray=function(){this._head&&(this._list=this._copyArray(!0),this._head=0),this._tail=this._list.length,this._list.length*=2,this._capacityMask=this._capacityMask<<1|1},t.prototype._shrinkArray=function(){this._list.length>>>=1,this._capacityMask>>>=1},e.exports=t},19120:(e,t,r)=>{"use strict";const n=r(39287),i=n("dns-over-http-resolver");i.error=n("dns-over-http-resolver:error");const o=r(1441),s=r(5782);class a{constructor(){let{maxCache:e=100}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._cache=new o({max:e}),this._servers=["https://cloudflare-dns.com/dns-query","https://dns.google/resolve"]}getServers(){return this._servers}_getShuffledServers(){const e=[].concat(this._servers);for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*t),n=e[t];e[t]=e[r],e[r]=n}return e}setServers(e){this._servers=e}resolve(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A";switch(t){case"A":return this.resolve4(e);case"AAAA":return this.resolve6(e);case"TXT":return this.resolveTxt(e);default:throw new Error("".concat(t," is not supported"))}}async resolve4(e){const t="A",r=this._cache.get(s.getCacheKey(e,t));if(r)return r;for(const o of this._getShuffledServers())try{const r=await s.fetch(s.buildResource({serverResolver:o,hostname:e,recordType:t})),n=await r.json(),i=n.Answer.map((e=>e.data)),a=Math.min(n.Answer.map((e=>e.TTL)));return this._cache.set(s.getCacheKey(e,t),i,{ttl:a}),i}catch(n){i.error("".concat(o," could not resolve ").concat(e," record ").concat(t))}throw new Error("Could not resolve ".concat(e," record ").concat(t))}async resolve6(e){const t="AAAA",r=this._cache.get(s.getCacheKey(e,t));if(r)return r;for(const o of this._getShuffledServers())try{const r=await s.fetch(s.buildResource({serverResolver:o,hostname:e,recordType:t})),n=await r.json(),i=n.Answer.map((e=>e.data)),a=Math.min(n.Answer.map((e=>e.TTL)));return this._cache.set(s.getCacheKey(e,t),i,{ttl:a}),i}catch(n){i.error("".concat(o," could not resolve ").concat(e," record ").concat(t))}throw new Error("Could not resolve ".concat(e," record ").concat(t))}async resolveTxt(e){const t="TXT",r=this._cache.get(s.getCacheKey(e,t));if(r)return r;for(const o of this._getShuffledServers())try{const r=await s.fetch(s.buildResource({serverResolver:o,hostname:e,recordType:t})),n=await r.json(),i=n.Answer.map((e=>[e.data.replace(/['"]+/g,"")])),a=Math.min(n.Answer.map((e=>e.TTL)));return this._cache.set(s.getCacheKey(e,t),i,{ttl:a}),i}catch(n){i.error("".concat(o," could not resolve ").concat(e," record ").concat(t))}throw new Error("Could not resolve ".concat(e," record ").concat(t))}}a.Resolver=a,e.exports=a},5782:(e,t,r)=>{"use strict";const{default:n,Headers:i}=r(8113);e.exports={buildResource:function(e){let{serverResolver:t,hostname:r,recordType:n}=e;return"".concat(t,"?name=").concat(r,"&type=").concat(n)},fetch:function(e){return n(e,{headers:new i({accept:"application/dns-json"})})},getCacheKey:function(e,t){return"".concat(t,"_").concat(e)}}},19557:(e,t)=>{"use strict";t.toString=function(e){switch(e){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+e},t.toClass=function(e){switch(e.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}},68818:(e,t,r)=>{"use strict";const n=r(29536).Buffer,i=r(87123),o=r(75738),s=r(59789),a=r(19557),u=r(18302),c=r(92981),h=32768,l=t.name={};l.encode=function(e,t,r){t||(t=n.alloc(l.encodingLength(e))),r||(r=0);const i=r,o=e.replace(/^\.|\.$/gm,"");if(o.length){const e=o.split(".");for(let n=0;n<e.length;n++){const i=t.write(e[n],r+1);t[r]=i,r+=i+1}}return t[r++]=0,l.encode.bytes=r-i,t},l.encode.bytes=0,l.decode=function(e,t){t||(t=0);const r=[];let n=t,i=0,o=0,s=!1;for(;;){if(t>=e.length)throw new Error("Cannot decode name (buffer overflow)");const a=e[t++];if(o+=s?0:1,0===a)break;if(0===(192&a)){if(t+a>e.length)throw new Error("Cannot decode name (buffer overflow)");if(i+=a+1,i>254)throw new Error("Cannot decode name (name too long)");r.push(e.toString("utf-8",t,t+a)),t+=a,o+=s?0:a}else{if(192!==(192&a))throw new Error("Cannot decode name (bad label)");{if(t+1>e.length)throw new Error("Cannot decode name (buffer overflow)");const r=e.readUInt16BE(t-1)-49152;if(r>=n)throw new Error("Cannot decode name (bad pointer)");t=r,n=r,o+=s?0:1,s=!0}}}return l.decode.bytes=o,0===r.length?".":r.join(".")},l.decode.bytes=0,l.encodingLength=function(e){return"."===e||".."===e?1:n.byteLength(e.replace(/^\.|\.$/gm,""))+2};const f={encode:function(e,t,r){t||(t=n.alloc(f.encodingLength(e))),r||(r=0);const i=t.write(e,r+1);return t[r]=i,f.encode.bytes=i+1,t}};f.encode.bytes=0,f.decode=function(e,t){t||(t=0);const r=e[t],n=e.toString("utf-8",t+1,t+1+r);return f.decode.bytes=r+1,n},f.decode.bytes=0,f.encodingLength=function(e){return n.byteLength(e)+1};const d={encode:function(e,t,r){t||(t=d.encodingLength(e)),r||(r=0);const n=32767&(e.flags||0),i="response"===e.type?32768:0;return t.writeUInt16BE(e.id||0,r),t.writeUInt16BE(n|i,r+2),t.writeUInt16BE(e.questions.length,r+4),t.writeUInt16BE(e.answers.length,r+6),t.writeUInt16BE(e.authorities.length,r+8),t.writeUInt16BE(e.additionals.length,r+10),t}};d.encode.bytes=12,d.decode=function(e,t){if(t||(t=0),e.length<12)throw new Error("Header must be 12 bytes");const r=e.readUInt16BE(t+2);return{id:e.readUInt16BE(t),type:32768&r?"response":"query",flags:32767&r,flag_qr:1===(r>>15&1),opcode:s.toString(r>>11&15),flag_aa:1===(r>>10&1),flag_tc:1===(r>>9&1),flag_rd:1===(r>>8&1),flag_ra:1===(r>>7&1),flag_z:1===(r>>6&1),flag_ad:1===(r>>5&1),flag_cd:1===(r>>4&1),rcode:o.toString(15&r),questions:new Array(e.readUInt16BE(t+4)),answers:new Array(e.readUInt16BE(t+6)),authorities:new Array(e.readUInt16BE(t+8)),additionals:new Array(e.readUInt16BE(t+10))}},d.decode.bytes=12,d.encodingLength=function(){return 12};const p=t.unknown={};p.encode=function(e,t,r){return t||(t=n.alloc(p.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.length,r),e.copy(t,r+2),p.encode.bytes=e.length+2,t},p.encode.bytes=0,p.decode=function(e,t){t||(t=0);const r=e.readUInt16BE(t),n=e.slice(t+2,t+2+r);return p.decode.bytes=r+2,n},p.decode.bytes=0,p.encodingLength=function(e){return e.length+2};const y=t.ns={};y.encode=function(e,t,r){return t||(t=n.alloc(y.encodingLength(e))),r||(r=0),l.encode(e,t,r+2),t.writeUInt16BE(l.encode.bytes,r),y.encode.bytes=l.encode.bytes+2,t},y.encode.bytes=0,y.decode=function(e,t){t||(t=0);const r=e.readUInt16BE(t),n=l.decode(e,t+2);return y.decode.bytes=r+2,n},y.decode.bytes=0,y.encodingLength=function(e){return l.encodingLength(e)+2};const g=t.soa={};g.encode=function(e,t,r){t||(t=n.alloc(g.encodingLength(e))),r||(r=0);const i=r;return r+=2,l.encode(e.mname,t,r),r+=l.encode.bytes,l.encode(e.rname,t,r),r+=l.encode.bytes,t.writeUInt32BE(e.serial||0,r),r+=4,t.writeUInt32BE(e.refresh||0,r),r+=4,t.writeUInt32BE(e.retry||0,r),r+=4,t.writeUInt32BE(e.expire||0,r),r+=4,t.writeUInt32BE(e.minimum||0,r),r+=4,t.writeUInt16BE(r-i-2,i),g.encode.bytes=r-i,t},g.encode.bytes=0,g.decode=function(e,t){t||(t=0);const r=t,n={};return t+=2,n.mname=l.decode(e,t),t+=l.decode.bytes,n.rname=l.decode(e,t),t+=l.decode.bytes,n.serial=e.readUInt32BE(t),t+=4,n.refresh=e.readUInt32BE(t),t+=4,n.retry=e.readUInt32BE(t),t+=4,n.expire=e.readUInt32BE(t),t+=4,n.minimum=e.readUInt32BE(t),t+=4,g.decode.bytes=t-r,n},g.decode.bytes=0,g.encodingLength=function(e){return 22+l.encodingLength(e.mname)+l.encodingLength(e.rname)};const m=t.txt={};m.encode=function(e,t,r){Array.isArray(e)||(e=[e]);for(let o=0;o<e.length;o++)if("string"===typeof e[o]&&(e[o]=n.from(e[o])),!n.isBuffer(e[o]))throw new Error("Must be a Buffer");t||(t=n.alloc(m.encodingLength(e))),r||(r=0);const i=r;return r+=2,e.forEach((function(e){t[r++]=e.length,e.copy(t,r,0,e.length),r+=e.length})),t.writeUInt16BE(r-i-2,i),m.encode.bytes=r-i,t},m.encode.bytes=0,m.decode=function(e,t){t||(t=0);const r=t;let n=e.readUInt16BE(t);t+=2;let i=[];for(;n>0;){const r=e[t++];if(--n,n<r)throw new Error("Buffer overflow");i.push(e.slice(t,t+r)),t+=r,n-=r}return m.decode.bytes=t-r,i},m.decode.bytes=0,m.encodingLength=function(e){Array.isArray(e)||(e=[e]);let t=2;return e.forEach((function(e){t+="string"===typeof e?n.byteLength(e)+1:e.length+1})),t};const b=t.null={};b.encode=function(e,t,r){t||(t=n.alloc(b.encodingLength(e))),r||(r=0),"string"===typeof e&&(e=n.from(e)),e||(e=n.alloc(0));const i=r;r+=2;const o=e.length;return e.copy(t,r,0,o),r+=o,t.writeUInt16BE(r-i-2,i),b.encode.bytes=r-i,t},b.encode.bytes=0,b.decode=function(e,t){t||(t=0);const r=t,n=e.readUInt16BE(t);t+=2;const i=e.slice(t,t+n);return t+=n,b.decode.bytes=t-r,i},b.decode.bytes=0,b.encodingLength=function(e){return e?(n.isBuffer(e)?e.length:n.byteLength(e))+2:2};const v=t.hinfo={};v.encode=function(e,t,r){t||(t=n.alloc(v.encodingLength(e))),r||(r=0);const i=r;return r+=2,f.encode(e.cpu,t,r),r+=f.encode.bytes,f.encode(e.os,t,r),r+=f.encode.bytes,t.writeUInt16BE(r-i-2,i),v.encode.bytes=r-i,t},v.encode.bytes=0,v.decode=function(e,t){t||(t=0);const r=t,n={};return t+=2,n.cpu=f.decode(e,t),t+=f.decode.bytes,n.os=f.decode(e,t),t+=f.decode.bytes,v.decode.bytes=t-r,n},v.decode.bytes=0,v.encodingLength=function(e){return f.encodingLength(e.cpu)+f.encodingLength(e.os)+2};const w=t.ptr={},_=t.cname=w,E=t.dname=w;w.encode=function(e,t,r){return t||(t=n.alloc(w.encodingLength(e))),r||(r=0),l.encode(e,t,r+2),t.writeUInt16BE(l.encode.bytes,r),w.encode.bytes=l.encode.bytes+2,t},w.encode.bytes=0,w.decode=function(e,t){t||(t=0);const r=l.decode(e,t+2);return w.decode.bytes=l.decode.bytes+2,r},w.decode.bytes=0,w.encodingLength=function(e){return l.encodingLength(e)+2};const S=t.srv={};S.encode=function(e,t,r){t||(t=n.alloc(S.encodingLength(e))),r||(r=0),t.writeUInt16BE(e.priority||0,r+2),t.writeUInt16BE(e.weight||0,r+4),t.writeUInt16BE(e.port||0,r+6),l.encode(e.target,t,r+8);const i=l.encode.bytes+6;return t.writeUInt16BE(i,r),S.encode.bytes=i+2,t},S.encode.bytes=0,S.decode=function(e,t){t||(t=0);const r=e.readUInt16BE(t),n={};return n.priority=e.readUInt16BE(t+2),n.weight=e.readUInt16BE(t+4),n.port=e.readUInt16BE(t+6),n.target=l.decode(e,t+8),S.decode.bytes=r+2,n},S.decode.bytes=0,S.encodingLength=function(e){return 8+l.encodingLength(e.target)};const M=t.caa={};M.ISSUER_CRITICAL=128,M.encode=function(e,t,r){const i=M.encodingLength(e);return t||(t=n.alloc(M.encodingLength(e))),r||(r=0),e.issuerCritical&&(e.flags=M.ISSUER_CRITICAL),t.writeUInt16BE(i-2,r),r+=2,t.writeUInt8(e.flags||0,r),r+=1,f.encode(e.tag,t,r),r+=f.encode.bytes,t.write(e.value,r),r+=n.byteLength(e.value),M.encode.bytes=i,t},M.encode.bytes=0,M.decode=function(e,t){t||(t=0);const r=e.readUInt16BE(t),n=t+=2,i={};return i.flags=e.readUInt8(t),t+=1,i.tag=f.decode(e,t),t+=f.decode.bytes,i.value=e.toString("utf-8",t,n+r),i.issuerCritical=!!(i.flags&M.ISSUER_CRITICAL),M.decode.bytes=r+2,i},M.decode.bytes=0,M.encodingLength=function(e){return f.encodingLength(e.tag)+f.encodingLength(e.value)+2};const A=t.mx={};A.encode=function(e,t,r){t||(t=n.alloc(A.encodingLength(e))),r||(r=0);const i=r;return r+=2,t.writeUInt16BE(e.preference||0,r),r+=2,l.encode(e.exchange,t,r),r+=l.encode.bytes,t.writeUInt16BE(r-i-2,i),A.encode.bytes=r-i,t},A.encode.bytes=0,A.decode=function(e,t){t||(t=0);const r=t,n={};return t+=2,n.preference=e.readUInt16BE(t),t+=2,n.exchange=l.decode(e,t),t+=l.decode.bytes,A.decode.bytes=t-r,n},A.encodingLength=function(e){return 4+l.encodingLength(e.exchange)};const I=t.a={};I.encode=function(e,t,r){return t||(t=n.alloc(I.encodingLength(e))),r||(r=0),t.writeUInt16BE(4,r),r+=2,c.v4.encode(e,t,r),I.encode.bytes=6,t},I.encode.bytes=0,I.decode=function(e,t){t||(t=0),t+=2;const r=c.v4.decode(e,t);return I.decode.bytes=6,r},I.decode.bytes=0,I.encodingLength=function(){return 6};const k=t.aaaa={};k.encode=function(e,t,r){return t||(t=n.alloc(k.encodingLength(e))),r||(r=0),t.writeUInt16BE(16,r),r+=2,c.v6.encode(e,t,r),k.encode.bytes=18,t},k.encode.bytes=0,k.decode=function(e,t){t||(t=0),t+=2;const r=c.v6.decode(e,t);return k.decode.bytes=18,r},k.decode.bytes=0,k.encodingLength=function(){return 18};const T=t.option={};T.encode=function(e,t,r){t||(t=n.alloc(T.encodingLength(e))),r||(r=0);const i=r,o=u.toCode(e.code);if(t.writeUInt16BE(o,r),r+=2,e.data)t.writeUInt16BE(e.data.length,r),r+=2,e.data.copy(t,r),r+=e.data.length;else switch(o){case 8:const i=e.sourcePrefixLength||0,o=e.family||c.familyOf(e.ip),s=c.encode(e.ip,n.alloc),a=Math.ceil(i/8);t.writeUInt16BE(a+4,r),r+=2,t.writeUInt16BE(o,r),r+=2,t.writeUInt8(i,r++),t.writeUInt8(e.scopePrefixLength||0,r++),s.copy(t,r,0,a),r+=a;break;case 11:e.timeout?(t.writeUInt16BE(2,r),r+=2,t.writeUInt16BE(e.timeout,r),r+=2):(t.writeUInt16BE(0,r),r+=2);break;case 12:const u=e.length||0;t.writeUInt16BE(u,r),r+=2,t.fill(0,r,r+u),r+=u;break;case 14:const h=2*e.tags.length;t.writeUInt16BE(h,r),r+=2;for(const n of e.tags)t.writeUInt16BE(n,r),r+=2;break;default:throw new Error("Unknown roption code: ".concat(e.code))}return T.encode.bytes=r-i,t},T.encode.bytes=0,T.decode=function(e,t){t||(t=0);const r={};r.code=e.readUInt16BE(t),r.type=u.toString(r.code),t+=2;const i=e.readUInt16BE(t);switch(t+=2,r.data=e.slice(t,t+i),r.code){case 8:r.family=e.readUInt16BE(t),t+=2,r.sourcePrefixLength=e.readUInt8(t++),r.scopePrefixLength=e.readUInt8(t++);const o=n.alloc(1===r.family?4:16);e.copy(o,0,t,t+i-4),r.ip=c.decode(o);break;case 11:i>0&&(r.timeout=e.readUInt16BE(t),t+=2);break;case 14:r.tags=[];for(let n=0;n<i;n+=2)r.tags.push(e.readUInt16BE(t)),t+=2}return T.decode.bytes=i+4,r},T.decode.bytes=0,T.encodingLength=function(e){if(e.data)return e.data.length+4;switch(u.toCode(e.code)){case 8:const t=e.sourcePrefixLength||0;return Math.ceil(t/8)+8;case 11:return"number"===typeof e.timeout?6:4;case 12:return e.length+4;case 14:return 4+2*e.tags.length}throw new Error("Unknown roption code: ".concat(e.code))};const R=t.opt={};R.encode=function(e,t,r){t||(t=n.alloc(R.encodingLength(e))),r||(r=0);const i=r,o=j(e,T);return t.writeUInt16BE(o,r),r=q(e,T,t,r+2),R.encode.bytes=r-i,t},R.encode.bytes=0,R.decode=function(e,t){t||(t=0);const r=t,n=[];let i=e.readUInt16BE(t);t+=2;let o=0;for(;i>0;)n[o++]=T.decode(e,t),t+=T.decode.bytes,i-=T.decode.bytes;return R.decode.bytes=t-r,n},R.decode.bytes=0,R.encodingLength=function(e){return 2+j(e||[],T)};const P=t.dnskey={};P.PROTOCOL_DNSSEC=3,P.ZONE_KEY=128,P.SECURE_ENTRYPOINT=32768,P.encode=function(e,t,r){t||(t=n.alloc(P.encodingLength(e))),r||(r=0);const i=r,o=e.key;if(!n.isBuffer(o))throw new Error("Key must be a Buffer");return r+=2,t.writeUInt16BE(e.flags,r),r+=2,t.writeUInt8(P.PROTOCOL_DNSSEC,r),r+=1,t.writeUInt8(e.algorithm,r),r+=1,o.copy(t,r,0,o.length),r+=o.length,P.encode.bytes=r-i,t.writeUInt16BE(P.encode.bytes-2,i),t},P.encode.bytes=0,P.decode=function(e,t){t||(t=0);const r=t;var n={},i=e.readUInt16BE(t);if(t+=2,n.flags=e.readUInt16BE(t),t+=2,e.readUInt8(t)!==P.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return t+=1,n.algorithm=e.readUInt8(t),t+=1,n.key=e.slice(t,r+i+2),t+=n.key.length,P.decode.bytes=t-r,n},P.decode.bytes=0,P.encodingLength=function(e){return 6+n.byteLength(e.key)};const C=t.rrsig={};C.encode=function(e,t,r){t||(t=n.alloc(C.encodingLength(e))),r||(r=0);const o=r,s=e.signature;if(!n.isBuffer(s))throw new Error("Signature must be a Buffer");return r+=2,t.writeUInt16BE(i.toType(e.typeCovered),r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.labels,r),r+=1,t.writeUInt32BE(e.originalTTL,r),r+=4,t.writeUInt32BE(e.expiration,r),r+=4,t.writeUInt32BE(e.inception,r),r+=4,t.writeUInt16BE(e.keyTag,r),r+=2,l.encode(e.signersName,t,r),r+=l.encode.bytes,s.copy(t,r,0,s.length),r+=s.length,C.encode.bytes=r-o,t.writeUInt16BE(C.encode.bytes-2,o),t},C.encode.bytes=0,C.decode=function(e,t){t||(t=0);const r=t;var n={},o=e.readUInt16BE(t);return t+=2,n.typeCovered=i.toString(e.readUInt16BE(t)),t+=2,n.algorithm=e.readUInt8(t),t+=1,n.labels=e.readUInt8(t),t+=1,n.originalTTL=e.readUInt32BE(t),t+=4,n.expiration=e.readUInt32BE(t),t+=4,n.inception=e.readUInt32BE(t),t+=4,n.keyTag=e.readUInt16BE(t),t+=2,n.signersName=l.decode(e,t),t+=l.decode.bytes,n.signature=e.slice(t,r+o+2),t+=n.signature.length,C.decode.bytes=t-r,n},C.decode.bytes=0,C.encodingLength=function(e){return 20+l.encodingLength(e.signersName)+n.byteLength(e.signature)};const O=t.rp={};O.encode=function(e,t,r){t||(t=n.alloc(O.encodingLength(e))),r||(r=0);const i=r;return r+=2,l.encode(e.mbox||".",t,r),r+=l.encode.bytes,l.encode(e.txt||".",t,r),r+=l.encode.bytes,O.encode.bytes=r-i,t.writeUInt16BE(O.encode.bytes-2,i),t},O.encode.bytes=0,O.decode=function(e,t){t||(t=0);const r=t,n={};return t+=2,n.mbox=l.decode(e,t)||".",t+=l.decode.bytes,n.txt=l.decode(e,t)||".",t+=l.decode.bytes,O.decode.bytes=t-r,n},O.decode.bytes=0,O.encodingLength=function(e){return 2+l.encodingLength(e.mbox||".")+l.encodingLength(e.txt||".")};const x={encode:function(e,t,r){t||(t=n.alloc(x.encodingLength(e))),r||(r=0);const o=r;for(var s=[],a=0;a<e.length;a++){var u=i.toType(e[a]);void 0===s[u>>8]&&(s[u>>8]=[]),s[u>>8][u>>3&31]|=1<<7-(7&u)}for(a=0;a<s.length;a++)if(void 0!==s[a]){var c=n.from(s[a]);t.writeUInt8(a,r),r+=1,t.writeUInt8(c.length,r),r+=1,c.copy(t,r),r+=c.length}return x.encode.bytes=r-o,t}};x.encode.bytes=0,x.decode=function(e,t,r){t||(t=0);const n=t;for(var o=[];t-n<r;){var s=e.readUInt8(t);t+=1;var a=e.readUInt8(t);t+=1;for(var u=0;u<a;u++)for(var c=e.readUInt8(t+u),h=0;h<8;h++)if(c&1<<7-h){var l=i.toString(s<<8|u<<3|h);o.push(l)}t+=a}return x.decode.bytes=t-n,o},x.decode.bytes=0,x.encodingLength=function(e){for(var t=[],r=0;r<e.length;r++){var n=i.toType(e[r]);t[n>>8]=Math.max(t[n>>8]||0,255&n)}var o=0;for(r=0;r<t.length;r++)void 0!==t[r]&&(o+=2+Math.ceil((t[r]+1)/8));return o};const B=t.nsec={};B.encode=function(e,t,r){t||(t=n.alloc(B.encodingLength(e))),r||(r=0);const i=r;return r+=2,l.encode(e.nextDomain,t,r),r+=l.encode.bytes,x.encode(e.rrtypes,t,r),r+=x.encode.bytes,B.encode.bytes=r-i,t.writeUInt16BE(B.encode.bytes-2,i),t},B.encode.bytes=0,B.decode=function(e,t){t||(t=0);const r=t;var n={},i=e.readUInt16BE(t);return t+=2,n.nextDomain=l.decode(e,t),t+=l.decode.bytes,n.rrtypes=x.decode(e,t,i-(t-r)),t+=x.decode.bytes,B.decode.bytes=t-r,n},B.decode.bytes=0,B.encodingLength=function(e){return 2+l.encodingLength(e.nextDomain)+x.encodingLength(e.rrtypes)};const D=t.nsec3={};D.encode=function(e,t,r){t||(t=n.alloc(D.encodingLength(e))),r||(r=0);const i=r,o=e.salt;if(!n.isBuffer(o))throw new Error("salt must be a Buffer");const s=e.nextDomain;if(!n.isBuffer(s))throw new Error("nextDomain must be a Buffer");return r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.flags,r),r+=1,t.writeUInt16BE(e.iterations,r),r+=2,t.writeUInt8(o.length,r),r+=1,o.copy(t,r,0,o.length),r+=o.length,t.writeUInt8(s.length,r),r+=1,s.copy(t,r,0,s.length),r+=s.length,x.encode(e.rrtypes,t,r),r+=x.encode.bytes,D.encode.bytes=r-i,t.writeUInt16BE(D.encode.bytes-2,i),t},D.encode.bytes=0,D.decode=function(e,t){t||(t=0);const r=t;var n={},i=e.readUInt16BE(t);t+=2,n.algorithm=e.readUInt8(t),t+=1,n.flags=e.readUInt8(t),t+=1,n.iterations=e.readUInt16BE(t),t+=2;const o=e.readUInt8(t);t+=1,n.salt=e.slice(t,t+o),t+=o;const s=e.readUInt8(t);return t+=1,n.nextDomain=e.slice(t,t+s),t+=s,n.rrtypes=x.decode(e,t,i-(t-r)),t+=x.decode.bytes,D.decode.bytes=t-r,n},D.decode.bytes=0,D.encodingLength=function(e){return 8+e.salt.length+e.nextDomain.length+x.encodingLength(e.rrtypes)};const N=t.ds={};N.encode=function(e,t,r){t||(t=n.alloc(N.encodingLength(e))),r||(r=0);const i=r,o=e.digest;if(!n.isBuffer(o))throw new Error("Digest must be a Buffer");return r+=2,t.writeUInt16BE(e.keyTag,r),r+=2,t.writeUInt8(e.algorithm,r),r+=1,t.writeUInt8(e.digestType,r),r+=1,o.copy(t,r,0,o.length),r+=o.length,N.encode.bytes=r-i,t.writeUInt16BE(N.encode.bytes-2,i),t},N.encode.bytes=0,N.decode=function(e,t){t||(t=0);const r=t;var n={},i=e.readUInt16BE(t);return t+=2,n.keyTag=e.readUInt16BE(t),t+=2,n.algorithm=e.readUInt8(t),t+=1,n.digestType=e.readUInt8(t),t+=1,n.digest=e.slice(t,r+i+2),t+=n.digest.length,N.decode.bytes=t-r,n},N.decode.bytes=0,N.encodingLength=function(e){return 6+n.byteLength(e.digest)};const L=t.record=function(e){switch(e.toUpperCase()){case"A":return I;case"PTR":return w;case"CNAME":return _;case"DNAME":return E;case"TXT":return m;case"NULL":return b;case"AAAA":return k;case"SRV":return S;case"HINFO":return v;case"CAA":return M;case"NS":return y;case"SOA":return g;case"MX":return A;case"OPT":return R;case"DNSKEY":return P;case"RRSIG":return C;case"RP":return O;case"NSEC":return B;case"NSEC3":return D;case"DS":return N}return p},K=t.answer={};K.encode=function(e,t,r){t||(t=n.alloc(K.encodingLength(e))),r||(r=0);const o=r;if(l.encode(e.name,t,r),r+=l.encode.bytes,t.writeUInt16BE(i.toType(e.type),r),"OPT"===e.type.toUpperCase()){if("."!==e.name)throw new Error("OPT name must be root.");t.writeUInt16BE(e.udpPayloadSize||4096,r+2),t.writeUInt8(e.extendedRcode||0,r+4),t.writeUInt8(e.ednsVersion||0,r+5),t.writeUInt16BE(e.flags||0,r+6),r+=8,R.encode(e.options||[],t,r),r+=R.encode.bytes}else{let n=a.toClass(void 0===e.class?"IN":e.class);e.flush&&(n|=h),t.writeUInt16BE(n,r+2),t.writeUInt32BE(e.ttl||0,r+4),r+=8;const i=L(e.type);i.encode(e.data,t,r),r+=i.encode.bytes}return K.encode.bytes=r-o,t},K.encode.bytes=0,K.decode=function(e,t){t||(t=0);const r={},n=t;if(r.name=l.decode(e,t),t+=l.decode.bytes,r.type=i.toString(e.readUInt16BE(t)),"OPT"===r.type)r.udpPayloadSize=e.readUInt16BE(t+2),r.extendedRcode=e.readUInt8(t+4),r.ednsVersion=e.readUInt8(t+5),r.flags=e.readUInt16BE(t+6),r.flag_do=1===(r.flags>>15&1),r.options=R.decode(e,t+8),t+=8+R.decode.bytes;else{const n=e.readUInt16BE(t+2);r.ttl=e.readUInt32BE(t+4),r.class=a.toString(-32769&n),r.flush=!!(n&h);const i=L(r.type);r.data=i.decode(e,t+8),t+=8+i.decode.bytes}return K.decode.bytes=t-n,r},K.decode.bytes=0,K.encodingLength=function(e){const t=null!==e.data&&void 0!==e.data?e.data:e.options;return l.encodingLength(e.name)+8+L(e.type).encodingLength(t)};const U=t.question={};function j(e,t){let r=0;for(let n=0;n<e.length;n++)r+=t.encodingLength(e[n]);return r}function q(e,t,r,n){for(let i=0;i<e.length;i++)t.encode(e[i],r,n),n+=t.encode.bytes;return n}function F(e,t,r,n){for(let i=0;i<e.length;i++)e[i]=t.decode(r,n),n+=t.decode.bytes;return n}U.encode=function(e,t,r){t||(t=n.alloc(U.encodingLength(e))),r||(r=0);const o=r;return l.encode(e.name,t,r),r+=l.encode.bytes,t.writeUInt16BE(i.toType(e.type),r),r+=2,t.writeUInt16BE(a.toClass(void 0===e.class?"IN":e.class),r),r+=2,U.encode.bytes=r-o,e},U.encode.bytes=0,U.decode=function(e,t){t||(t=0);const r=t,n={};n.name=l.decode(e,t),t+=l.decode.bytes,n.type=i.toString(e.readUInt16BE(t)),t+=2,n.class=a.toString(e.readUInt16BE(t)),t+=2;return!!(32768&n.class)&&(n.class&=-32769),U.decode.bytes=t-r,n},U.decode.bytes=0,U.encodingLength=function(e){return l.encodingLength(e.name)+4},t.AUTHORITATIVE_ANSWER=1024,t.TRUNCATED_RESPONSE=512,t.RECURSION_DESIRED=256,t.RECURSION_AVAILABLE=128,t.AUTHENTIC_DATA=32,t.CHECKING_DISABLED=16,t.DNSSEC_OK=32768,t.encode=function(e,r,i){const o=!r;o&&(r=n.alloc(t.encodingLength(e))),i||(i=0);const s=i;return e.questions||(e.questions=[]),e.answers||(e.answers=[]),e.authorities||(e.authorities=[]),e.additionals||(e.additionals=[]),d.encode(e,r,i),i+=d.encode.bytes,i=q(e.questions,U,r,i),i=q(e.answers,K,r,i),i=q(e.authorities,K,r,i),i=q(e.additionals,K,r,i),t.encode.bytes=i-s,o&&t.encode.bytes!==r.length?r.slice(0,t.encode.bytes):r},t.encode.bytes=0,t.decode=function(e,r){r||(r=0);const n=r,i=d.decode(e,r);return r+=d.decode.bytes,r=F(i.questions,U,e,r),r=F(i.answers,K,e,r),r=F(i.authorities,K,e,r),r=F(i.additionals,K,e,r),t.decode.bytes=r-n,i},t.decode.bytes=0,t.encodingLength=function(e){return d.encodingLength(e)+j(e.questions||[],U)+j(e.answers||[],K)+j(e.authorities||[],K)+j(e.additionals||[],K)},t.streamEncode=function(e){const r=t.encode(e),i=n.alloc(2);i.writeUInt16BE(r.byteLength);const o=n.concat([i,r]);return t.streamEncode.bytes=o.byteLength,o},t.streamEncode.bytes=0,t.streamDecode=function(e){const r=e.readUInt16BE(0);if(e.byteLength<r+2)return null;const n=t.decode(e.slice(2));return t.streamDecode.bytes=t.decode.bytes,n},t.streamDecode.bytes=0},59789:(e,t)=>{"use strict";t.toString=function(e){switch(e){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+e},t.toOpcode=function(e){switch(e.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}},18302:(e,t)=>{"use strict";t.toString=function(e){switch(e){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return e<0?null:"OPTION_".concat(e)},t.toCode=function(e){if("number"===typeof e)return e;if(!e)return-1;switch(e.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}const t=e.match(/_(\d+)$/);return t?parseInt(t[1],10):-1}},75738:(e,t)=>{"use strict";t.toString=function(e){switch(e){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+e},t.toRcode=function(e){switch(e.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}},87123:(e,t)=>{"use strict";t.toString=function(e){switch(e){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+e},t.toType=function(e){switch(e.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":case"*":return 255}return e.toUpperCase().startsWith("UNKNOWN_")?parseInt(e.slice(8)):0}},10494:(e,t,r)=>{"use strict";function n(e,t){Object.defineProperty(e,"super_",{value:t,writable:!0,configurable:!0}),Object.setPrototypeOf(e.prototype,t.prototype)}let i="undefined"!==typeof r.g?r.g.AbortError:"undefined"!==typeof window?window.AbortError:null;function o(e,t,r){Error.captureStackTrace(this,o),this.message="status="+t+" while requesting "+e+" ["+r+"]",this.uri=e,this.status=t,this.method=r}function s(e,t){Error.captureStackTrace(this,s),this.message=e,this.cause=t}function a(e){Error.captureStackTrace(this,a),this.message="Timeout (t="+e+").",this.timeout=e}function u(e){if(e.protocol){if(!["http:","https:","udp4:","udp6:"].includes(e.protocol))throw new Error('Invalid Endpoint: unsupported protocol "'.concat(e.protocol,'" for endpoint: ').concat(JSON.stringify(e)))}else e.protocol="https:";if("string"!==typeof e.host)throw new Error('Invalid Endpoint: host "'.concat(e.host,'" needs to be a string: ').concat(JSON.stringify(e)));if("number"!==typeof e.port&&!isNaN(e.port))throw new Error('Invalid Endpoint: port "'.concat(e.port,'" needs to be a number: ').concat(JSON.stringify(e)));for(const t in e)void 0!==e[t]&&(this[t]=e[t])}i||(i=function(){Error.captureStackTrace(this,i),this.message="Request aborted."},n(i,Error),i.prototype.code="ABORT_ERR",i.prototype.name="AbortError"),n(o,Error),o.prototype.code="HTTP_STATUS",o.prototype.name="StatusError",n(s,Error),s.prototype.code="RESPONSE_ERR",s.prototype.name="ResponseError",n(a,Error),a.prototype.code="ETIMEOUT",a.prototype.name="TimeoutError";const c=r(56640),h={};for(const l in c)h[l]=new u(c[l]);e.exports={endpoints:h,AbortError:i,HTTPStatusError:o,ResponseError:s,TimeoutError:a,Endpoint:u}},3205:(e,t,r)=>{"use strict";const n=r(68818),i=r(69557),o=r(10494),s=o.AbortError,a=o.ResponseError,u=o.Endpoint,c=o.endpoints,h=/^((\d{1,3}\.){3,3}\d{1,3})(:(\d{2,5}))?$/,l=/^((::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?)(:(\d{2,5}))?$/i;function f(e,t,r,o){return o&&o.aborted?Promise.reject(new s):"udp4:"===e.protocol||"udp6:"===e.protocol?i.queryDns(e,t,r,o):function(e,t,r,o){const s=e.protocol||"https:";return new Promise((function(u,c){i.request(s,e.host,e.port?parseInt(e.port,10):"https:"===s?443:80,e.path||"/dns-query",/^post$/i.test(e.method)?"POST":"GET",n.encode(Object.assign({flags:n.RECURSION_DESIRED,type:"query"},t)),r,o,(function(t,r,i){let o;if(null===t)if(0===r.length)t=new a("Empty.");else try{o=n.decode(r)}catch(s){t=new a("Invalid packet (cause="+s.message+")",s)}null!==t?c(Object.assign(t,{response:i,endpoint:e})):(o.endpoint=e,o.response=i,u(o))}))}))}(e,t,r,o)}function d(e,t){let r;t=Object.assign({retries:5,timeout:3e4},t);try{if(r="doh"===t.endpoints?i.endpoints({doh:!0,dns:!1}):"dns"===t.endpoints?i.endpoints({doh:!1,dns:!0}):p(t.endpoints)||i.endpoints({doh:!0,dns:!0}),!r||0===r.length)throw new Error("No endpoints defined.")}catch(n){return Promise.reject(n)}return function(e,t,r){const n=1===e.length?e[0]:e[Math.floor(Math.random()*e.length)%e.length];return f(n,t,r.timeout,r.signal).then((e=>(e.endpoint=n,e)),(e=>{if("AbortError"===e.name||0===r.retries)throw e;return r.retries>0&&(r.retries-=1),d(t,r)}))}(r,e,t)}function p(e){if(!e)return;if("function"!==typeof e[Symbol.iterator]||"string"===typeof e)throw new Error("Endpoints needs to be iterable.");const t=[];for(let r of e)"object"===typeof r?(r instanceof u||(r=new u(r)),t.push(r)):"string"===typeof r&&t.push(c[r]||y(r));return t}function y(e){const t=/^(([^:]+?:)\/\/)?([^/]*?)(\/.*?)?(\s\[(post|get)\])?$/i.exec(e);let r,n,i=t[2]||"https:",o=1;const s=l.exec(t[3]);if(s){const e=h.exec(t[3]);e?(r=e[1],e[4]&&(n=parseInt(e[4]))):(o=2,r=s[1],s[9]&&(n=parseInt(s[10])))}else{const e=/^([^:]*)(:(.*))?$/.exec(t[3]);r=e[1],e[3]&&(n=parseInt(e[3]))}return"udp:"===i&&(i=2===o?"udp6:":"udp4:"),new u({protocol:i,host:r,port:n,path:t[4],method:t[6]})}e.exports={query:d,endpoints:c,parseEndpoints:p,AbortError:s,ResponseError:a,TimeoutError:o.TimeoutError,HTTPStatusError:o.HTTPStatusError,Endpoint:u}},69557:(e,t,r)=>{"use strict";const n=r(29536).Buffer,i=r(10494),o=i.AbortError,s=i.HTTPStatusError,a=i.TimeoutError,u="application/dns-message",c=Object.values(i.endpoints).filter((function(e){return!e.filter&&!e.logging&&e.cors}));function h(){}e.exports={request:function(e,t,r,i,c,l,f,d,p){const y=e+"//"+t+":"+r+i+("GET"===c?"?dns="+l.toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"):""),g=new XMLHttpRequest;g.open(c,y,!0),g.setRequestHeader("Accept",u),"POST"===c&&g.setRequestHeader("Content-Type",u),g.responseType="arraybuffer",g.timeout=f,g.ontimeout=function(){m(new a(f));try{g.abort()}catch(e){}},g.onreadystatechange=function(){if(g.readyState>1&&200!==g.status&&0!==g.status){m(new s(y,g.status,c));try{g.abort()}catch(e){}}},g.onerror=function(){m(200===g.status?new Error("Inexplicable XHR Error"):new s(y,g.status,c))},g.onload=function(){200!==g.status?m(new s(y,g.status,c)):m(null,n.from(g.response))},"GET"===c?g.send():g.send(l),d&&d.addEventListener("abort",b);let m=function(e,t){m=h,d&&d.removeEventListener("abort",b),p(e,t,g)};function b(){m(new o);try{g.abort()}catch(e){}}},queryDns:function(){throw new Error('Only "doh" endpoints are supported in the browser')},endpoints:e=>{if(e.doh)return c;if(e.dns)throw new Error('Only "doh" is supported in the browser')}}},86066:function(e,t,r){"use strict";var n=r(29536).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};t.__esModule=!0,t.decrypt=t.encrypt=t.derive=t.verify=t.sign=t.getPublic=t.kdf=void 0;var u=new(r(67172).ec)("secp256k1"),c=window.crypto||window.msCrypto,h=c.subtle||c.webkitSubtle;if(void 0===h||void 0===c)throw new Error("crypto and/or subtle api unavailable");var l=function(e){return c.getRandomValues(n.alloc(e))},f=function(e){return h.digest({name:"SHA-256"},e).then(n.from)};t.kdf=function(e,t){for(var r=1,i=0,o=Promise.resolve(n.from("")),s=function(){var t=n.from([r>>24,r>>16,r>>8,r]),s=f(n.concat([t,e]));o=o.then((function(e){return s.then((function(t){return n.concat([e,t])}))})),i+=32,r+=1};i<t;)s();return o};t.getPublic=function(e){return new Promise((function(t,r){32!==e.length?r(new Error("Private key should be 32 bytes long")):t(n.from(u.keyFromPrivate(e).getPublic("array")))}))};t.sign=function(e,t){return new Promise((function(r,i){32!==e.length?i(new Error("Private key should be 32 bytes long")):t.length<=0?i(new Error("Message should not be empty")):t.length>32?i(new Error("Message is too long (max 32 bytes)")):r(n.from(u.sign(t,e,{canonical:!0}).toDER("hex"),"hex"))}))};t.verify=function(e,t,r){return new Promise((function(n,i){try{65!==e.length||4!==e[0]?i(new Error("Public key should 65 bytes long")):t.length<=0?i(new Error("Message should not be empty")):t.length>32?i(new Error("Message is too long (max 32 bytes)")):u.verify(t,r.toString("hex"),e,"hex")?n(!0):i(new Error("Bad signature"))}catch(o){i(new Error("Invalid arguments"))}}))};t.derive=function(e,t){return new Promise((function(r,i){if(32!==e.length)i(new Error("Bad private key, it should be 32 bytes but it's actually "+e.length+" bytes long"));else if(65!==t.length)i(new Error("Bad public key, it should be 65 bytes but it's actually "+t.length+" bytes long"));else if(4!==t[0])i(new Error("Bad public key, a valid public key would begin with 4"));else{var o=u.keyFromPrivate(e),s=u.keyFromPublic(t),a=o.derive(s.getPublic());r(n.from(a.toArray()))}}))};t.encrypt=function(e,r,i){return s(void 0,void 0,void 0,(function(){var o;return a(this,(function(u){return o=(i=i||{}).ephemPrivateKey||l(32),[2,(0,t.derive)(o,e).then((function(e){return(0,t.kdf)(e,32)})).then((function(e){return s(void 0,void 0,void 0,(function(){var s,u;return a(this,(function(a){return s=i.iv||l(16),u=e.slice(0,16),[2,(c=s,d=u,p=r,h.importKey("raw",d,"AES-CTR",!1,["encrypt"]).then((function(e){return h.encrypt({name:"AES-CTR",counter:c,length:128},e,p)})).then(n.from)).then((function(e){return n.concat([s,e])})).then((function(r){return f(e.slice(16)).then((function(e){return function(e,t){var r={name:"HMAC",hash:{name:"SHA-256"}};return h.importKey("raw",e,r,!1,["sign"]).then((function(e){return h.sign(r,e,t)})).then(n.from)}(e,r)})).then((function(e){return(0,t.getPublic)(o).then((function(t){return n.concat([t,r,e])}))}))}))];var c,d,p}))}))}))]}))}))};t.decrypt=function(e,r){return new Promise((function(i,o){if(r.length<=113)o(new Error("Invalid Ciphertext. Data is too small. It should ba at least 113 bytes"));else if(4!==r[0])o(new Error("Not a valid ciphertext. It should begin with 4 but actually begin with "+r[0]));else{var s=r.slice(0,65),a=r.length-113,u=r.slice(65,81),c=r.slice(65,81+a),l=c.slice(16),d=r.slice(81+a);i((0,t.derive)(e,s).then((function(e){return(0,t.kdf)(e,32)})).then((function(e){return f(e.slice(16)).then((function(t){return[e.slice(0,16),t]}))})).then((function(e){var t=e[0];return function(e,t,r){var n={name:"HMAC",hash:{name:"SHA-256"}};return h.importKey("raw",e,n,!1,["verify"]).then((function(e){return h.verify(n,e,r,t)}))}(e[1],c,d).then((function(e){return e?(r=u,i=t,o=l,h.importKey("raw",i,"AES-CTR",!1,["decrypt"]).then((function(e){return h.decrypt({name:"AES-CTR",counter:r,length:128},e,o)})).then(n.from)):Promise.reject(new Error("Incorrect MAC"));var r,i,o}))})).then(n.from))}}))},o(r(47154),t)},47154:(e,t)=>{"use strict";t.__esModule=!0,t.KeyPath=t.Path=void 0;t.Path=function(e,t,r){return{account:e,scope:t,keyIndex:r}};var r=function(e){var r=e.split("/");if(4!==r.length||"m"!==r[0])throw new Error("invalid value for path");return(0,t.Path)(r[1],r[2],r[3])},n=function(e){var t=r(e);if(parseInt(t.account)>Math.pow(2,16)-1||parseInt(t.scope)>Math.pow(2,16)-1||parseInt(t.keyIndex)>Math.pow(2,21)-1)throw new Error("invalid path with value exceeding its limits");return e},i=function(e){return function(){var t=r(e);return parseInt(t.account)*Math.pow(2,37)+parseInt(t.scope)*Math.pow(2,21)+parseInt(t.keyIndex)}};t.KeyPath=function(e){return{value:n(e),parse:function(){return r(e)},next:function(n){return function(e,n){var i=r(e),o=parseInt(i.keyIndex),s=void 0!==n&&n>1?n:1,a="m/"+i.account+"/"+i.scope+"/"+(o+s).toString(10);return(0,t.KeyPath)(a)}(e,n)},valueOf:i(e)}}},67172:(e,t,r)=>{"use strict";var n=t;n.version=r(40763).i8,n.utils=r(86306),n.rand=r(46804),n.curve=r(27669),n.curves=r(45839),n.ec=r(34439),n.eddsa=r(16119)},60504:(e,t,r)=>{"use strict";var n=r(33248),i=r(86306),o=i.getNAF,s=i.getJSF,a=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;var s,u,c=[];for(s=0;s<n.length;s+=r.step){u=0;for(var h=s+r.step-1;h>=s;h--)u=(u<<1)+n[h];c.push(u)}for(var l=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s<c.length;s++)(u=c[s])===d?f=f.mixedAdd(r.points[s]):u===-d&&(f=f.mixedAdd(r.points[s].neg()));l=l.add(f)}return l.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(t,r,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(var h=0;c>=0&&0===s[c];c--)h++;if(c>=0&&h++,u=u.dblp(h),c<0)break;var l=s[c];a(0!==l),u="affine"===e.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var a,u,c,h=this._wnafT1,l=this._wnafT2,f=this._wnafT3,d=0;for(a=0;a<n;a++){var p=(c=t[a])._getNAFPoints(e);h[a]=p.wnd,l[a]=p.points}for(a=n-1;a>=1;a-=2){var y=a-1,g=a;if(1===h[y]&&1===h[g]){var m=[t[y],null,null,t[g]];0===t[y].y.cmp(t[g].y)?(m[1]=t[y].add(t[g]),m[2]=t[y].toJ().mixedAdd(t[g].neg())):0===t[y].y.cmp(t[g].y.redNeg())?(m[1]=t[y].toJ().mixedAdd(t[g]),m[2]=t[y].add(t[g].neg())):(m[1]=t[y].toJ().mixedAdd(t[g]),m[2]=t[y].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[y],r[g]);for(d=Math.max(v[0].length,d),f[y]=new Array(d),f[g]=new Array(d),u=0;u<d;u++){var w=0|v[0][u],_=0|v[1][u];f[y][u]=b[3*(w+1)+(_+1)],f[g][u]=0,l[y]=m}}else f[y]=o(r[y],h[y],this._bitLength),f[g]=o(r[g],h[g],this._bitLength),d=Math.max(f[y].length,d),d=Math.max(f[g].length,d)}var E=this.jpoint(null,null,null),S=this._wnafT4;for(a=d;a>=0;a--){for(var M=0;a>=0;){var A=!0;for(u=0;u<n;u++)S[u]=0|f[u][a],0!==S[u]&&(A=!1);if(!A)break;M++,a--}if(a>=0&&M++,E=E.dblp(M),a<0)break;for(u=0;u<n;u++){var I=S[u];0!==I&&(I>0?c=l[u][I-1>>1]:I<0&&(c=l[u][-I-1>>1].neg()),E="affine"===c.type?E.mixedAdd(c):E.add(c))}}for(a=0;a<n;a++)l[a]=null;return i?E:E.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1===2*r)return 6===e[0]?a(e[e.length-1]%2===0):7===e[0]&&a(e[e.length-1]%2===1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},19380:(e,t,r)=>{"use strict";var n=r(86306),i=r(33248),o=r(49073),s=r(60504),a=n.assert;function u(e){this.twisted=1!==(0|e.a),this.mOneA=this.twisted&&-1===(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|e.c)}function c(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(t&&!u||!t&&u)&&(a=a.redNeg()),this.point(e,a)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,s.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),u=i.redMul(s),c=o.redMul(a),h=i.redMul(a),l=s.redMul(o);return this.curve.point(u,c,l,h)},c.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(e=s.redSub(a).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=s.redSub(a).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(t),c=o.redMul(s),h=a.redMul(u),l=o.redMul(u),f=s.redMul(a);return this.curve.point(c,h,f,l)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),c=i.redAdd(a),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),l=n.redMul(u).redMul(h);return this.curve.twisted?(t=n.redMul(c).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(l,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},27669:(e,t,r)=>{"use strict";var n=t;n.base=r(60504),n.short=r(74570),n.mont=r(39089),n.edwards=r(19380)},39089:(e,t,r)=>{"use strict";var n=r(33248),i=r(49073),o=r(60504),s=r(86306);function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new u(this,e,t)},a.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},74570:(e,t,r)=>{"use strict";var n=r(86306),i=r(33248),o=r(49073),s=r(60504),a=n.assert;function u(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,u,c,h,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,d=this.n.clone(),p=new i(1),y=new i(0),g=new i(0),m=new i(1),b=0;0!==f.cmpn(0);){var v=d.div(f);c=d.sub(v.mul(f)),h=g.sub(v.mul(p));var w=m.sub(v.mul(y));if(!n&&c.cmp(l)<0)t=u.neg(),r=p,n=c.neg(),o=h;else if(n&&2===++b)break;u=c,d=f,f=c,g=p,p=h,m=y,y=w}s=c.neg(),a=h;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),h=0;h<2*o;h++)n[h]=null,i[h]=null;return c},o(c,s.BasePoint),u.prototype.point=function(e,t,r){return new c(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"===typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,s.BasePoint),u.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),h=c.redMul(a),l=n.redMul(c),f=u.redSqr().redIAdd(h).redISub(l).redISub(l),d=u.redMul(l.redISub(f)).redISub(o.redMul(h)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,d,p)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=r.redMul(u),l=a.redSqr().redIAdd(c).redISub(h).redISub(h),f=a.redMul(h.redISub(l)).redISub(i.redMul(c)),d=this.z.redMul(s);return this.curve.jpoint(l,f,d)},h.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),c=s.redAdd(s);for(t=0;t<e;t++){var h=o.redSqr(),l=c.redSqr(),f=l.redSqr(),d=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(u)),p=o.redMul(l),y=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(y),m=d.redMul(g);m=m.redIAdd(m).redISub(f);var b=c.redMul(a);t+1<e&&(u=u.redMul(f)),o=y,a=b,c=m}return this.curve.jpoint(o,c.redMul(i),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),l=this.y.redSqr(),f=l.redSqr(),d=this.x.redAdd(l).redSqr().redISub(h).redISub(f);d=d.redIAdd(d);var p=h.redAdd(h).redIAdd(h),y=p.redSqr(),g=f.redIAdd(f);g=(g=g.redIAdd(g)).redIAdd(g),e=y.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},h.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),l=this.y.redSqr(),f=this.x.redMul(l),d=this.x.redSub(h).redMul(this.x.redAdd(h));d=d.redAdd(d).redIAdd(d);var p=f.redIAdd(f),y=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(h);var g=l.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=d.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},h.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(s),h=a.redSqr().redISub(c.redAdd(c)),l=c.redISub(h),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=a.redMul(l).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,d,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),h=t.redMul(c);h=(h=h.redIAdd(h)).redIAdd(h);var l=this.x.redMul(a).redISub(h);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(l,f,d)},h.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},h.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},45839:(e,t,r)=>{"use strict";var n,i=t,o=r(19174),s=r(27669),a=r(86306).assert;function u(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(58222)}catch(h){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},34439:(e,t,r)=>{"use strict";var n=r(33248),i=r(83608),o=r(86306),s=r(45839),a=r(46804),u=o.assert,c=r(38332),h=r(88211);function l(e){if(!(this instanceof l))return new l(e);"string"===typeof e&&(u(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=l,l.prototype.keyPair=function(e){return new c(this,e)},l.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},l.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,o){"object"===typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),u=e.toArray("be",s),c=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new n(1)),f=0;;f++){var d=o.k?o.k(f):new n(c.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(l)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var y=p.getX(),g=y.umod(this.n);if(0!==g.cmpn(0)){var m=d.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==y.cmp(g)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),b^=1),new h({r:g,s:m,recoveryParam:b})}}}}}},l.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new h(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new h(t,i);var o=this.n,s=new n(e),a=t.r,c=t.s,l=1&r,f=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),l):this.curve.pointFromX(a,l);var d=t.r.invm(o),p=o.sub(s).mul(d).umod(o),y=c.mul(d).umod(o);return this.g.mulAdd(p,a,y)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new h(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},38332:(e,t,r)=>{"use strict";var n=r(33248),i=r(86306).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"===typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},88211:(e,t,r)=>{"use strict";var n=r(33248),i=r(86306),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function h(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=u(e,r);if(!1===s)return!1;var c=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var h=u(e,r);if(!1===h)return!1;if(e.length!==h+r.place)return!1;var l=e.slice(r.place,h+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];h(n,t.length),(n=n.concat(t)).push(2),h(n,r.length);var o=n.concat(r),s=[48];return h(s,o.length),s=s.concat(o),i.encode(s,e)}},16119:(e,t,r)=>{"use strict";var n=r(19174),i=r(45839),o=r(86306),s=o.assert,a=o.parseBytes,u=r(46780),c=r(69353);function h(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof h))return new h(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=h,h.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},h.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},h.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},h.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},h.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},h.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},h.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!==(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},h.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(e){return o.intFromLE(e)},h.prototype.isPoint=function(e){return e instanceof this.pointClass}},46780:(e,t,r)=>{"use strict";var n=r(86306),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},69353:(e,t,r)=>{"use strict";var n=r(33248),i=r(86306),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(e,t){this.eddsa=e,"object"!==typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},58222:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},86306:(e,t,r)=>{"use strict";var n=t,i=r(33248),o=r(36247),s=r(90670);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),s=0===(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(s),a=0===(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},61446:e=>{"use strict";function t(e,t){for(const r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}e.exports=function(e,r,n){if(!e||"string"===typeof e)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"===typeof r&&(n=r,r=""),r&&(n.code=r);try{return t(e,n)}catch(i){n.message=e.message,n.stack=e.stack;const r=function(){};r.prototype=Object.create(Object.getPrototypeOf(e));return t(new r,n)}}},4683:e=>{"use strict";function t(e,t){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(void 0!==i&&null!==i)for(var o=Object.keys(Object(i)),s=0,a=o.length;s<a;s++){var u=o[s],c=Object.getOwnPropertyDescriptor(i,u);void 0!==c&&c.enumerable&&(r[u]=i[u])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},5844:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promisify=n;var r="__ES6-PROMISIFY--CUSTOM-ARGUMENTS__";function n(e){if("function"!==typeof e)throw new TypeError("Argument to promisify must be a function");var t=e[r],i=n.Promise||Promise;if("function"!==typeof i)throw new Error("No Promise implementation found; do you need a polyfill?");return function(){for(var r=this,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return new i((function(n,i){o.push((function(e){if(e)return i(e);for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];if(1===o.length||!t)return n(o[0]);var a={};o.forEach((function(e,r){var n=t[r];n&&(a[n]=e)})),n(a)})),e.apply(r,o)}))}}n.argumentNames=r,n.Promise=void 0},71014:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(39084);t.EventIterator=n.EventIterator,t.subscribe=function(e,t,r){return new n.EventIterator((r=>{let{push:n}=r;return this.addEventListener(e,n,t),()=>this.removeEventListener(e,n,t)}),r)},t.default=n.EventIterator},39084:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(){this.pullQueue=[],this.pushQueue=[],this.eventHandlers={},this.isPaused=!1,this.isStopped=!1}push(e){if(this.isStopped)return;const t={value:e,done:!1};if(this.pullQueue.length){const e=this.pullQueue.shift();e&&e.resolve(t)}else this.pushQueue.push(Promise.resolve(t)),void 0!==this.highWaterMark&&this.pushQueue.length>=this.highWaterMark&&!this.isPaused&&(this.isPaused=!0,this.eventHandlers.highWater?this.eventHandlers.highWater():console&&console.warn("EventIterator queue reached ".concat(this.pushQueue.length," items")))}stop(){if(!this.isStopped){this.isStopped=!0,this.remove();for(const e of this.pullQueue)e.resolve({value:void 0,done:!0});this.pullQueue.length=0}}fail(e){if(!this.isStopped)if(this.isStopped=!0,this.remove(),this.pullQueue.length){for(const t of this.pullQueue)t.reject(e);this.pullQueue.length=0}else{const t=Promise.reject(e);t.catch((()=>{})),this.pushQueue.push(t)}}remove(){Promise.resolve().then((()=>{this.removeCallback&&this.removeCallback()}))}[Symbol.asyncIterator](){return{next:e=>{const t=this.pushQueue.shift();return t?(void 0!==this.lowWaterMark&&this.pushQueue.length<=this.lowWaterMark&&this.isPaused&&(this.isPaused=!1,this.eventHandlers.lowWater&&this.eventHandlers.lowWater()),t):this.isStopped?Promise.resolve({value:void 0,done:!0}):new Promise(((e,t)=>{this.pullQueue.push({resolve:e,reject:t})}))},return:()=>(this.isStopped=!0,this.pushQueue.length=0,this.remove(),Promise.resolve({value:void 0,done:!0}))}}}class n{constructor(e){let{highWaterMark:t=100,lowWaterMark:n=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new r;i.highWaterMark=t,i.lowWaterMark=n,i.removeCallback=e({push:e=>i.push(e),stop:()=>i.stop(),fail:e=>i.fail(e),on:(e,t)=>{i.eventHandlers[e]=t}})||(()=>{}),this[Symbol.asyncIterator]=()=>i[Symbol.asyncIterator](),Object.freeze(this)}}t.EventIterator=n,t.default=n},43748:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,n,o,s){if("function"!==typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||e,s),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],a]:e._events[u].push(a):(e._events[u]=a,e._eventsCount++),e}function s(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,i,o,s){var a=r?r+e:e;if(!this._events[a])return!1;var u,c,h=this._events[a],l=arguments.length;if(h.fn){switch(h.once&&this.removeListener(e,h.fn,void 0,!0),l){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,t),!0;case 3:return h.fn.call(h.context,t,n),!0;case 4:return h.fn.call(h.context,t,n,i),!0;case 5:return h.fn.call(h.context,t,n,i,o),!0;case 6:return h.fn.call(h.context,t,n,i,o,s),!0}for(c=1,u=new Array(l-1);c<l;c++)u[c-1]=arguments[c];h.fn.apply(h.context,u)}else{var f,d=h.length;for(c=0;c<d;c++)switch(h[c].once&&this.removeListener(e,h[c].fn,void 0,!0),l){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,t);break;case 3:h[c].fn.call(h[c].context,t,n);break;case 4:h[c].fn.call(h[c].context,t,n,i);break;default:if(!u)for(f=1,u=new Array(l-1);f<l;f++)u[f-1]=arguments[f];h[c].fn.apply(h[c].context,u)}}return!0},a.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,i){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||i&&!a.once||n&&a.context!==n||s(this,o);else{for(var u=0,c=[],h=a.length;u<h;u++)(a[u].fn!==t||i&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},2331:e=>{"use strict";var t,r="object"===typeof Reflect?Reflect:null,n=r&&"function"===typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"===typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"===typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"===typeof e.on&&y(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"===typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=s.length,c=h,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function f(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"===typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!==typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!==typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"===typeof u)n(u,this,t);else{var c=u.length,h=p(u,c);for(r=0;r<c;++r)n(h[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!==typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},4292:e=>{e.exports=class{constructor(e){if(!(e>0)||0!==(e-1&e))throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){const e=this.buffer[this.btm];if(void 0!==e)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return void 0===this.buffer[this.btm]}}},73938:(e,t,r)=>{const n=r(4292);e.exports=class{constructor(e){this.hwm=e||16,this.head=new n(this.hwm),this.tail=this.head}push(e){if(!this.head.push(e)){const t=this.head;this.head=t.next=new n(2*this.head.buffer.length),this.head.push(e)}}shift(){const e=this.tail.shift();if(void 0===e&&this.tail.next){const e=this.tail.next;return this.tail.next=null,this.tail=e,this.tail.shift()}return e}isEmpty(){return this.head.isEmpty()}}},65060:e=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function(e,n,i){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var s=0;s<o;s++)n.call(i,e[s],s,e);else for(var a in e)t.call(e,a)&&n.call(i,e[a],a,e)}},61466:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!==typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var t=o.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),h=[],l=0;l<c;l++)h.push("$"+l);if(s=Function("binder","return function ("+h.join(",")+"){ return binder.apply(this,arguments); }")(u),o.prototype){var f=function(){};f.prototype=o.prototype,s.prototype=new f,f.prototype=null}return s}},47022:(e,t,r)=>{"use strict";var n=r(61466);e.exports=Function.prototype.bind||n},66953:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(T){u=null}var c=function(){throw new s},h=u?function(){try{return c}catch(e){try{return u(arguments,"callee").get}catch(t){return c}}}():c,l=r(4931)(),f=Object.getPrototypeOf||function(e){return e.__proto__},d={},p="undefined"===typeof Uint8Array?n:f(Uint8Array),y={"%AggregateError%":"undefined"===typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"===typeof Atomics?n:Atomics,"%BigInt%":"undefined"===typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"===typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%Int8Array%":"undefined"===typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?f(f([][Symbol.iterator]())):n,"%JSON%":"object"===typeof JSON?JSON:n,"%Map%":"undefined"===typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&l?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?n:Promise,"%Proxy%":"undefined"===typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"===typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&l?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?f(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":h,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"===typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"===typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?n:WeakSet},g=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=f(i.prototype))}return y[t]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(47022),v=r(63567),w=b.call(Function.call,Array.prototype.concat),_=b.call(Function.apply,Array.prototype.splice),E=b.call(Function.call,String.prototype.replace),S=b.call(Function.call,String.prototype.slice),M=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,I=function(e){var t=S(e,0,1),r=S(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return E(e,M,(function(e,t,r,i){n[n.length]=r?E(i,A,"$1"):t||e})),n},k=function(e,t){var r,n=e;if(v(m,n)&&(n="%"+(r=m[n])[0]+"%"),v(y,n)){var o=y[n];if(o===d&&(o=g(n)),"undefined"===typeof o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new s('"allowMissing" argument must be a boolean');var r=I(e),n=r.length>0?r[0]:"",o=k("%"+n+"%",t),a=o.name,c=o.value,h=!1,l=o.alias;l&&(n=l[0],_(r,w([0,1],l)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],g=S(p,0,1),m=S(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===m||"'"===m||"`"===m)&&g!==m)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&d||(h=!0),v(y,a="%"+(n+="."+p)+"%"))c=y[a];else if(null!=c){if(!(p in c)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(u&&f+1>=r.length){var b=u(c,p);c=(d=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:c[p]}else d=v(c,p),c=c[p];d&&!h&&(y[a]=c)}}return c}},56083:e=>{e.exports=function(e){if(e){if("function"===typeof e[Symbol.iterator])return e[Symbol.iterator]();if("function"===typeof e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();if("function"===typeof e.next)return e}throw new Error("argument is not an iterator or iterable")}},4931:(e,t,r)=>{"use strict";var n="undefined"!==typeof Symbol&&Symbol,i=r(8021);e.exports=function(){return"function"===typeof n&&("function"===typeof Symbol&&("symbol"===typeof n("foo")&&("symbol"===typeof Symbol("bar")&&i())))}},8021:e=>{"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},63567:(e,t,r)=>{"use strict";var n=r(47022);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},19174:(e,t,r)=>{var n=t;n.utils=r(82135),n.common=r(74845),n.sha=r(31843),n.ripemd=r(9701),n.hmac=r(19955),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},74845:(e,t,r)=>{"use strict";var n=r(82135),i=r(36247);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},19955:(e,t,r)=>{"use strict";var n=r(82135),i=r(36247);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},9701:(e,t,r)=>{"use strict";var n=r(82135),i=r(74845),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function h(){if(!(this instanceof h))return new h;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function f(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function d(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(h,c),t.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],h=this.h[4],b=r,v=n,w=i,_=c,E=h,S=0;S<80;S++){var M=s(o(u(r,l(S,n,i,c),e[p[S]+t],f(S)),g[S]),h);r=h,h=c,c=o(i,10),i=n,n=M,M=s(o(u(b,l(79-S,v,w,_),e[y[S]+t],d(S)),m[S]),E),b=E,E=_,_=o(w,10),w=v,v=M}M=a(this.h[1],i,_),this.h[1]=a(this.h[2],c,E),this.h[2]=a(this.h[3],h,b),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=M},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},31843:(e,t,r)=>{"use strict";t.sha1=r(79160),t.sha224=r(12721),t.sha256=r(52357),t.sha384=r(33533),t.sha512=r(82594)},79160:(e,t,r)=>{"use strict";var n=r(82135),i=r(74845),o=r(13280),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=o.ft_1,h=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(f,h),e.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],h=this.h[2],f=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=u(s(i,5),c(p,o,h,f),d,r[n],l[p]);d=f,f=h,h=s(o,30),o=i,i=y}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],f),this.h[4]=a(this.h[4],d)},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},12721:(e,t,r)=>{"use strict";var n=r(82135),i=r(52357);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},52357:(e,t,r)=>{"use strict";var n=r(82135),i=r(74845),o=r(13280),s=r(36247),a=n.sum32,u=n.sum32_4,c=n.sum32_5,h=o.ch32,l=o.maj32,f=o.s0_256,d=o.s1_256,p=o.g0_256,y=o.g1_256,g=i.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],m=this.h[3],b=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=c(_,d(b),h(b,v,w),this.k[n],r[n]),S=a(f(i),l(i,o,g));_=w,w=v,v=b,b=a(m,E),m=g,g=o,o=i,i=a(E,S)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],b),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},33533:(e,t,r)=>{"use strict";var n=r(82135),i=r(82594);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},82594:(e,t,r)=>{"use strict";var n=r(82135),i=r(74845),o=r(36247),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,h=n.sum64,l=n.sum64_hi,f=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,g=n.sum64_5_lo,m=i.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function _(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function S(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function M(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function k(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,1)^s(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=a(e,t,1)^a(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,19)^s(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function C(e,t){var r=a(e,t,19)^a(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,m),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=P(r[n-4],r[n-3]),o=C(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=T(r[n-30],r[n-29]),c=R(r[n-30],r[n-29]),h=r[n-32],l=r[n-31];r[n]=d(i,o,s,a,u,c,h,l),r[n+1]=p(i,o,s,a,u,c,h,l)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],c=this.h[5],d=this.h[6],p=this.h[7],m=this.h[8],b=this.h[9],v=this.h[10],T=this.h[11],R=this.h[12],P=this.h[13],C=this.h[14],O=this.h[15];o(this.k.length===r.length);for(var x=0;x<r.length;x+=2){var B=C,D=O,N=I(m,b),L=k(m,b),K=w(m,b,v,T,R),U=_(m,b,v,T,R,P),j=this.k[x],q=this.k[x+1],F=r[x],z=r[x+1],V=y(B,D,N,L,K,U,j,q,F,z),H=g(B,D,N,L,K,U,j,q,F,z);B=M(n,i),D=A(n,i),N=E(n,i,s,a,u),L=S(n,i,s,a,u,c);var G=l(B,D,N,L),W=f(B,D,N,L);C=R,O=P,R=v,P=T,v=m,T=b,m=l(d,p,V,H),b=f(p,p,V,H),d=u,p=c,u=s,c=a,s=n,a=i,n=l(V,H,G,W),i=f(V,H,G,W)}h(this.h,0,n,i),h(this.h,2,s,a),h(this.h,4,u,c),h(this.h,6,d,p),h(this.h,8,m,b),h(this.h,10,v,T),h(this.h,12,R,P),h(this.h,14,C,O)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},13280:(e,t,r)=>{"use strict";var n=r(82135).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?s(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},82135:(e,t,r)=>{"use strict";var n=r(36247),i=r(49073);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=u(i.toString(16))}return r},t.zero2=a,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4===0);for(var s=new Array(o/4),a=0,u=t;a<s.length;a++,u+=4){var c;c="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],s[a]=c>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,u,c){var h=0,l=t;return h+=(l=l+n>>>0)<t?1:0,h+=(l=l+o>>>0)<o?1:0,h+=(l=l+a>>>0)<a?1:0,e+r+i+s+u+(h+=(l=l+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,u,c){return t+n+o+a+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},28831:e=>{e.exports=function(e){if(!e)throw Error("hashlru must have a max value, of type number, greater than 0");var t=0,r=Object.create(null),n=Object.create(null);function i(i,o){r[i]=o,++t>=e&&(t=0,n=r,r=Object.create(null))}return{has:function(e){return void 0!==r[e]||void 0!==n[e]},remove:function(e){void 0!==r[e]&&(r[e]=void 0),void 0!==n[e]&&(n[e]=void 0)},get:function(e){var t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(i(e,t),t):void 0},set:function(e,t){void 0!==r[e]?r[e]=t:i(e,t)},clear:function(){r=Object.create(null),n=Object.create(null)}}}},93478:(e,t,r)=>{var n,i=r(21964);!function(){"use strict";var t="object"===typeof window?window:{};!t.HI_BASE32_NO_NODE_JS&&"object"===typeof i&&i.versions&&i.versions.node&&(t=r.g);var o=!t.HI_BASE32_NO_COMMON_JS&&e.exports,s=r.amdO,a="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),u={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},c=[0,0,0,0,0,0,0,0],h=function(e,t){t.length>10&&(t="..."+t.substr(-10));var r=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+e+" bytes: "+t+" <-");throw r.position=e,r},l=function(e){if(""===e)return[];if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");for(var t,r,n,i,o,s,a,c,h=[],l=0,f=(e=e.replace(/=/g,"")).length,d=0,p=f>>3<<3;d<p;)t=u[e.charAt(d++)],r=u[e.charAt(d++)],n=u[e.charAt(d++)],i=u[e.charAt(d++)],o=u[e.charAt(d++)],s=u[e.charAt(d++)],a=u[e.charAt(d++)],c=u[e.charAt(d++)],h[l++]=255&(t<<3|r>>>2),h[l++]=255&(r<<6|n<<1|i>>>4),h[l++]=255&(i<<4|o>>>1),h[l++]=255&(o<<7|s<<2|a>>>3),h[l++]=255&(a<<5|c);var y=f-p;return 2===y?(t=u[e.charAt(d++)],r=u[e.charAt(d++)],h[l++]=255&(t<<3|r>>>2)):4===y?(t=u[e.charAt(d++)],r=u[e.charAt(d++)],n=u[e.charAt(d++)],i=u[e.charAt(d++)],h[l++]=255&(t<<3|r>>>2),h[l++]=255&(r<<6|n<<1|i>>>4)):5===y?(t=u[e.charAt(d++)],r=u[e.charAt(d++)],n=u[e.charAt(d++)],i=u[e.charAt(d++)],o=u[e.charAt(d++)],h[l++]=255&(t<<3|r>>>2),h[l++]=255&(r<<6|n<<1|i>>>4),h[l++]=255&(i<<4|o>>>1)):7===y&&(t=u[e.charAt(d++)],r=u[e.charAt(d++)],n=u[e.charAt(d++)],i=u[e.charAt(d++)],o=u[e.charAt(d++)],s=u[e.charAt(d++)],a=u[e.charAt(d++)],h[l++]=255&(t<<3|r>>>2),h[l++]=255&(r<<6|n<<1|i>>>4),h[l++]=255&(i<<4|o>>>1),h[l++]=255&(o<<7|s<<2|a>>>3)),h},f=function(e,t){if(!t)return function(e){for(var t,r,n="",i=e.length,o=0,s=0;o<i;)if((t=e[o++])<=127)n+=String.fromCharCode(t);else{t>191&&t<=223?(r=31&t,s=1):t<=239?(r=15&t,s=2):t<=247?(r=7&t,s=3):h(o,n);for(var a=0;a<s;++a)((t=e[o++])<128||t>191)&&h(o,n),r<<=6,r+=63&t;r>=55296&&r<=57343&&h(o,n),r>1114111&&h(o,n),r<=65535?n+=String.fromCharCode(r):(r-=65536,n+=String.fromCharCode(55296+(r>>10)),n+=String.fromCharCode(56320+(1023&r)))}return n}(l(e));if(""===e)return"";if(!/^[A-Z2-7=]+$/.test(e))throw new Error("Invalid base32 characters");var r,n,i,o,s,a,c,f,d="",p=e.indexOf("=");-1===p&&(p=e.length);for(var y=0,g=p>>3<<3;y<g;)r=u[e.charAt(y++)],n=u[e.charAt(y++)],i=u[e.charAt(y++)],o=u[e.charAt(y++)],s=u[e.charAt(y++)],a=u[e.charAt(y++)],c=u[e.charAt(y++)],f=u[e.charAt(y++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))+String.fromCharCode(255&(o<<4|s>>>1))+String.fromCharCode(255&(s<<7|a<<2|c>>>3))+String.fromCharCode(255&(c<<5|f));var m=p-g;return 2===m?(r=u[e.charAt(y++)],n=u[e.charAt(y++)],d+=String.fromCharCode(255&(r<<3|n>>>2))):4===m?(r=u[e.charAt(y++)],n=u[e.charAt(y++)],i=u[e.charAt(y++)],o=u[e.charAt(y++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))):5===m?(r=u[e.charAt(y++)],n=u[e.charAt(y++)],i=u[e.charAt(y++)],o=u[e.charAt(y++)],s=u[e.charAt(y++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))+String.fromCharCode(255&(o<<4|s>>>1))):7===m&&(r=u[e.charAt(y++)],n=u[e.charAt(y++)],i=u[e.charAt(y++)],o=u[e.charAt(y++)],s=u[e.charAt(y++)],a=u[e.charAt(y++)],c=u[e.charAt(y++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))+String.fromCharCode(255&(o<<4|s>>>1))+String.fromCharCode(255&(s<<7|a<<2|c>>>3))),d},d={encode:function(e,t){var r="string"!==typeof e;return r&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),r?function(e){for(var t,r,n,i,o,s="",u=e.length,c=0,h=5*parseInt(u/5);c<h;)t=e[c++],r=e[c++],n=e[c++],i=e[c++],o=e[c++],s+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[31&(i<<3|o>>>5)]+a[31&o];var l=u-h;return 1===l?(t=e[c],s+=a[t>>>3]+a[t<<2&31]+"======"):2===l?(t=e[c++],r=e[c],s+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[r<<4&31]+"===="):3===l?(t=e[c++],r=e[c++],n=e[c],s+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[n<<1&31]+"==="):4===l&&(t=e[c++],r=e[c++],n=e[c++],i=e[c],s+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[i<<3&31]+"="),s}(e):t?function(e){for(var t,r,n,i,o,s="",u=e.length,c=0,h=5*parseInt(u/5);c<h;)t=e.charCodeAt(c++),r=e.charCodeAt(c++),n=e.charCodeAt(c++),i=e.charCodeAt(c++),o=e.charCodeAt(c++),s+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[31&(i<<3|o>>>5)]+a[31&o];var l=u-h;return 1===l?(t=e.charCodeAt(c),s+=a[t>>>3]+a[t<<2&31]+"======"):2===l?(t=e.charCodeAt(c++),r=e.charCodeAt(c),s+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[r<<4&31]+"===="):3===l?(t=e.charCodeAt(c++),r=e.charCodeAt(c++),n=e.charCodeAt(c),s+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[n<<1&31]+"==="):4===l&&(t=e.charCodeAt(c++),r=e.charCodeAt(c++),n=e.charCodeAt(c++),i=e.charCodeAt(c),s+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[i<<3&31]+"="),s}(e):function(e){var t,r,n,i,o,s,u,h=!1,l="",f=0,d=0,p=e.length;if(""===e)return l;do{for(c[0]=c[5],c[1]=c[6],c[2]=c[7],u=d;f<p&&u<5;++f)(s=e.charCodeAt(f))<128?c[u++]=s:s<2048?(c[u++]=192|s>>6,c[u++]=128|63&s):s<55296||s>=57344?(c[u++]=224|s>>12,c[u++]=128|s>>6&63,c[u++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++f)),c[u++]=240|s>>18,c[u++]=128|s>>12&63,c[u++]=128|s>>6&63,c[u++]=128|63&s);d=u-5,f===p&&++f,f>p&&u<6&&(h=!0),t=c[0],u>4?(r=c[1],n=c[2],i=c[3],o=c[4],l+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[31&(i<<3|o>>>5)]+a[31&o]):1===u?l+=a[t>>>3]+a[t<<2&31]+"======":2===u?(r=c[1],l+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[r<<4&31]+"===="):3===u?(r=c[1],n=c[2],l+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[n<<1&31]+"==="):(r=c[1],n=c[2],i=c[3],l+=a[t>>>3]+a[31&(t<<2|r>>>6)]+a[r>>>1&31]+a[31&(r<<4|n>>>4)]+a[31&(n<<1|i>>>7)]+a[i>>>2&31]+a[i<<3&31]+"=")}while(!h);return l}(e)},decode:f};f.asBytes=l,o?e.exports=d:(t.base32=d,s&&(void 0===(n=function(){return d}.call(d,r,d,e))||(e.exports=n)))}()},83608:(e,t,r)=>{"use strict";var n=r(19174),i=r(90670),o=r(36247);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!==typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},20269:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,h=-7,l=r?i-1:0,f=r?-1:1,d=e[t+l];for(l+=f,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+e[t+l],l+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+e[t+l],l+=f,h-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,h=(1<<c)-1,l=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?f/u:f*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=h?(a=0,s=h):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*y}},13800:e=>{"use strict";e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if(r={indent:" ",includeEmptyLines:!1,...r},"string"!==typeof e)throw new TypeError("Expected `input` to be a `string`, got `".concat(typeof e,"`"));if("number"!==typeof t)throw new TypeError("Expected `count` to be a `number`, got `".concat(typeof t,"`"));if("string"!==typeof r.indent)throw new TypeError("Expected `options.indent` to be a `string`, got `".concat(typeof r.indent,"`"));if(0===t)return e;const n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}},49073:e=>{"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},67108:(e,t,r)=>{"use strict";const{sortAll:n}=r(70959),i=r(98559),o=r(60721),s=r(24264);e.exports=class{open(){return Promise.reject(new Error(".open is not implemented"))}close(){return Promise.reject(new Error(".close is not implemented"))}put(e,t,r){return Promise.reject(new Error(".put is not implemented"))}get(e,t){return Promise.reject(new Error(".get is not implemented"))}has(e,t){return Promise.reject(new Error(".has is not implemented"))}delete(e,t){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for await(const{key:r,value:n}of e)await this.put(r,n,t),yield{key:r,value:n}}async*getMany(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for await(const r of e)yield this.get(r,t)}async*deleteMany(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for await(const r of e)await this.delete(r,t),yield r}batch(){let e=[],t=[];return{put(t,r){e.push({key:t,value:r})},delete(e){t.push(e)},commit:async r=>{await i(this.putMany(e,r)),e=[],await i(this.deleteMany(t,r)),t=[]}}}async*_all(e,t){throw new Error("._all is not implemented")}async*_allKeys(e,t){throw new Error("._allKeys is not implemented")}query(e,t){let r=this._all(e,t);if(null!=e.prefix&&(r=o(r,(t=>t.key.toString().startsWith(e.prefix)))),Array.isArray(e.filters)&&(r=e.filters.reduce(((e,t)=>o(e,t)),r)),Array.isArray(e.orders)&&(r=e.orders.reduce(((e,t)=>n(e,t)),r)),null!=e.offset){let t=0;r=o(r,(()=>t++>=e.offset))}return null!=e.limit&&(r=s(r,e.limit)),r}queryKeys(e,t){let r=this._allKeys(e,t);if(null!=e.prefix&&(r=o(r,(t=>t.toString().startsWith(e.prefix)))),Array.isArray(e.filters)&&(r=e.filters.reduce(((e,t)=>o(e,t)),r)),Array.isArray(e.orders)&&(r=e.orders.reduce(((e,t)=>n(e,t)),r)),null!=e.offset){let t=0;r=o(r,(()=>t++>=e.offset))}return null!=e.limit&&(r=s(r,e.limit)),r}}},59501:(e,t,r)=>{"use strict";const n=r(61446);e.exports={dbOpenFailedError:function(e){return e=e||new Error("Cannot open database"),n(e,"ERR_DB_OPEN_FAILED")},dbDeleteFailedError:function(e){return e=e||new Error("Delete failed"),n(e,"ERR_DB_DELETE_FAILED")},dbWriteFailedError:function(e){return e=e||new Error("Write failed"),n(e,"ERR_DB_WRITE_FAILED")},notFoundError:function(e){return e=e||new Error("Not Found"),n(e,"ERR_NOT_FOUND")},abortedError:function(e){return e=e||new Error("Aborted"),n(e,"ERR_ABORTED")}}},83198:(e,t,r)=>{"use strict";const n=r(21528),i=r(79472),o=r(70959),s=r(59501),a=r(67108);e.exports={Key:n,MemoryDatastore:i,utils:o,Errors:s,Adapter:a}},21528:(e,t,r)=>{"use strict";const{nanoid:n}=r(85374),i=r(94670),o=r(6113),s="/",a=(new TextEncoder).encode(s),u=a[0];class c{constructor(e,t){if("string"===typeof e)this._buf=o(e);else{if(!(e instanceof Uint8Array))throw new Error("Invalid key, should be String of Uint8Array");this._buf=e}if(null==t&&(t=!0),t&&this.clean(),0===this._buf.byteLength||this._buf[0]!==u)throw new Error("Invalid key")}toString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf8";return i(this._buf,e)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return"Key(".concat(this.toString(),")")}static withNamespaces(e){return new c(e.join(s))}static random(){return new c(n().replace(/-/g,""))}clean(){if(this._buf&&0!==this._buf.byteLength||(this._buf=a),this._buf[0]!==u){const e=new Uint8Array(this._buf.byteLength+1);e.fill(u,0,1),e.set(this._buf,1),this._buf=e}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===u;)this._buf=this._buf.subarray(0,-1)}less(e){const t=this.list(),r=e.list();for(let n=0;n<t.length;n++){if(r.length<n+1)return!1;const e=t[n],i=r[n];if(e<i)return!0;if(e>i)return!1}return t.length<r.length}reverse(){return c.withNamespaces(this.list().slice().reverse())}namespaces(){return this.list()}baseNamespace(){const e=this.namespaces();return e[e.length-1]}list(){return this.toString().split(s).slice(1)}type(){return function(e){const t=e.split(":");if(t.length<2)return"";return t.slice(0,-1).join(":")}(this.baseNamespace())}name(){return function(e){const t=e.split(":");return t[t.length-1]}(this.baseNamespace())}instance(e){return new c(this.toString()+":"+e)}path(){let e=this.parent().toString();return e.endsWith(s)||(e+=s),e+=this.type(),new c(e)}parent(){const e=this.list();return 1===e.length?new c(s):new c(e.slice(0,-1).join(s))}child(e){return this.toString()===s?e:e.toString()===s?this:new c(this.toString()+e.toString(),!1)}isAncestorOf(e){return e.toString()!==this.toString()&&e.toString().startsWith(this.toString())}isDecendantOf(e){return e.toString()!==this.toString()&&this.toString().startsWith(e.toString())}isTopLevel(){return 1===this.list().length}concat(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return c.withNamespaces([...this.namespaces(),...(n=t.map((e=>e.namespaces())),[].concat(...n))]);var n}}e.exports=c},79472:(e,t,r)=>{"use strict";const n=r(21528),i=r(67108),o=r(59501);e.exports=class extends i{constructor(){super(),this.data={}}open(){return Promise.resolve()}close(){return Promise.resolve()}async put(e,t){this.data[e.toString()]=t}async get(e){if(!await this.has(e))throw o.notFoundError();return this.data[e.toString()]}async has(e){return void 0!==this.data[e.toString()]}async delete(e){delete this.data[e.toString()]}async*_all(){yield*Object.entries(this.data).map((e=>{let[t,r]=e;return{key:new n(t),value:r}}))}async*_allKeys(){yield*Object.entries(this.data).map((e=>{let[t]=e;return new n(t)}))}}},70959:(e,t,r)=>{"use strict";const n=r(97217),i=r(76654);e.exports={sortAll:(e,t)=>async function*(){const r=await i(e);yield*r.sort(t)}(),tmpdir:n,replaceStartWith:(e,t)=>{const r=new RegExp("^"+t);return e.replace(r,"")}}},8236:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.v6=t.AddressError=t.Address6=t.Address4=void 0;var s=r(86617);Object.defineProperty(t,"Address4",{enumerable:!0,get:function(){return s.Address4}});var a=r(72609);Object.defineProperty(t,"Address6",{enumerable:!0,get:function(){return a.Address6}});var u=r(77656);Object.defineProperty(t,"AddressError",{enumerable:!0,get:function(){return u.AddressError}});var c=o(r(48144));t.v6={helpers:c}},77656:function(e,t){"use strict";var r=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.AddressError=void 0;var n=function(e){function t(t,r){var n=e.call(this,t)||this;return n.name="AddressError",null!==r&&(n.parseMessage=r),n}return r(t,e),t}(Error);t.AddressError=n},95231:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCorrect=t.isInSubnet=void 0,t.isInSubnet=function(e){return!(this.subnetMask<e.subnetMask)&&this.mask(e.subnetMask)===e.mask()},t.isCorrect=function(e){return function(){return this.addressMinusSuffix===this.correctForm()&&(this.subnetMask===e&&!this.parsedSubnet||this.parsedSubnet===String(this.subnetMask))}}},86617:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Address4=void 0;var s=o(r(95231)),a=o(r(76932)),u=r(77656),c=r(85620),h=r(10362),l=function(){function e(e){this.groups=a.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=s.isCorrect(a.BITS),this.isInSubnet=s.isInSubnet,this.address=e;var t=a.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet="/"+this.subnetMask,this.subnetMask<0||this.subnetMask>a.BITS)throw new u.AddressError("Invalid subnet mask.");e=e.replace(a.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}return e.isValid=function(t){try{return new e(t),!0}catch(r){return!1}},e.prototype.parse=function(e){var t=e.split(".");if(!e.match(a.RE_ADDRESS))throw new u.AddressError("Invalid IPv4 address.");return t},e.prototype.correctForm=function(){return this.parsedAddress.map((function(e){return parseInt(e,10)})).join(".")},e.fromHex=function(t){var r,n=t.replace(/:/g,"").padStart(8,"0"),i=[];for(r=0;r<8;r+=2){var o=n.slice(r,r+2);i.push(parseInt(o,16))}return new e(i.join("."))},e.fromInteger=function(t){return e.fromHex(t.toString(16))},e.fromArpa=function(t){return new e(t.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join("."))},e.prototype.toHex=function(){return this.parsedAddress.map((function(e){return h.sprintf("%02x",parseInt(e,10))})).join(":")},e.prototype.toArray=function(){return this.parsedAddress.map((function(e){return parseInt(e,10)}))},e.prototype.toGroup6=function(){var e,t=[];for(e=0;e<a.GROUPS;e+=2){var r=h.sprintf("%02x%02x",parseInt(this.parsedAddress[e],10),parseInt(this.parsedAddress[e+1],10));t.push(h.sprintf("%x",parseInt(r,16)))}return t.join(":")},e.prototype.bigInteger=function(){return new c.BigInteger(this.parsedAddress.map((function(e){return h.sprintf("%02x",parseInt(e,10))})).join(""),16)},e.prototype._startAddress=function(){return new c.BigInteger(this.mask()+"0".repeat(a.BITS-this.subnetMask),2)},e.prototype.startAddress=function(){return e.fromBigInteger(this._startAddress())},e.prototype.startAddressExclusive=function(){var t=new c.BigInteger("1");return e.fromBigInteger(this._startAddress().add(t))},e.prototype._endAddress=function(){return new c.BigInteger(this.mask()+"1".repeat(a.BITS-this.subnetMask),2)},e.prototype.endAddress=function(){return e.fromBigInteger(this._endAddress())},e.prototype.endAddressExclusive=function(){var t=new c.BigInteger("1");return e.fromBigInteger(this._endAddress().subtract(t))},e.fromBigInteger=function(t){return e.fromInteger(parseInt(t.toString(),10))},e.prototype.mask=function(e){return void 0===e&&(e=this.subnetMask),this.getBitsBase2(0,e)},e.prototype.getBitsBase2=function(e,t){return this.binaryZeroPad().slice(e,t)},e.prototype.reverseForm=function(e){e||(e={});var t=this.correctForm().split(".").reverse().join(".");return e.omitSuffix?t:h.sprintf("%s.in-addr.arpa.",t)},e.prototype.isMulticast=function(){return this.isInSubnet(new e("224.0.0.0/4"))},e.prototype.binaryZeroPad=function(){return this.bigInteger().toString(2).padStart(a.BITS,"0")},e.prototype.groupForV6=function(){var e=this.parsedAddress;return this.address.replace(a.RE_ADDRESS,h.sprintf('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',e.slice(0,2).join("."),e.slice(2,4).join(".")))},e}();t.Address4=l},72609:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.Address6=void 0;var a=o(r(95231)),u=o(r(76932)),c=o(r(1155)),h=o(r(48144)),l=r(86617),f=r(92885),d=r(77656),p=r(85620),y=r(10362);function g(e){if(!e)throw new Error("Assertion failed.")}function m(e){return e=(e=e.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2')).replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2')}function b(e){return y.sprintf("%04x",parseInt(e,16))}function v(e){return 255&e}var w=function(){function e(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=a.isInSubnet,this.isCorrect=a.isCorrect(c.BITS),this.groups=void 0===t?c.GROUPS:t,this.address=e;var r=c.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet="/"+this.subnetMask,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>c.BITS)throw new d.AddressError("Invalid subnet mask.");e=e.replace(c.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new d.AddressError("Invalid subnet mask.");var n=c.RE_ZONE_STRING.exec(e);n&&(this.zone=n[0],e=e.replace(c.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}return e.isValid=function(t){try{return new e(t),!0}catch(r){return!1}},e.fromBigInteger=function(t){var r,n=t.toString(16).padStart(32,"0"),i=[];for(r=0;r<c.GROUPS;r++)i.push(n.slice(4*r,4*(r+1)));return new e(i.join(":"))},e.fromURL=function(t){var r,n,i=null;if(-1!==t.indexOf("[")&&-1!==t.indexOf("]:")){if(null===(n=c.RE_URL_WITH_PORT.exec(t)))return{error:"failed to parse address with port",address:null,port:null};r=n[1],i=n[2]}else if(-1!==t.indexOf("/")){if(t=t.replace(/^[a-z0-9]+:\/\//,""),null===(n=c.RE_URL.exec(t)))return{error:"failed to parse address from URL",address:null,port:null};r=n[1]}else r=t;return i?((i=parseInt(i,10))<0||i>65536)&&(i=null):i=null,{address:new e(r),port:i}},e.fromAddress4=function(t){var r=new l.Address4(t),n=c.BITS-(u.BITS-r.subnetMask);return new e("::ffff:"+r.correctForm()+"/"+n)},e.fromArpa=function(t){var r=t.replace(/(\.ip6\.arpa)?\.$/,"");if(63!==r.length)throw new d.AddressError("Invalid 'ip6.arpa' form.");for(var n=r.split(".").reverse(),i=7;i>0;i--){var o=4*i;n.splice(o,0,":")}return new e(r=n.join(""))},e.prototype.microsoftTranscription=function(){return y.sprintf("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))},e.prototype.mask=function(e){return void 0===e&&(e=this.subnetMask),this.getBitsBase2(0,e)},e.prototype.possibleSubnets=function(e){void 0===e&&(e=128);var t=c.BITS-this.subnetMask-Math.abs(e-c.BITS);return t<0?"0":function(e){for(var t=/(\d+)(\d{3})/;t.test(e);)e=e.replace(t,"$1,$2");return e}(new p.BigInteger("2",10).pow(t).toString(10))},e.prototype._startAddress=function(){return new p.BigInteger(this.mask()+"0".repeat(c.BITS-this.subnetMask),2)},e.prototype.startAddress=function(){return e.fromBigInteger(this._startAddress())},e.prototype.startAddressExclusive=function(){var t=new p.BigInteger("1");return e.fromBigInteger(this._startAddress().add(t))},e.prototype._endAddress=function(){return new p.BigInteger(this.mask()+"1".repeat(c.BITS-this.subnetMask),2)},e.prototype.endAddress=function(){return e.fromBigInteger(this._endAddress())},e.prototype.endAddressExclusive=function(){var t=new p.BigInteger("1");return e.fromBigInteger(this._endAddress().subtract(t))},e.prototype.getScope=function(){var e=c.SCOPES[this.getBits(12,16).intValue()];return"Global unicast"===this.getType()&&"Link local"!==e&&(e="Global"),e||"Unknown"},e.prototype.getType=function(){for(var t=0,r=Object.keys(c.TYPES);t<r.length;t++){var n=r[t];if(this.isInSubnet(new e(n)))return c.TYPES[n]}return"Global unicast"},e.prototype.getBits=function(e,t){return new p.BigInteger(this.getBitsBase2(e,t),2)},e.prototype.getBitsBase2=function(e,t){return this.binaryZeroPad().slice(e,t)},e.prototype.getBitsBase16=function(e,t){var r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")},e.prototype.getBitsPastSubnet=function(){return this.getBitsBase2(this.subnetMask,c.BITS)},e.prototype.reverseForm=function(e){e||(e={});var t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:y.sprintf("%s.ip6.arpa.",r):e.omitSuffix?"":"ip6.arpa."},e.prototype.correctForm=function(){var e,t=[],r=0,n=[];for(e=0;e<this.parsedAddress.length;e++){var i=parseInt(this.parsedAddress[e],16);0===i&&r++,0!==i&&r>0&&(r>1&&n.push([e-r,e-1]),r=0)}r>1&&n.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);var o=n.map((function(e){return e[1]-e[0]+1}));if(n.length>0){var s=o.indexOf(Math.max.apply(Math,o));t=function(e,t){var r,n=[],i=[];for(r=0;r<e.length;r++)r<t[0]?n.push(e[r]):r>t[1]&&i.push(e[r]);return n.concat(["compact"]).concat(i)}(this.parsedAddress,n[s])}else t=this.parsedAddress;for(e=0;e<t.length;e++)"compact"!==t[e]&&(t[e]=parseInt(t[e],16).toString(16));var a=t.join(":");return a=(a=(a=a.replace(/^compact$/,"::")).replace(/^compact|compact$/,":")).replace(/compact/,"")},e.prototype.binaryZeroPad=function(){return this.bigInteger().toString(2).padStart(c.BITS,"0")},e.prototype.parse4in6=function(e){var t=e.split(":"),r=t.slice(-1)[0].match(u.RE_ADDRESS);if(r){this.parsedAddress4=r[0],this.address4=new l.Address4(this.parsedAddress4);for(var n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new d.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(u.RE_ADDRESS,this.address4.parsedAddress.map(m).join(".")));this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(":")}return e},e.prototype.parse=function(e){var t=(e=this.parse4in6(e)).match(c.RE_BAD_CHARACTERS);if(t)throw new d.AddressError(y.sprintf("Bad character%s detected in address: %s",t.length>1?"s":"",t.join("")),e.replace(c.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));var r=e.match(c.RE_BAD_ADDRESS);if(r)throw new d.AddressError(y.sprintf("Address failed regex: %s",r.join("")),e.replace(c.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));var n=[],i=e.split("::");if(2===i.length){var o=i[0].split(":"),s=i[1].split(":");1===o.length&&""===o[0]&&(o=[]),1===s.length&&""===s[0]&&(s=[]);var a=this.groups-(o.length+s.length);if(!a)throw new d.AddressError("Error parsing groups");this.elidedGroups=a,this.elisionBegin=o.length,this.elisionEnd=o.length+this.elidedGroups,n=n.concat(o);for(var u=0;u<a;u++)n.push("0");n=n.concat(s)}else{if(1!==i.length)throw new d.AddressError("Too many :: groups found");n=e.split(":"),this.elidedGroups=0}if((n=n.map((function(e){return y.sprintf("%x",parseInt(e,16))}))).length!==this.groups)throw new d.AddressError("Incorrect number of groups found");return n},e.prototype.canonicalForm=function(){return this.parsedAddress.map(b).join(":")},e.prototype.decimal=function(){return this.parsedAddress.map((function(e){return y.sprintf("%05d",parseInt(e,16))})).join(":")},e.prototype.bigInteger=function(){return new p.BigInteger(this.parsedAddress.map(b).join(""),16)},e.prototype.to4=function(){var e=this.binaryZeroPad().split("");return l.Address4.fromHex(new p.BigInteger(e.slice(96,128).join(""),2).toString(16))},e.prototype.to4in6=function(){var t=this.to4(),r=new e(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),n="";return/:$/.test(r)||(n=":"),r+n+t.address},e.prototype.inspectTeredo=function(){var e=this.getBitsBase16(0,32),t=this.getBits(80,96).xor(new p.BigInteger("ffff",16)).toString(),r=l.Address4.fromHex(this.getBitsBase16(32,64)),n=l.Address4.fromHex(this.getBits(96,128).xor(new p.BigInteger("ffffffff",16)).toString(16)),i=this.getBits(64,80),o=this.getBitsBase2(64,80),s=i.testBit(15),a=i.testBit(14),u=i.testBit(8),c=i.testBit(9),h=new p.BigInteger(o.slice(2,6)+o.slice(8,16),2).toString(10);return{prefix:y.sprintf("%s:%s",e.slice(0,4),e.slice(4,8)),server4:r.address,client4:n.address,flags:o,coneNat:s,microsoft:{reserved:a,universalLocal:c,groupIndividual:u,nonce:h},udpPort:t}},e.prototype.inspect6to4=function(){var e=this.getBitsBase16(0,16),t=l.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:y.sprintf("%s",e.slice(0,4)),gateway:t.address}},e.prototype.to6to4=function(){return this.is4()?new e(["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":")):null},e.prototype.toByteArray=function(){var e=this.bigInteger().toByteArray();return 17===e.length&&0===e[0]?e.slice(1):e},e.prototype.toUnsignedByteArray=function(){return this.toByteArray().map(v)},e.fromByteArray=function(e){return this.fromUnsignedByteArray(e.map(v))},e.fromUnsignedByteArray=function(t){for(var r=new p.BigInteger("256",10),n=new p.BigInteger("0",10),i=new p.BigInteger("1",10),o=t.length-1;o>=0;o--)n=n.add(i.multiply(new p.BigInteger(t[o].toString(10),10))),i=i.multiply(r);return e.fromBigInteger(n)},e.prototype.isCanonical=function(){return this.addressMinusSuffix===this.canonicalForm()},e.prototype.isLinkLocal=function(){return"1111111010000000000000000000000000000000000000000000000000000000"===this.getBitsBase2(0,64)},e.prototype.isMulticast=function(){return"Multicast"===this.getType()},e.prototype.is4=function(){return this.v4},e.prototype.isTeredo=function(){return this.isInSubnet(new e("2001::/32"))},e.prototype.is6to4=function(){return this.isInSubnet(new e("2002::/16"))},e.prototype.isLoopback=function(){return"Loopback"===this.getType()},e.prototype.href=function(e){return e=void 0===e?"":y.sprintf(":%s",e),y.sprintf("http://[%s]%s/",this.correctForm(),e)},e.prototype.link=function(e){e||(e={}),void 0===e.className&&(e.className=""),void 0===e.prefix&&(e.prefix="/#address="),void 0===e.v4&&(e.v4=!1);var t=this.correctForm;return e.v4&&(t=this.to4in6),e.className?y.sprintf('<a href="%1$s%2$s" class="%3$s">%2$s</a>',e.prefix,t.call(this),e.className):y.sprintf('<a href="%1$s%2$s">%2$s</a>',e.prefix,t.call(this))},e.prototype.group=function(){if(0===this.elidedGroups)return h.simpleGroup(this.address).join(":");g("number"===typeof this.elidedGroups),g("number"===typeof this.elisionBegin);var e=[],t=this.address.split("::"),r=t[0],n=t[1];r.length?e.push.apply(e,h.simpleGroup(r)):e.push("");for(var i=["hover-group"],o=this.elisionBegin;o<this.elisionBegin+this.elidedGroups;o++)i.push(y.sprintf("group-%d",o));return e.push(y.sprintf('<span class="%s"></span>',i.join(" "))),n.length?e.push.apply(e,h.simpleGroup(n,this.elisionEnd)):e.push(""),this.is4()&&(g(this.address4 instanceof l.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")},e.prototype.regularExpressionString=function(t){void 0===t&&(t=!1);var r=[],n=new e(this.correctForm());if(0===n.elidedGroups)r.push(f.simpleRegularExpression(n.parsedAddress));else if(n.elidedGroups===c.GROUPS)r.push(f.possibleElisions(c.GROUPS));else{var i=n.address.split("::");i[0].length&&r.push(f.simpleRegularExpression(i[0].split(":"))),g("number"===typeof n.elidedGroups),r.push(f.possibleElisions(n.elidedGroups,0!==i[0].length,0!==i[1].length)),i[1].length&&r.push(f.simpleRegularExpression(i[1].split(":"))),r=[r.join(":")]}return t||(r=s(s(["(?=^|",f.ADDRESS_BOUNDARY,"|[^\\w\\:])("],r),[")(?=[^\\w\\:]|",f.ADDRESS_BOUNDARY,"|$)"])),r.join("")},e.prototype.regularExpression=function(e){return void 0===e&&(e=!1),new RegExp(this.regularExpressionString(e),"i")},e}();t.Address6=w},76932:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RE_SUBNET_STRING=t.RE_ADDRESS=t.GROUPS=t.BITS=void 0,t.BITS=32,t.GROUPS=4,t.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,t.RE_SUBNET_STRING=/\/\d{1,2}$/},1155:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RE_URL_WITH_PORT=t.RE_URL=t.RE_ZONE_STRING=t.RE_SUBNET_STRING=t.RE_BAD_ADDRESS=t.RE_BAD_CHARACTERS=t.TYPES=t.SCOPES=t.GROUPS=t.BITS=void 0,t.BITS=128,t.GROUPS=8,t.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},t.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"},t.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi,t.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,t.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/,t.RE_ZONE_STRING=/%.*$/,t.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/),t.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)},48144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simpleGroup=t.spanLeadingZeroes=t.spanAll=t.spanAllZeroes=void 0;var n=r(10362);function i(e){return e.replace(/(0+)/g,'<span class="zero">$1</span>')}function o(e){return e.replace(/^(0+)/,'<span class="zero">$1</span>')}t.spanAllZeroes=i,t.spanAll=function(e,t){return void 0===t&&(t=0),e.split("").map((function(e,r){return n.sprintf('<span class="digit value-%s position-%d">%s</span>',e,r+t,i(e))})).join("")},t.spanLeadingZeroes=function(e){return e.split(":").map((function(e){return o(e)})).join(":")},t.simpleGroup=function(e,t){return void 0===t&&(t=0),e.split(":").map((function(e,r){return/group-v4/.test(e)?e:n.sprintf('<span class="hover-group group-%d">%s</span>',r+t,o(e))}))}},92885:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.possibleElisions=t.simpleRegularExpression=t.ADDRESS_BOUNDARY=t.padGroup=t.groupPossibilities=void 0;var s=o(r(1155)),a=r(10362);function u(e){return a.sprintf("(%s)",e.join("|"))}function c(e){return e.length<4?a.sprintf("0{0,%d}%s",4-e.length,e):e}t.groupPossibilities=u,t.padGroup=c,t.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]",t.simpleRegularExpression=function(e){var t=[];e.forEach((function(e,r){0===parseInt(e,16)&&t.push(r)}));var r=t.map((function(t){return e.map((function(e,r){if(r===t){var n=0===r||r===s.GROUPS-1?":":"";return u([c(e),n])}return c(e)})).join(":")}));return r.push(e.map(c).join(":")),u(r)},t.possibleElisions=function(e,t,r){var n=t?"":":",i=r?"":":",o=[];t||r||o.push("::"),t&&r&&o.push(""),(r&&!t||!r&&t)&&o.push(":"),o.push(a.sprintf("%s(:0{1,4}){1,%d}",n,e-1)),o.push(a.sprintf("(0{1,4}:){1,%d}%s",e-1,i)),o.push(a.sprintf("(0{1,4}:){%d}0{1,4}",e-1));for(var s=1;s<e-1;s++)for(var c=1;c<e-s;c++)o.push(a.sprintf("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",c,e-c-s-1));return u(o)}},10362:(e,t,r)=>{var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return a(c(e),arguments)}function s(e,t){return o.apply(null,[e].concat(t||[]))}function a(e,t){var r,n,s,a,u,c,h,l,f,d=1,p=e.length,y="";for(n=0;n<p;n++)if("string"===typeof e[n])y+=e[n];else if("object"===typeof e[n]){if((a=e[n]).keys)for(r=t[d],s=0;s<a.keys.length;s++){if(void 0==r)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',a.keys[s],a.keys[s-1]));r=r[a.keys[s]]}else r=a.param_no?t[a.param_no]:t[d++];if(i.not_type.test(a.type)&&i.not_primitive.test(a.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(a.type)&&"number"!==typeof r&&isNaN(r))throw new TypeError(o("[sprintf] expecting number but found %T",r));switch(i.number.test(a.type)&&(l=r>=0),a.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,a.width?parseInt(a.width):0);break;case"e":r=a.precision?parseFloat(r).toExponential(a.precision):parseFloat(r).toExponential();break;case"f":r=a.precision?parseFloat(r).toFixed(a.precision):parseFloat(r);break;case"g":r=a.precision?String(Number(r.toPrecision(a.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=a.precision?r.substring(0,a.precision):r;break;case"t":r=String(!!r),r=a.precision?r.substring(0,a.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=a.precision?r.substring(0,a.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=a.precision?r.substring(0,a.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(a.type)?y+=r:(!i.number.test(a.type)||l&&!a.sign?f="":(f=l?"+":"-",r=r.toString().replace(i.sign,"")),c=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",h=a.width-(f+r).length,u=a.width&&h>0?c.repeat(h):"",y+=a.align?f+r+u:"0"===c?f+u+r:u+f+r)}return y}var u=Object.create(null);function c(e){if(u[e])return u[e];for(var t,r=e,n=[],o=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var s=[],a=t[2],c=[];if(null===(c=i.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(a=a.substring(c[0].length));)if(null!==(c=i.key_access.exec(a)))s.push(c[1]);else{if(null===(c=i.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}t[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return u[e]=n}t.sprintf=o,t.vsprintf=s,"undefined"!==typeof window&&(window.sprintf=o,window.vsprintf=s,void 0===(n=function(){return{sprintf:o,vsprintf:s}}.call(t,r,t,e))||(e.exports=n))}()},51362:e=>{"use strict";const t="[a-fA-F\\d:]",r=e=>e&&e.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(t,")|(?<=").concat(t,")(?=\\s|$))"):"",n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",i="[a-fA-F\\d]{1,4}",o="\n(?:\n(?:".concat(i,":){7}(?:").concat(i,"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:").concat(i,":){6}(?:").concat(n,"|:").concat(i,"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:").concat(i,":){5}(?::").concat(n,"|(?::").concat(i,"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:").concat(i,":){4}(?:(?::").concat(i,"){0,1}:").concat(n,"|(?::").concat(i,"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:").concat(i,":){3}(?:(?::").concat(i,"){0,2}:").concat(n,"|(?::").concat(i,"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:").concat(i,":){2}(?:(?::").concat(i,"){0,3}:").concat(n,"|(?::").concat(i,"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:").concat(i,":){1}(?:(?::").concat(i,"){0,4}:").concat(n,"|(?::").concat(i,"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::").concat(i,"){0,5}:").concat(n,"|(?::").concat(i,"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),s=new RegExp("(?:^".concat(n,"$)|(?:^").concat(o,"$)")),a=new RegExp("^".concat(n,"$")),u=new RegExp("^".concat(o,"$")),c=e=>e&&e.exact?s:new RegExp("(?:".concat(r(e)).concat(n).concat(r(e),")|(?:").concat(r(e)).concat(o).concat(r(e),")"),"g");c.v4=e=>e&&e.exact?a:new RegExp("".concat(r(e)).concat(n).concat(r(e)),"g"),c.v6=e=>e&&e.exact?u:new RegExp("".concat(r(e)).concat(o).concat(r(e)),"g"),e.exports=c},72954:(e,t,r)=>{"use strict";var n=r(21964);const i=r(84137),o="object"===typeof window&&"object"===typeof document&&9===document.nodeType,s=i(),a=o&&!s,u=s&&!o,c=s&&o,h="undefined"!==typeof n&&"undefined"!==typeof n.release&&"node"===n.release.name&&!s,l="function"===typeof importScripts&&"undefined"!==typeof self&&"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,f="undefined"!==typeof n&&!1,d="undefined"!==typeof navigator&&"ReactNative"===navigator.product;e.exports={isTest:f,isElectron:s,isElectronMain:u,isElectronRenderer:c,isNode:h,isBrowser:a,isWebWorker:l,isEnvWithDom:o,isReactNative:d}},97217:(e,t,r)=>{"use strict";const{nanoid:n}=r(85374);e.exports=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>e;return e(n())}},18348:(e,t,r)=>{"use strict";var n="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag,i=r(28136)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},84137:(e,t,r)=>{var n=r(21964);e.exports=function(){return"undefined"!==typeof window&&"object"===typeof window.process&&"renderer"===window.process.type||(!("undefined"===typeof n||"object"!==typeof n.versions||!n.versions.electron)||"object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0)}},51403:e=>{"use strict";var t,r=Object.prototype.toString,n=Function.prototype.toString,i=/^\s*(?:function)?\*/,o="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag,s=Object.getPrototypeOf;e.exports=function(e){if("function"!==typeof e)return!1;if(i.test(n.call(e)))return!0;if(!o)return"[object GeneratorFunction]"===r.call(e);if(!s)return!1;if("undefined"===typeof t){var a=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(e){}}();t=!!a&&s(a)}return s(e)===t}},96339:(e,t,r)=>{"use strict";const n=r(51362),i=e=>n({exact:!0}).test(e);i.v4=e=>n.v4({exact:!0}).test(e),i.v6=e=>n.v6({exact:!0}).test(e),i.version=e=>i(e)?i.v4(e)?4:6:void 0,e.exports=i},54384:e=>{"use strict";e.exports=function(e){return/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^::1$/.test(e)}},20717:e=>{"use strict";e.exports=function(e){return e!==e}},56634:(e,t,r)=>{"use strict";var n=r(811),i=r(91157),o=r(20717),s=r(7392),a=r(75024),u=n(s(),Number);i(u,{getPolyfill:s,implementation:o,shim:a}),e.exports=u},7392:(e,t,r)=>{"use strict";var n=r(20717);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},75024:(e,t,r)=>{"use strict";var n=r(91157),i=r(7392);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},89359:e=>{"use strict";e.exports=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}},85313:(e,t,r)=>{"use strict";var n=r(65060),i=r(62393),o=r(28136),s=o("Object.prototype.toString"),a=r(4931)()&&"symbol"===typeof Symbol.toStringTag,u=i(),c=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},h=o("String.prototype.slice"),l={},f=r(4431),d=Object.getPrototypeOf;a&&f&&d&&n(u,(function(e){var t=new r.g[e];if(!(Symbol.toStringTag in t))throw new EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var n=d(t),i=f(n,Symbol.toStringTag);if(!i){var o=d(n);i=f(o,Symbol.toStringTag)}l[e]=i.get}));e.exports=function(e){if(!e||"object"!==typeof e)return!1;if(!a){var t=h(s(e),8,-1);return c(u,t)>-1}return!!f&&function(e){var t=!1;return n(l,(function(r,n){if(!t)try{t=r.call(e)===n}catch(i){}})),t}(e)}},6543:e=>{"use strict";const t=65536;e.exports=function(e){const r=new Uint8Array(e);let n=0;if(e>0)if(e>t)for(;n<e;)n+t>e?(crypto.getRandomValues(r.subarray(n,n+(e-n))),n+=e-n):(crypto.getRandomValues(r.subarray(n,n+t)),n+=t);else crypto.getRandomValues(r);return r}},32054:(e,t,r)=>{"use strict";const{URLWithLegacySupport:n,format:i,URLSearchParams:o,defaultBase:s}=r(2694),a=r(40739);e.exports={URL:n,URLSearchParams:o,format:i,relative:a,defaultBase:s}},40739:(e,t,r)=>{"use strict";const{URLWithLegacySupport:n,format:i}=r(2694);e.exports=function(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0,a=r.protocol?r.protocol.replace(":",""):"http";a=(o[a]||s||a)+":";try{t=new n(e)}catch(c){t={}}const u=Object.assign({},r,{protocol:a||t.protocol,host:r.host||t.host});return new n(e,i(u)).toString()}},2694:e=>{"use strict";const t="undefined"!==typeof navigator&&"ReactNative"===navigator.product;const r=self.URL,n=t?"http://localhost":self.location.protocol+"//"+self.location.host;e.exports={URLWithLegacySupport:class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n;this.super=new r(e,t),this.path=this.pathname+this.search,this.auth=this.username&&this.password?this.username+":"+this.password:null,this.query=this.search&&this.search.startsWith("?")?this.search.slice(1):null}get hash(){return this.super.hash}get host(){return this.super.host}get hostname(){return this.super.hostname}get href(){return this.super.href}get origin(){return this.super.origin}get password(){return this.super.password}get pathname(){return this.super.pathname}get port(){return this.super.port}get protocol(){return this.super.protocol}get search(){return this.super.search}get searchParams(){return this.super.searchParams}get username(){return this.super.username}set hash(e){this.super.hash=e}set host(e){this.super.host=e}set hostname(e){this.super.hostname=e}set href(e){this.super.href=e}set password(e){this.super.password=e}set pathname(e){this.super.pathname=e}set port(e){this.super.port=e}set protocol(e){this.super.protocol=e}set search(e){this.super.search=e}set username(e){this.super.username=e}static createObjectURL(e){return r.createObjectURL(e)}static revokeObjectURL(e){r.revokeObjectURL(e)}toJSON(){return this.super.toJSON()}toString(){return this.super.toString()}format(){return this.toString()}},URLSearchParams:self.URLSearchParams,defaultBase:n,format:function(e){if("string"===typeof e){return new r(e).toString()}if(!(e instanceof r)){const t=e.username&&e.password?"".concat(e.username,":").concat(e.password,"@"):"",r=e.auth?e.auth+"@":"",n=e.port?":"+e.port:"",i=e.protocol?e.protocol+"//":"",o=e.host||"",s=e.hostname||"",a=e.search||(e.query?"?"+e.query:""),u=e.hash||"",c=e.pathname||"",h=e.path||c+a;return"".concat(i).concat(t||r).concat(o||s+n).concat(h).concat(u)}}}},76654:e=>{"use strict";e.exports=async e=>{const t=[];for await(const r of e)t.push(r);return t}},46881:(e,t,r)=>{"use strict";const{Buffer:n}=r(29536),i=r(64277);e.exports=async function*(e){for await(const t of e)n.isBuffer(t)?yield t:i.isBufferList(t)?yield t.slice():yield n.from(t)},e.exports.toBuffer=e.exports,e.exports.toList=async function*(e){for await(const t of e)n.isBuffer(t)?yield(new i).append(t):i.isBufferList(t)?yield t:yield(new i).append(n.from(t))}},89554:(e,t,r)=>{const n=r(64277),i={string:()=>"",buffer:()=>n()};e.exports=async(e,t)=>{if((t=t||{}).type&&!i[t.type])throw new Error('invalid type "'.concat(t.type,'"'));let r,n;for await(const o of e)r||(n=t.type||("string"===typeof o?"string":"buffer"),r=i[n]()),"string"===n?r+=o:r.append(o);return r||i[t.type||"buffer"]()}},98559:e=>{"use strict";e.exports=async e=>{for await(const t of e);}},60721:e=>{"use strict";e.exports=async function*(e,t){for await(const r of e)await t(r)&&(yield r)}},11903:e=>{"use strict";e.exports=async e=>{for await(const t of e)return t}},16389:(e,t,r)=>{"use strict";const n=r(44606),i=r(89858),o=r(44966);e.exports=e=>{const t=i(),r=n(e.source),s=o();let a;const u=e.sink(async function*(){yield*t;const e=await s.promise;yield*e}());u.catch((e=>{a=e}));return{reader:r,writer:t,stream:{sink:e=>a?Promise.reject(a):(s.resolve(e),u),source:r},rest:()=>t.end(),write:t.push,read:async()=>(await r.next()).value}}},23133:(e,t,r)=>{"use strict";const{Buffer:n}=r(29536),i=r(64277),o=r(48577),s=4194304,a=n.alloc(0),u="readLength",c="readData",h={[u]:(e,t,r,n)=>{let o;t=t.append(e);try{o=n.lengthDecoder(t)}catch(s){if(t.length>n.maxLengthLength)throw Object.assign(s,{message:"message length too long",code:"ERR_MSG_LENGTH_TOO_LONG"});if(s instanceof RangeError)return{mode:u,buffer:t,chunk:void 0,state:void 0,data:void 0};throw s}if(o>n.maxDataLength)throw Object.assign(new Error("message data too long"),{code:"ERR_MSG_DATA_TOO_LONG"});return e=t.shallowSlice(n.lengthDecoder.bytes),t=new i,n.onLength&&n.onLength(o),o<=0?(n.onData&&n.onData(a),{mode:u,chunk:e,buffer:t,data:a}):{mode:c,chunk:e,buffer:t,state:{dataLength:o},data:void 0}},[c]:(e,t,r,n)=>{if(t=t.append(e),!r)throw new Error("state is required");if(t.length<r.dataLength)return{mode:c,buffer:t,state:r,chunk:void 0,data:void 0};const{dataLength:o}=r,s=t.shallowSlice(0,o),a=t.length>o?t.shallowSlice(o):void 0;return t=new i,n.onData&&n.onData(s),{mode:u,chunk:a,buffer:t,state:void 0,data:s}}};function l(e){const t={lengthDecoder:(e=e||{}).lengthDecoder||o,maxLengthLength:e.maxLengthLength||8,maxDataLength:e.maxDataLength||s,onLength:e.onLength,onData:e.onData};return async function*(e){let r,n=new i,o=u;for await(const i of e){let e=i;for(;e;){const i=h[o](e,n,r,t);o=i.mode,e=i.chunk,n=i.buffer,r=i.state,i.data&&(yield i.data)}}if(n.length)throw Object.assign(new Error("unexpected end of input"),{code:"ERR_UNEXPECTED_EOF"})}}l.fromReader=(e,t)=>{let r=1;const n={[Symbol.asyncIterator](){return this},next:async()=>{try{return await e.next(r)}catch(t){if("ERR_UNDER_READ"===t.code)return{done:!0,value:null};throw t}finally{r=1}}};return l({...t||{},onLength:e=>{r=e}})(n)},e.exports=l,e.exports.MAX_LENGTH_LENGTH=8,e.exports.MAX_DATA_LENGTH=s},33846:(e,t,r)=>{"use strict";const{Buffer:n}=r(29536),i=r(64277),o=r(17958);function s(e){e=e||{};const t=Math.max(e.poolSize||10240,e.minPoolSize||8),r=e.lengthEncoder||o;return async function*(e){let o=n.alloc(t),s=0;for await(const a of e){r(a.length,o,s);const e=o.slice(s,s+r.bytes);s+=r.bytes,o.length-s<8&&(o=n.alloc(t),s=0),yield(new i).append(e).append(a)}}}s.single=(e,t)=>{const r=(t=t||{}).lengthEncoder||o;return new i([r(e.length),e.slice()])},e.exports=s,e.exports.MIN_POOL_SIZE=8,e.exports.DEFAULT_POOL_SIZE=10240},4666:(e,t,r)=>{"use strict";t.encode=r(33846),t.decode=r(23133),t.varintEncode=r(17958),t.varintDecode=r(48577),t.int32BEEncode=r(78037),t.int32BEDecode=r(47816)},47816:e=>{"use strict";const t=e=>{if(e.length<4)throw RangeError("Could not decode int32BE");return e.readInt32BE(0)};t.bytes=4,e.exports=t},78037:(e,t,r)=>{"use strict";const{Buffer:n}=r(29536),i=(e,t,r)=>((t=t||n.allocUnsafe(4)).writeInt32BE(e,r),t);i.bytes=4,e.exports=i},48577:(e,t,r)=>{"use strict";const n=r(16980),{Buffer:i}=r(29536),o=e=>{const t=n.decode(i.isBuffer(e)?e:(r=e,new Proxy({},{get:(e,t)=>"l"===t[0]?r[t]:r.get(parseInt(t))})));var r;return o.bytes=n.decode.bytes,t};e.exports=o},17958:(e,t,r)=>{"use strict";const n=r(16980),{Buffer:i}=r(29536),o=(e,t,r)=>{const s=n.encode(e,t,r);return o.bytes=n.encode.bytes,t||i.from(s)};e.exports=o},1869:e=>{"use strict";e.exports=async function*(e,t){for await(const r of e)yield t(r)}},61960:(e,t,r)=>{"use strict";const n=r(89858);e.exports=async function*(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const i=n();setTimeout((async()=>{try{await Promise.all(t.map((async e=>{for await(const t of e)i.push(t)}))),i.end()}catch(e){i.end(e)}}),0),yield*i}},91764:(e,t,r)=>{var n=r(3213);e.exports=function(){var e=n(),t=n();return[{source:e.source,sink:t.sink},{source:t.source,sink:e.sink}]}},3213:(e,t,r)=>{"use strict";const n=r(56083);e.exports=function(){let e,t;return{sink:async r=>{if(e)throw new Error("already piped");e=n(r),t&&t(e)},source:{[Symbol.asyncIterator](){return this},next:()=>e?e.next():new Promise((e=>{t=r=>{t=null,e(r.next())}}))}}}},98688:e=>{e.exports=function(e){return null!=e&&null!=e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},54146:(e,t,r)=>{"use strict";const n=r(98688),i=r(16389),o=r(4666);e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=i(e),s=o.decode.fromReader(r.reader,t);let a=!1;const u={read:async e=>{const{value:t,done:n}=await r.reader.next(e);if(n&&t.length<e)throw new Error("Couldn't read enough bytes");if(a=n,!t)throw new Error("Value is null");return t},readLP:async()=>{const{value:e,done:t}=await s.next();if(a=t,!e)throw new Error("Value is null");return e},readPB:async e=>{const t=await u.readLP();if(!t)throw new Error("Value is null");const r=n(t)?t:t.slice();return e.decode(r)},write:e=>{r.writer.push(e)},writeLP:e=>{u.write(o.encode.single(e,t))},writePB:(e,t)=>{u.writeLP(t.encode(e))},pb:e=>({read:()=>u.readPB(e),write:t=>u.writePB(t,e)}),unwrap:()=>(r.rest(),r.stream)};return u}},91522:e=>{const t=function(){let e;for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(;r.length;)e=r.shift()(e);return e},r=e=>e&&("function"===typeof e[Symbol.asyncIterator]||"function"===typeof e[Symbol.iterator]||"function"===typeof e.next),n=e=>e&&"function"===typeof e.sink&&r(e.source),i=e=>t=>(e.sink(t),e.source),o=function(){for(var e=arguments.length,o=new Array(e),s=0;s<e;s++)o[s]=arguments[s];if(n(o[0])){const e=o[0];o[0]=()=>e.source}else if(r(o[0])){const e=o[0];o[0]=()=>e}if(o.length>1&&n(o[o.length-1])&&(o[o.length-1]=o[o.length-1].sink),o.length>2)for(let t=1;t<o.length-1;t++)n(o[t])&&(o[t]=i(o[t]));return t(...o)};e.exports=o,e.exports.pipe=o,e.exports.rawPipe=t,e.exports.isIterable=r,e.exports.isDuplex=n},89858:(e,t,r)=>{const n=r(73938);e.exports=e=>{let t;"function"===typeof(e=e||{})?(t=e,e={}):t=e.onEnd;let r,i,o,s=new n;const a=e=>i?i(e):(s.push(e),r),u=e=>o?r:a({done:!1,value:e}),c=e=>o?r:(o=!0,e?(e=>(s=new n,i?i({error:e}):(s.push({error:e}),r)))(e):a({done:!0}));if(r={[Symbol.asyncIterator](){return this},next:()=>{if(!s.isEmpty()){if(e.writev){let e;const t=[];for(;!s.isEmpty();){if(e=s.shift(),e.error)throw e.error;t.push(e.value)}return{done:e.done,value:t}}const t=s.shift();if(t.error)throw t.error;return t}return o?{done:!0}:new Promise(((t,n)=>{i=o=>(i=null,o.error?n(o.error):e.writev&&!o.done?t({done:o.done,value:[o.value]}):t(o),r)}))},return:()=>(s=new n,c(),{done:!0}),throw:e=>(c(e),{done:!0}),push:u,end:c},!t)return r;const h=r;return r={[Symbol.asyncIterator](){return this},next:()=>h.next(),throw:e=>(h.throw(e),t&&(t(e),t=null),{done:!0}),return:()=>(h.return(),t&&(t(),t=null),{done:!0}),push:u,end:e=>(h.end(e),t&&(t(e),t=null),r)},r}},44606:(e,t,r)=>{const n=r(64277);e.exports=e=>{const t=async function*(){let t=yield,r=new n;for await(const i of e)if(t)for(r.append(i);r.length>=t;){const e=r.shallowSlice(0,t);if(r.consume(t),t=yield e,!t){r.length&&(t=yield r,r=new n);break}}else t=yield r.append(i),r=new n;if(t)throw Object.assign(new Error("stream ended before ".concat(t," bytes became available")),{code:"ERR_UNDER_READ",buffer:r})}();return t.next(),t}},24264:e=>{"use strict";e.exports=async function*(e,t){let r=0;if(!(t<1))for await(const n of e)if(yield n,r++,r===t)return}},1929:(e,t,r)=>{"use strict";var n=r(45377),i=r(67681),o=r(26208);e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r="undefined"===typeof window?{}:window.location,s=o(e,r),a=new n(s,t.websocket),u=i(a,t);return u.remoteAddress=s,u.close=()=>new Promise(((e,t)=>{a.addEventListener("close",e),a.close()})),u.destroy=()=>{a.terminate?a.terminate():a.close()},u.socket=a,u},e.exports.connect=e.exports},67681:(e,t,r)=>{const n=r(13224),i=r(50916);e.exports=(e,t)=>{(t=t||{}).binaryType?e.binaryType=t.binaryType:t.binary&&(e.binaryType="arraybuffer");const r={sink:i(e,t),source:n(e,t),connected:()=>r.source.connected()};return r}},45716:e=>{e.exports=async e=>{if(e.readyState>=2)throw new Error("socket closed");if(1!==e.readyState)return new Promise(((t,r)=>{const n=e&&(e.removeEventListener||e.removeListener);function i(){"function"===typeof n&&(n.call(e,"open",o),n.call(e,"error",s))}function o(){i(),t()}function s(e){i(),r(e)}e.addEventListener("open",o),e.addEventListener("error",s)}))}},50916:(e,t,r)=>{const n=r(45716);e.exports=(e,t)=>((t=t||{}).closeOnEnd=!1!==t.closeOnEnd,async r=>{for await(const t of r){try{await n(e)}catch(i){if("socket closed"===i.message)break;throw i}e.send(t)}if(t.closeOnEnd&&e.readyState<=1)return new Promise(((t,r)=>{e.addEventListener("close",(e=>{if(e.wasClean||1006===e.code)t();else{const t=Object.assign(new Error("ws error"),{event:e});r(t)}})),setTimeout((()=>e.close()))}))})},13224:(e,t,r)=>{const{Buffer:n}=r(29536),{EventIterator:i}=r(71014);e.exports=e=>{const t=e.removeEventListener||e.removeListener,r=async function*(){const r=new i((r=>{let{push:n,stop:i,fail:o}=r;return e.addEventListener("message",n),e.addEventListener("error",o),e.addEventListener("close",i),()=>{t.call(e,"message",n),t.call(e,"error",o),t.call(e,"close",i)}}),{highWaterMark:1/0});for await(const{data:e}of r)yield(o=e,o instanceof ArrayBuffer||null!=o&&null!=o.constructor&&"ArrayBuffer"===o.constructor.name&&"number"===typeof o.byteLength?n.from(e):e);var o}();let o,s=1===e.readyState;return e.addEventListener("open",(()=>{s=!0,o=null})),e.addEventListener("close",(()=>{s=!1,o=null})),e.addEventListener("error",(e=>{s||(o=e)})),r.connected=()=>new Promise(((r,n)=>{if(s)return r();if(o)return n(o);const i=r=>{t.call(e,"open",a),t.call(e,"error",u),r()},a=()=>i(r),u=e=>i((()=>n(e)));e.addEventListener("open",a),e.addEventListener("error",u)})),r}},45377:(e,t,r)=>{e.exports="undefined"===typeof WebSocket?r(15215):WebSocket},26208:(e,t,r)=>{const{relative:n}=r(32054),i={http:"ws",https:"wss"};e.exports=(e,t)=>n(e,t,i,"ws")},46541:(e,t,r)=>{var n,i=r(21964);!function(){"use strict";var o="input is invalid type",s="object"===typeof window,a=s?window:{};a.JS_SHA3_NO_WINDOW&&(s=!1);var u=!s&&"object"===typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"===typeof i&&i.versions&&i.versions.node?a=r.g:u&&(a=self);var c=!a.JS_SHA3_NO_COMMON_JS&&e.exports,h=r.amdO,l=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,f="0123456789abcdef".split(""),d=[4,1024,262144,67108864],p=[0,8,16,24],y=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],g=[224,256,384,512],m=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var w=function(e,t,r){return function(n){return new D(e,t,e).update(n)[r]()}},_=function(e,t,r){return function(n,i){return new D(e,t,i).update(n)[r]()}},E=function(e,t,r){return function(t,n,i,o){return k["cshake"+e].update(t,n,i,o)[r]()}},S=function(e,t,r){return function(t,n,i,o){return k["kmac"+e].update(t,n,i,o)[r]()}},M=function(e,t,r,n){for(var i=0;i<b.length;++i){var o=b[i];e[o]=t(r,n,o)}return e},A=function(e,t){var r=w(e,t,"hex");return r.create=function(){return new D(e,t,e)},r.update=function(e){return r.create().update(e)},M(r,w,e,t)},I=[{name:"keccak",padding:[1,256,65536,16777216],bits:g,createMethod:A},{name:"sha3",padding:[6,1536,393216,100663296],bits:g,createMethod:A},{name:"shake",padding:[31,7936,2031616,520093696],bits:m,createMethod:function(e,t){var r=_(e,t,"hex");return r.create=function(r){return new D(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},M(r,_,e,t)}},{name:"cshake",padding:d,bits:m,createMethod:function(e,t){var r=v[e],n=E(e,0,"hex");return n.create=function(n,i,o){return i||o?new D(e,t,n).bytepad([i,o],r):k["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},M(n,E,e,t)}},{name:"kmac",padding:d,bits:m,createMethod:function(e,t){var r=v[e],n=S(e,0,"hex");return n.create=function(n,i,o){return new N(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},M(n,S,e,t)}}],k={},T=[],R=0;R<I.length;++R)for(var P=I[R],C=P.bits,O=0;O<C.length;++O){var x=P.name+"_"+C[O];if(T.push(x),k[x]=P.createMethod(C[O],P.padding),"sha3"!==P.name){var B=P.name+C[O];T.push(B),k[B]=k[x]}}function D(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function N(e,t,r){D.call(this,e,t,r)}D.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(o);if(null===e)throw new Error(o);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(o);t=!0}for(var n,i,s=this.blocks,a=this.byteCount,u=e.length,c=this.blockCount,h=0,f=this.s;h<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<c+1;++n)s[n]=0;if(t)for(n=this.start;h<u&&n<a;++h)s[n>>2]|=e[h]<<p[3&n++];else for(n=this.start;h<u&&n<a;++h)(i=e.charCodeAt(h))<128?s[n>>2]|=i<<p[3&n++]:i<2048?(s[n>>2]|=(192|i>>6)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]):i<55296||i>=57344?(s[n>>2]|=(224|i>>12)<<p[3&n++],s[n>>2]|=(128|i>>6&63)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++h)),s[n>>2]|=(240|i>>18)<<p[3&n++],s[n>>2]|=(128|i>>12&63)<<p[3&n++],s[n>>2]|=(128|i>>6&63)<<p[3&n++],s[n>>2]|=(128|63&i)<<p[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[c],n=0;n<c;++n)f[n]^=s[n];L(f),this.reset=!0}else this.start=n}return this},D.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},D.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(o);if(null===e)throw new Error(o);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(o);t=!0}var n=0,i=e.length;if(t)n=i;else for(var s=0;s<e.length;++s){var a=e.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(e),n},D.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},D.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];L(n)}},D.prototype.toString=D.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<t&&s<n;++o,++s)e=r[o],a+=f[e>>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];s%t===0&&(L(r),o=0)}return i&&(e=r[o],a+=f[e>>4&15]+f[15&e],i>1&&(a+=f[e>>12&15]+f[e>>8&15]),i>2&&(a+=f[e>>20&15]+f[e>>16&15])),a},D.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s<n;){for(o=0;o<t&&s<n;++o,++s)u[s]=r[o];s%t===0&&L(r)}return i&&(u[o]=r[o],e=e.slice(0,a)),e},D.prototype.buffer=D.prototype.arrayBuffer,D.prototype.digest=D.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)e=a<<2,t=n[s],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r===0&&L(n)}return o&&(e=a<<2,t=n[s],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},N.prototype=new D,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var L=function(e){var t,r,n,i,o,s,a,u,c,h,l,f,d,p,g,m,b,v,w,_,E,S,M,A,I,k,T,R,P,C,O,x,B,D,N,L,K,U,j,q,F,z,V,H,G,W,Y,Z,X,J,Q,$,ee,te,re,ne,ie,oe,se,ae,ue,ce,he;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(h<<1|l>>>31),r=a^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(f<<1|d>>>31),r=c^(d<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,Y=e[10]<<4|e[11]>>>28,R=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,D=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,C=e[33]<<13|e[32]>>>19,O=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,he=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,K=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,B=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,T=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,q=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,S=e[48]<<14|e[49]>>>18,M=e[49]<<14|e[48]>>>18,e[0]=p^~m&v,e[1]=g^~b&w,e[10]=A^~k&R,e[11]=I^~T&P,e[20]=D^~L&U,e[21]=N^~K&j,e[30]=H^~W&Z,e[31]=G^~Y&X,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~v&_,e[3]=b^~w&E,e[12]=k^~R&C,e[13]=T^~P&O,e[22]=L^~U&q,e[23]=K^~j&F,e[32]=W^~Z&J,e[33]=Y^~X&Q,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=v^~_&S,e[5]=w^~E&M,e[14]=R^~C&x,e[15]=P^~O&B,e[24]=U^~q&z,e[25]=j^~F&V,e[34]=Z^~J&$,e[35]=X^~Q&ee,e[44]=oe^~ae&ce,e[45]=se^~ue&he,e[6]=_^~S&p,e[7]=E^~M&g,e[16]=C^~x&A,e[17]=O^~B&I,e[26]=q^~z&D,e[27]=F^~V&N,e[36]=J^~$&H,e[37]=Q^~ee&G,e[46]=ae^~ce&te,e[47]=ue^~he&re,e[8]=S^~p&m,e[9]=M^~g&b,e[18]=x^~A&k,e[19]=B^~I&T,e[28]=z^~D&L,e[29]=V^~N&K,e[38]=$^~H&W,e[39]=ee^~G&Y,e[48]=ce^~te&ne,e[49]=he^~re&ie,e[0]^=y[n],e[1]^=y[n+1]};if(c)e.exports=k;else{for(R=0;R<T.length;++R)a[T[R]]=k[T[R]];h&&(void 0===(n=function(){return k}.call(t,r,t,e))||(e.exports=n))}}()},85620:function(e,t){(function(){var t;function r(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function n(){return new r(null)}var i="undefined"!==typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(e,t,r,n,i,o){for(var s=32767&t,a=t>>15;--o>=0;){var u=32767&this[e],c=this[e++]>>15,h=a*u+c*s;i=((u=s*u+((32767&h)<<15)+r[n]+(1073741823&i))>>>30)+(h>>>15)+a*c+(i>>>30),r[n++]=1073741823&u}return i},t=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(e,t,r,n,i,o){for(;--o>=0;){var s=t*this[e++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},t=26):(r.prototype.am=function(e,t,r,n,i,o){for(var s=16383&t,a=t>>14;--o>=0;){var u=16383&this[e],c=this[e++]>>14,h=a*u+c*s;i=((u=s*u+((16383&h)<<14)+r[n]+i)>>28)+(h>>14)+a*c,r[n++]=268435455&u}return i},t=28),r.prototype.DB=t,r.prototype.DM=(1<<t)-1,r.prototype.DV=1<<t;r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-t,r.prototype.F2=2*t-52;var o,s,a=new Array;for(o="0".charCodeAt(0),s=0;s<=9;++s)a[o++]=s;for(o="a".charCodeAt(0),s=10;s<36;++s)a[o++]=s;for(o="A".charCodeAt(0),s=10;s<36;++s)a[o++]=s;function u(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function c(e,t){var r=a[e.charCodeAt(t)];return null==r?-1:r}function h(e){var t=n();return t.fromInt(e),t}function l(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function f(e){this.m=e}function d(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function p(e,t){return e&t}function y(e,t){return e|t}function g(e,t){return e^t}function m(e,t){return e&~t}function b(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function v(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function w(){}function _(e){return e}function E(e){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}f.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},f.prototype.revert=function(e){return e},f.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},f.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},f.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},d.prototype.convert=function(e){var t=n();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(r.ZERO)>0&&this.m.subTo(t,t),t},d.prototype.revert=function(e){var t=n();return e.copyTo(t),this.reduce(t),t},d.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},d.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},d.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},r.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},r.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},r.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var i=e.length,o=!1,s=0;--i>=0;){var a=8==n?255&e[i]:c(e,i);a<0?"-"==e.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),o&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},r.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},r.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},r.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,o=(1<<i)-1,s=Math.floor(e/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+s+1]=this[r]>>i|a,a=(this[r]&o)<<n;for(r=s-1;r>=0;--r)t[r]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()},r.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)t[s-r-1]|=(this[s]&o)<<i,t[s-r]=this[s]>>n;n>0&&(t[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}},r.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},r.prototype.multiplyTo=function(e,t){var n=this.abs(),i=e.abs(),o=n.t;for(t.t=o+i.t;--o>=0;)t[o]=0;for(o=0;o<i.t;++o)t[o+n.t]=n.am(0,i[o],t,o,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&r.ZERO.subTo(t,t)},r.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},r.prototype.divRemTo=function(e,t,i){var o=e.abs();if(!(o.t<=0)){var s=this.abs();if(s.t<o.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=n());var a=n(),u=this.s,c=e.s,h=this.DB-l(o[o.t-1]);h>0?(o.lShiftTo(h,a),s.lShiftTo(h,i)):(o.copyTo(a),s.copyTo(i));var f=a.t,d=a[f-1];if(0!=d){var p=d*(1<<this.F1)+(f>1?a[f-2]>>this.F2:0),y=this.FV/p,g=(1<<this.F1)/p,m=1<<this.F2,b=i.t,v=b-f,w=null==t?n():t;for(a.dlShiftTo(v,w),i.compareTo(w)>=0&&(i[i.t++]=1,i.subTo(w,i)),r.ONE.dlShiftTo(f,w),w.subTo(a,a);a.t<f;)a[a.t++]=0;for(;--v>=0;){var _=i[--b]==d?this.DM:Math.floor(i[b]*y+(i[b-1]+m)*g);if((i[b]+=a.am(0,_,i,v,0,f))<_)for(a.dlShiftTo(v,w),i.subTo(w,i);i[b]<--_;)i.subTo(w,i)}null!=t&&(i.drShiftTo(f,t),u!=c&&r.ZERO.subTo(t,t)),i.t=f,i.clamp(),h>0&&i.rShiftTo(h,i),u<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(e,t){if(e>4294967295||e<1)return r.ONE;var i=n(),o=n(),s=t.convert(this),a=l(e)-1;for(s.copyTo(i);--a>=0;)if(t.sqrTo(i,o),(e&1<<a)>0)t.mulTo(o,s,i);else{var u=i;i=o,o=u}return t.revert(i)},r.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(i=!0,o=u(r));s>=0;)a<t?(r=(this[s]&(1<<a)-1)<<t-a,r|=this[--s]>>(a+=this.DB-t)):(r=this[s]>>(a-=t)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=u(r));return i?o:"0"},r.prototype.negate=function(){var e=n();return r.ZERO.subTo(this,e),e},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+l(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(e){var t=n();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(r.ZERO)>0&&e.subTo(t,t),t},r.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new f(t):new d(t),this.exp(e,r)},r.ZERO=h(0),r.ONE=h(1),w.prototype.convert=_,w.prototype.revert=_,w.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},w.prototype.sqrTo=function(e,t){e.squareTo(t)},E.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=n();return e.copyTo(t),this.reduce(t),t},E.prototype.revert=function(e){return e},E.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},E.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},E.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var S,M,A,I=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],k=(1<<26)/I[I.length-1];function T(){var e;e=(new Date).getTime(),M[A++]^=255&e,M[A++]^=e>>8&255,M[A++]^=e>>16&255,M[A++]^=e>>24&255,A>=D&&(A-=D)}if(r.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},r.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),i=h(r),o=n(),s=n(),a="";for(this.divRemTo(i,o,s);o.signum()>0;)a=(r+s.intValue()).toString(e).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(e)+a},r.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var n=this.chunkSize(t),i=Math.pow(t,n),o=!1,s=0,a=0,u=0;u<e.length;++u){var h=c(e,u);h<0?"-"==e.charAt(u)&&0==this.signum()&&(o=!0):(a=t*a+h,++s>=n&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(a,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(e,t,n){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,n),this.testBit(e-1)||this.bitwiseTo(r.ONE.shiftLeft(e-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(r.ONE.shiftLeft(e-1),this);else{var i=new Array,o=7&e;i.length=1+(e>>3),t.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},r.prototype.bitwiseTo=function(e,t,r){var n,i,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=o;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},r.prototype.changeBit=function(e,t){var n=r.ONE.shiftLeft(e);return this.bitwiseTo(n,t,n),n},r.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},r.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},r.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,e[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e[i],r,i,0,t-i);r.clamp()},r.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},r.prototype.millerRabin=function(e){var t=this.subtract(r.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var o=t.shiftRight(i);(e=e+1>>1)>I.length&&(e=I.length);for(var s=n(),a=0;a<e;++a){s.fromInt(I[Math.floor(Math.random()*I.length)]);var u=s.modPow(o,this);if(0!=u.compareTo(r.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<i&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},r.prototype.clone=function(){var e=n();return this.copyTo(e),e},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},r.prototype.equals=function(e){return 0==this.compareTo(e)},r.prototype.min=function(e){return this.compareTo(e)<0?this:e},r.prototype.max=function(e){return this.compareTo(e)>0?this:e},r.prototype.and=function(e){var t=n();return this.bitwiseTo(e,p,t),t},r.prototype.or=function(e){var t=n();return this.bitwiseTo(e,y,t),t},r.prototype.xor=function(e){var t=n();return this.bitwiseTo(e,g,t),t},r.prototype.andNot=function(e){var t=n();return this.bitwiseTo(e,m,t),t},r.prototype.not=function(){for(var e=n(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},r.prototype.shiftLeft=function(e){var t=n();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},r.prototype.shiftRight=function(e){var t=n();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},r.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+b(this[e]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=v(this[r]^t);return e},r.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},r.prototype.setBit=function(e){return this.changeBit(e,y)},r.prototype.clearBit=function(e){return this.changeBit(e,m)},r.prototype.flipBit=function(e){return this.changeBit(e,g)},r.prototype.add=function(e){var t=n();return this.addTo(e,t),t},r.prototype.subtract=function(e){var t=n();return this.subTo(e,t),t},r.prototype.multiply=function(e){var t=n();return this.multiplyTo(e,t),t},r.prototype.divide=function(e){var t=n();return this.divRemTo(e,t,null),t},r.prototype.remainder=function(e){var t=n();return this.divRemTo(e,null,t),t},r.prototype.divideAndRemainder=function(e){var t=n(),r=n();return this.divRemTo(e,t,r),new Array(t,r)},r.prototype.modPow=function(e,t){var r,i,o=e.bitLength(),s=h(1);if(o<=0)return s;r=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new f(t):t.isEven()?new E(t):new d(t);var a=new Array,u=3,c=r-1,p=(1<<r)-1;if(a[1]=i.convert(this),r>1){var y=n();for(i.sqrTo(a[1],y);u<=p;)a[u]=n(),i.mulTo(y,a[u-2],a[u]),u+=2}var g,m,b=e.t-1,v=!0,w=n();for(o=l(e[b])-1;b>=0;){for(o>=c?g=e[b]>>o-c&p:(g=(e[b]&(1<<o+1)-1)<<c-o,b>0&&(g|=e[b-1]>>this.DB+o-c)),u=r;0==(1&g);)g>>=1,--u;if((o-=u)<0&&(o+=this.DB,--b),v)a[g].copyTo(s),v=!1;else{for(;u>1;)i.sqrTo(s,w),i.sqrTo(w,s),u-=2;u>0?i.sqrTo(s,w):(m=s,s=w,w=m),i.mulTo(w,a[g],s)}for(;b>=0&&0==(e[b]&1<<o);)i.sqrTo(s,w),m=s,s=w,w=m,--o<0&&(o=this.DB-1,--b)}return i.revert(s)},r.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return r.ZERO;for(var n=e.clone(),i=this.clone(),o=h(1),s=h(0),a=h(0),u=h(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(e,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),t?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(e,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);n.compareTo(i)>=0?(n.subTo(i,n),t&&o.subTo(a,o),s.subTo(u,s)):(i.subTo(n,i),t&&a.subTo(o,a),u.subTo(s,u))}return 0!=i.compareTo(r.ONE)?r.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},r.prototype.pow=function(e){return this.exp(e,new w)},r.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},r.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=I[I.length-1]){for(t=0;t<I.length;++t)if(r[0]==I[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<I.length;){for(var n=I[t],i=t+1;i<I.length&&n<k;)n*=I[i++];for(n=r.modInt(n);t<i;)if(n%I[t++]==0)return!1}return r.millerRabin(e)},r.prototype.square=function(){var e=n();return this.squareTo(e),e},r.prototype.Barrett=E,null==M){var R;if(M=new Array,A=0,"undefined"!==typeof window&&window.crypto)if(window.crypto.getRandomValues){var P=new Uint8Array(32);for(window.crypto.getRandomValues(P),R=0;R<32;++R)M[A++]=P[R]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var C=window.crypto.random(32);for(R=0;R<C.length;++R)M[A++]=255&C.charCodeAt(R)}for(;A<D;)R=Math.floor(65536*Math.random()),M[A++]=R>>>8,M[A++]=255&R;A=0,T()}function O(){if(null==S){for(T(),(S=new B).init(M),A=0;A<M.length;++A)M[A]=0;A=0}return S.next()}function x(){}function B(){this.i=0,this.j=0,this.S=new Array}x.prototype.nextBytes=function(e){var t;for(t=0;t<e.length;++t)e[t]=O()},B.prototype.init=function(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},B.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var D=256;e.exports={default:r,BigInteger:r,SecureRandom:x}}).call(this)},16858:(e,t,r)=>{"use strict";const{concat:n}=r(25215),{fromString:i}=r(73624),o=r(93423);e.exports={create:function(){let{algorithm:e="AES-GCM",nonceLength:t=12,keyLength:r=16,digest:s="SHA-256",saltLength:a=16,iterations:u=32767}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=o.get();async function h(o,h){const l=c.getRandomValues(new Uint8Array(a)),f=c.getRandomValues(new Uint8Array(t)),d={name:e,iv:f},p={name:"PBKDF2",salt:l,iterations:u,hash:{name:s}},y=await c.subtle.importKey("raw",i(h),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),g=await c.subtle.deriveKey(p,y,{name:e,length:r},!0,["encrypt"]),m=await c.subtle.encrypt(d,g,o);return n([l,d.iv,new Uint8Array(m)])}async function l(n,o){const h=n.slice(0,a),l=n.slice(a,a+t),f=n.slice(a+t),d={name:e,iv:l},p={name:"PBKDF2",salt:h,iterations:u,hash:{name:s}},y=await c.subtle.importKey("raw",i(o),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),g=await c.subtle.deriveKey(p,y,{name:e,length:r},!0,["decrypt"]),m=await c.subtle.decrypt(d,g,f);return new Uint8Array(m)}return r*=8,{encrypt:h,decrypt:l}}}},29503:(e,t,r)=>{"use strict";const n=r(93423),i=r(17746),o={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"};t.create=async function(e,t){const r=o[e],s=await n.get().subtle.importKey("raw",t,{name:"HMAC",hash:{name:r}},!1,["sign"]);return{digest:async e=>(async(e,t)=>{const r=await n.get().subtle.sign({name:"HMAC"},e,t);return new Uint8Array(r,r.byteOffset,r.byteLength)})(s,e),length:i[e]}}},17746:e=>{"use strict";e.exports={SHA1:20,SHA256:32,SHA512:64}},96212:(e,t,r)=>{"use strict";const n=r(61446),i=r(93423),{base64urlToBuffer:o}=r(75025),s=r(20913),{toString:a}=r(63951),{concat:u}=r(25215),{equals:c}=r(69581),h={"P-256":256,"P-384":384,"P-521":521};t.generateEphmeralKeyPair=async function(e){s(Object.keys(h),e);const t=await i.get().subtle.generateKey({name:"ECDH",namedCurve:e},!0,["deriveBits"]);return{key:f(await i.get().subtle.exportKey("jwk",t.publicKey)),genSharedKey:async(r,n)=>{let o;o=n?await i.get().subtle.importKey("jwk",p(e,n),{name:"ECDH",namedCurve:e},!1,["deriveBits"]):t.privateKey;const s=[await i.get().subtle.importKey("jwk",d(e,r),{name:"ECDH",namedCurve:e},!1,[]),o],a=await i.get().subtle.deriveBits({name:"ECDH",namedCurve:e,public:s[0]},s[1],h[e]);return new Uint8Array(a,a.byteOffset,a.byteLength)}}};const l={"P-256":32,"P-384":48,"P-521":66};function f(e){const t=l[e.crv];return u([Uint8Array.from([4]),o(e.x,t),o(e.y,t)],1+2*t)}function d(e,t){const r=l[e];if(c(!t.slice(0,1),Uint8Array.from([4])))throw n(new Error("Cannot unmarshal public key - invalid key format"),"ERR_INVALID_KEY_FORMAT");return{kty:"EC",crv:e,x:a(t.slice(1,r+1),"base64url"),y:a(t.slice(1+r),"base64url"),ext:!0}}const p=(e,t)=>({...d(e,t.public),d:a(t.private,"base64url")})},34512:(e,t,r)=>{"use strict";const n=r(61446),{equals:i}=r(69581),{sha256:o}=r(27678),{base58btc:s}=r(59376),{identity:a}=r(4991),u=r(94317),c=r(43635),h=r(911);class l{constructor(e){this._key=d(e,u.publicKeyLength)}async verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return this._key}get bytes(){return c.PublicKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(e){return i(this.bytes,e.bytes)}async hash(){const{bytes:e}=await o.digest(this.bytes);return e}}class f{constructor(e,t){this._key=d(e,u.privateKeyLength),this._publicKey=d(t,u.publicKeyLength)}async sign(e){return u.hashAndSign(this._key,e)}get public(){return new l(this._publicKey)}marshal(){return this._key}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(e){return i(this.bytes,e.bytes)}async hash(){const{bytes:e}=await o.digest(this.bytes);return e}async id(){const e=await a.digest(this.public.bytes);return s.encode(e.bytes).substring(1)}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"libp2p-key";if("libp2p-key"===t)return h.export(this.bytes,e);throw n(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}function d(e,t){if((e=Uint8Array.from(e||[])).length!==t)throw n(new Error("Key must be a Uint8Array of length ".concat(t,", got ").concat(e.length)),"ERR_INVALID_KEY_TYPE");return e}e.exports={Ed25519PublicKey:l,Ed25519PrivateKey:f,unmarshalEd25519PrivateKey:function(e){if(e.length>u.privateKeyLength){const t=(e=d(e,u.privateKeyLength+u.publicKeyLength)).slice(0,u.privateKeyLength),r=e.slice(u.privateKeyLength,e.length);return new f(t,r)}const t=(e=d(e,u.privateKeyLength)).slice(0,u.privateKeyLength),r=e.slice(u.publicKeyLength);return new f(t,r)},unmarshalEd25519PublicKey:function(e){return e=d(e,u.publicKeyLength),new l(e)},generateKeyPair:async function(){const{privateKey:e,publicKey:t}=await u.generateKey();return new f(e,t)},generateKeyPairFromSeed:async function(e){const{privateKey:t,publicKey:r}=await u.generateKeyFromSeed(e);return new f(t,r)}}},94317:(e,t,r)=>{"use strict";const n=r(12877);function i(e,r){const n=new Uint8Array(t.privateKeyLength);for(let t=0;t<32;t++)n[t]=e[t],n[32+t]=r[t];return n}t.publicKeyLength=32,t.privateKeyLength=64,t.generateKey=async function(){const e=n.utils.randomPrivateKey(),t=await n.getPublicKey(e);return{privateKey:i(e,t),publicKey:t}},t.generateKeyFromSeed=async function(e){if(32!==e.length)throw new TypeError('"seed" must be 32 bytes in length.');if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');const t=e,r=await n.getPublicKey(t);return{privateKey:i(t,r),publicKey:r}},t.hashAndSign=function(e,t){const r=e.slice(0,32);return n.sign(t,r)},t.hashAndVerify=function(e,t,r){return n.verify(t,r,e)}},88658:(e,t,r)=>{"use strict";const n=r(96212);e.exports=async e=>n.generateEphmeralKeyPair(e)},911:(e,t,r)=>{"use strict";const{base64:n}=r(86443),i=r(16858);e.exports={export:async function(e,t){const r=i.create(),o=await r.encrypt(e,t);return n.encode(o)}}},3561:(e,t,r)=>{"use strict";const{base64:n}=r(86443),i=r(16858);e.exports={import:async function(e,t){const r=n.decode(e),o=i.create();return await o.decrypt(r,t)}}},40544:(e,t,r)=>{"use strict";const n=r(43635);r(93758),r(79850);const i=r(5525),o=r(61446),{fromString:s}=r(73624),a=r(3561),u={rsa:r(63925),ed25519:r(34512),secp256k1:r(26119)(n,r(54584))},c="secp256k1 support requires libp2p-crypto-secp256k1 package",h="ERR_MISSING_PACKAGE";function l(e){const t=u[e.toLowerCase()];if(!t){const t=Object.keys(u).join(" / ");throw o(new Error("invalid or unsupported key type ".concat(e,". Must be ").concat(t)),"ERR_UNSUPPORTED_KEY_TYPE")}return t}const f=async e=>{const t=n.PrivateKey.decode(e),r=t.Data;switch(t.Type){case n.KeyType.RSA:return u.rsa.unmarshalRsaPrivateKey(r);case n.KeyType.Ed25519:return u.ed25519.unmarshalEd25519PrivateKey(r);case n.KeyType.Secp256k1:if(u.secp256k1)return u.secp256k1.unmarshalSecp256k1PrivateKey(r);throw o(new Error(c),h);default:l(t.Type)}};e.exports={supportedKeys:u,keysPBM:n,keyStretcher:r(29561),generateEphemeralKeyPair:r(88658),generateKeyPair:async(e,t)=>l(e).generateKeyPair(t),generateKeyPairFromSeed:async(e,t,r)=>{const n=l(e);if("ed25519"!==e.toLowerCase())throw o(new Error("Seed key derivation is unimplemented for RSA or secp256k1"),"ERR_UNSUPPORTED_KEY_DERIVATION_TYPE");return n.generateKeyPairFromSeed(t,r)},unmarshalPublicKey:e=>{const t=n.PublicKey.decode(e),r=t.Data;switch(t.Type){case n.KeyType.RSA:return u.rsa.unmarshalRsaPublicKey(r);case n.KeyType.Ed25519:return u.ed25519.unmarshalEd25519PublicKey(r);case n.KeyType.Secp256k1:if(u.secp256k1)return u.secp256k1.unmarshalSecp256k1PublicKey(r);throw o(new Error(c),h);default:l(t.Type)}},marshalPublicKey:(e,t)=>(l(t=(t||"rsa").toLowerCase()),e.bytes),unmarshalPrivateKey:f,marshalPrivateKey:(e,t)=>(l(t=(t||"rsa").toLowerCase()),e.bytes),import:async(e,t)=>{try{const r=await a.import(e,t);return f(r)}catch(c){}const r=i.pki.decryptRsaPrivateKey(e,t);if(null===r)throw o(new Error("Cannot read the key, most likely the password is wrong or not a RSA key"),"ERR_CANNOT_DECRYPT_PEM");let n=i.asn1.toDer(i.pki.privateKeyToAsn1(r));return n=s(n.getBytes(),"ascii"),u.rsa.unmarshalRsaPrivateKey(n)}}},70218:(e,t,r)=>{"use strict";r(95842);const n=r(5525),{base64urlToBigInteger:i}=r(75025);function o(e,t){return t.map((t=>i(e[t])))}e.exports={jwk2pub:function(e){return n.pki.setRsaPublicKey(...o(e,["n","e"]))},jwk2priv:function(e){return n.pki.setRsaPrivateKey(...o(e,["n","e","d","p","q","dp","dq","qi"]))}}},29561:(e,t,r)=>{"use strict";const n=r(61446),{concat:i}=r(25215),{fromString:o}=r(73624),s=r(29503),a={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};e.exports=async(e,t,r)=>{const u=a[e];if(!u){const t=Object.keys(a).join(" / ");throw n(new Error("unknown cipher type '".concat(e,"'. Must be ").concat(t)),"ERR_INVALID_CIPHER_TYPE")}if(!t)throw n(new Error("missing hash type"),"ERR_MISSING_HASH_TYPE");const c=u.keySize,h=u.ivSize,l=o("key expansion"),f=2*(h+c+20),d=await s.create(t,r);let p=await d.digest(l);const y=[];let g=0;for(;g<f;){const e=await d.digest(i([p,l]));let t=e.length;g+t>f&&(t=f-g),y.push(e),g+=t,p=await d.digest(p)}const m=f/2,b=i(y),v=b.slice(0,m),w=b.slice(m,f),_=e=>({iv:e.slice(0,h),cipherKey:e.slice(h,h+c),macKey:e.slice(h+c)});return{k1:_(v),k2:_(w)}}},43635:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-crypto-keys"]||(n.roots["libp2p-crypto-keys"]={});a.KeyType=function(){var e={},t=Object.create(e);return t[e[0]="RSA"]=0,t[e[1]="Ed25519"]=1,t[e[2]="Secp256k1"]=2,t}(),a.PublicKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.Type=0,e.prototype.Data=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(8).int32(e.Type),t.uint32(18).bytes(e.Data),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PublicKey;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw s.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw s.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PublicKey)return e;var t=new a.PublicKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?s.base64.decode(e.Data,t.Data=s.newBuffer(s.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=s.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?a.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?s.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),a.PrivateKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.Type=0,e.prototype.Data=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(8).int32(e.Type),t.uint32(18).bytes(e.Data),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PrivateKey;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw s.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw s.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PrivateKey)return e;var t=new a.PrivateKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?s.base64.decode(e.Data,t.Data=s.newBuffer(s.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=s.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?a.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?s.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},77214:(e,t,r)=>{"use strict";const n=r(93423),i=r(54584),{toString:o}=r(63951),{fromString:s}=r(73624);function a(e){return Promise.all([n.get().subtle.exportKey("jwk",e.privateKey),n.get().subtle.exportKey("jwk",e.publicKey)])}t.utils=r(73406),t.generateKey=async function(e){const t=await n.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await a(t);return{privateKey:r[0],publicKey:r[1]}},t.unmarshalPrivateKey=async function(e){const t=[await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await(r=e,n.get().subtle.importKey("jwk",{kty:r.kty,n:r.n,e:r.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"]))];var r;const i=await a({privateKey:t[0],publicKey:t[1]});return{privateKey:i[0],publicKey:i[1]}},t.getRandomValues=i,t.hashAndSign=async function(e,t){const r=await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),i=await n.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(t));return new Uint8Array(i,i.byteOffset,i.byteLength)},t.hashAndVerify=async function(e,t,r){const i=await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return n.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},i,t,r)};const{jwk2pub:u,jwk2priv:c}=r(70218);function h(e,t,r,n){const i=t?u(e):c(e),a=n(o(Uint8Array.from(r),"ascii"),i);return s(a,"ascii")}t.encrypt=function(e,t){return h(e,!0,t,((e,t)=>t.encrypt(e)))},t.decrypt=function(e,t){return h(e,!1,t,((e,t)=>t.decrypt(e)))}},63925:(e,t,r)=>{"use strict";const{sha256:n}=r(27678),i=r(61446),{equals:o}=r(69581),{toString:s}=r(63951);r(16654);const a=r(5525),u=r(77214),c=r(43635),h=r(911);class l{constructor(e){this._key=e}async verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return u.utils.jwkToPkix(this._key)}get bytes(){return c.PublicKey.encode({Type:c.KeyType.RSA,Data:this.marshal()}).finish()}encrypt(e){return u.encrypt(this._key,e)}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}}class f{constructor(e,t){this._key=e,this._publicKey=t}genSecret(){return u.getRandomValues(16)}async sign(e){return u.hashAndSign(this._key,e)}get public(){if(!this._publicKey)throw i(new Error("public key not provided"),"ERR_PUBKEY_NOT_PROVIDED");return new l(this._publicKey)}decrypt(e){return u.decrypt(this._key,e)}marshal(){return u.utils.jwkToPkcs1(this._key)}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.RSA,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}async id(){const e=await this.public.hash();return s(e,"base58btc")}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pkcs-8";if("pkcs-8"===t){const t=new a.util.ByteBuffer(this.marshal()),r=a.asn1.fromDer(t),n=a.pki.privateKeyFromAsn1(r),i={algorithm:"aes256",count:1e4,saltSize:16,prfAlgorithm:"sha512"};return a.pki.encryptRsaPrivateKey(n,e,i)}if("libp2p-key"===t)return h.export(this.bytes,e);throw i(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}e.exports={RsaPublicKey:l,RsaPrivateKey:f,unmarshalRsaPublicKey:function(e){const t=u.utils.pkixToJwk(e);return new l(t)},unmarshalRsaPrivateKey:async function(e){const t=u.utils.pkcs1ToJwk(e),r=await u.unmarshalPrivateKey(t);return new f(r.privateKey,r.publicKey)},generateKeyPair:async function(e){const t=await u.generateKey(e);return new f(t.privateKey,t.publicKey)},fromJwk:async function(e){const t=await u.unmarshalPrivateKey(e);return new f(t.privateKey,t.publicKey)}}},73406:(e,t,r)=>{"use strict";r(93758),r(95842);const n=r(5525),{bigIntegerToUintBase64url:i,base64urlToBigInteger:o}=r(75025),{fromString:s}=r(73624),{toString:a}=r(63951);t.pkcs1ToJwk=function(e){const t=n.asn1.fromDer(a(e,"ascii")),r=n.pki.privateKeyFromAsn1(t);return{kty:"RSA",n:i(r.n),e:i(r.e),d:i(r.d),p:i(r.p),q:i(r.q),dp:i(r.dP),dq:i(r.dQ),qi:i(r.qInv),alg:"RS256",kid:"2011-04-29"}},t.jwkToPkcs1=function(e){const t=n.pki.privateKeyToAsn1({n:o(e.n),e:o(e.e),d:o(e.d),p:o(e.p),q:o(e.q),dP:o(e.dp),dQ:o(e.dq),qInv:o(e.qi)});return s(n.asn1.toDer(t).getBytes(),"ascii")},t.pkixToJwk=function(e){const t=n.asn1.fromDer(a(e,"ascii")),r=n.pki.publicKeyFromAsn1(t);return{kty:"RSA",n:i(r.n),e:i(r.e),alg:"RS256",kid:"2011-04-29"}},t.jwkToPkix=function(e){const t=n.pki.publicKeyToAsn1({n:o(e.n),e:o(e.e)});return s(n.asn1.toDer(t).getBytes(),"ascii")}},26119:(e,t,r)=>{"use strict";const{sha256:n}=r(27678),i=r(61446),{equals:o}=r(69581),{toString:s}=r(63951),a=r(911);e.exports=(e,t,u)=>{u=u||r(19418)();class c{constructor(e){u.validatePublicKey(e),this._key=e}verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return u.compressPublicKey(this._key)}get bytes(){return e.PublicKey.encode({Type:e.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}}class h{constructor(e,t){this._key=e,this._publicKey=t||u.computePublicKey(e),u.validatePrivateKey(this._key),u.validatePublicKey(this._publicKey)}sign(e){return u.hashAndSign(this._key,e)}get public(){return new c(this._publicKey)}marshal(){return this._key}get bytes(){return e.PrivateKey.encode({Type:e.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}async id(){const e=await this.public.hash();return s(e,"base58btc")}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"libp2p-key";if("libp2p-key"===t)return a.export(this.bytes,e);throw i(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}return{Secp256k1PublicKey:c,Secp256k1PrivateKey:h,unmarshalSecp256k1PrivateKey:function(e){return new h(e)},unmarshalSecp256k1PublicKey:function(e){return new c(e)},generateKeyPair:async function(){const e=await u.generateKey();return new h(e)}}}},19418:(e,t,r)=>{"use strict";const n=r(61446),i=r(46440),{sha256:o}=r(27678);e.exports=()=>({generateKey:function(){return i.utils.randomPrivateKey()},privateKeyLength:32,hashAndSign:async function(e,t){const{digest:r}=await o.digest(t);try{return await i.sign(r,e)}catch(s){throw n(s,"ERR_INVALID_INPUT")}},hashAndVerify:async function(e,t,r){try{const{digest:n}=await o.digest(r);return i.verify(t,n,e)}catch(s){throw n(s,"ERR_INVALID_INPUT")}},compressPublicKey:function(e){return i.Point.fromHex(e).toRawBytes(!0)},decompressPublicKey:function(e){return i.Point.fromHex(e).toRawBytes(!1)},validatePrivateKey:function(e){try{i.getPublicKey(e,!0)}catch(t){throw n(t,"ERR_INVALID_PRIVATE_KEY")}},validatePublicKey:function(e){try{i.Point.fromHex(e)}catch(t){throw n(t,"ERR_INVALID_PUBLIC_KEY")}},computePublicKey:function(e){try{return i.getPublicKey(e,!0)}catch(t){throw n(t,"ERR_INVALID_PRIVATE_KEY")}}})},20913:(e,t,r)=>{"use strict";const n=r(61446);e.exports=function(e,t){if(!e.includes(t)){const r=e.join(" / ");throw n(new Error("Unknown curve: ".concat(t,". Must be ").concat(r)),"ERR_INVALID_CURVE")}}},54584:(e,t,r)=>{"use strict";const n=r(6543),i=r(61446);e.exports=function(e){if(isNaN(e)||e<=0)throw i(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return n(e)}},75025:(e,t,r)=>{"use strict";r(35139),r(24926);const n=r(5525),{fromString:i}=r(73624),{toString:o}=r(63951),{concat:s}=r(25215);t.bigIntegerToUintBase64url=(e,t)=>{let r=Uint8Array.from(e.abs().toByteArray());if(r=0===r[0]?r.slice(1):r,null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=s([new Uint8Array(t-r.length),r])}return o(r,"base64url")},t.base64urlToBigInteger=e=>{const r=t.base64urlToBuffer(e);return new n.jsbn.BigInteger(o(r,"base16"),16)},t.base64urlToBuffer=(e,t)=>{let r=i(e,"base64urlpad");if(null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=s([new Uint8Array(t-r.length),r])}return r}},93423:(e,t)=>{"use strict";t.get=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:globalThis;const t=e.crypto;if(!t||!t.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return t}},66698:(e,t,r)=>{"use strict";const{CID:n}=r(91759),i=r(36206),o=r(29936),s=r(59376),a=r(86443),{base58btc:u}=r(59376),{base32:c}=r(36206),{base16:h}=r(9092),l=r(27893),f=r(40544),d=r(93077),{PeerIdProto:p}=r(68069),{equals:y}=r(69581),{fromString:g}=r(73624),{toString:m}=r(63951),{identity:b}=r(4991),v={...i,...o,...s,...a},w=Object.keys(v).reduce(((e,t)=>e.or(v[t])),c.decoder);const _=d(class{constructor(e,t,r){if(!(e instanceof Uint8Array))throw new Error("invalid id provided");if(t&&r&&!y(t.public.bytes,r.bytes))throw new Error("inconsistent arguments");this._id=e,this._idB58String=u.encode(this.id).substring(1),this._privKey=t,this._pubKey=r}get id(){return this._id}set id(e){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(e){this._privKey=e}get pubKey(){if(this._pubKey)return this._pubKey;if(this._privKey)return this._privKey.public;try{const e=l.decode(this.id);e.code===b.code&&(this._pubKey=f.unmarshalPublicKey(e.digest))}catch(e){}return this._pubKey}set pubKey(e){this._pubKey=e}marshalPubKey(){if(this.pubKey)return f.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return f.marshalPrivateKey(this.privKey)}marshal(e){return p.encode({id:this.toBytes(),pubKey:this.marshalPubKey(),privKey:e?null:this.marshalPrivKey()}).finish()}toPrint(){let e=this.toB58String();e.startsWith("Qm")&&(e=e.slice(2));let t=6;return e.length<t&&(t=e.length),"<peer.ID "+e.substr(0,t)+">"}toJSON(){return{id:this.toB58String(),privKey:A(this.marshalPrivKey()),pubKey:A(this.marshalPubKey())}}toHexString(){return h.encode(this.id).substring(1)}toBytes(){return this.id}toB58String(){return this._idB58String}toString(){if(!this._idCIDString){const e=n.createV1(114,l.decode(this.id));Object.defineProperty(this,"_idCIDString",{value:e.toString(),enumerable:!1})}return this._idCIDString}equals(e){if(e instanceof Uint8Array)return y(this.id,e);if(e.id)return y(this.id,e.id);throw new Error("not valid Id")}isEqual(e){return this.equals(e)}isValid(){return Boolean(this.privKey&&this.privKey.public&&this.privKey.public.bytes&&this.pubKey.bytes instanceof Uint8Array&&y(this.privKey.public.bytes,this.pubKey.bytes))}hasInlinePublicKey(){try{if(l.decode(this.id).code===b.code)return!0}catch(e){}return!1}},{className:"PeerId",symbolName:"@libp2p/js-peer-id/PeerId"});t=e.exports=_;const E=e=>e.bytes.length<=42?l.create(b.code,e.bytes).bytes:e.hash(),S=async(e,t)=>{const r=await E(t);return new _(r,e,t)};t.create=async e=>{(e=e||{}).bits=e.bits||2048,e.keyType=e.keyType||"RSA";const t=await f.generateKeyPair(e.keyType,e.bits);return S(t,t.public)},t.createFromHexString=e=>new _(h.decode("f"+e)),t.createFromBytes=e=>{try{const r=n.decode(e);if(!M(r))throw new Error("Supplied PeerID CID is invalid");return t.createFromCID(r)}catch{if(l.decode(e).code!==b.code)throw new Error("Supplied PeerID CID is invalid");return new _(e)}},t.createFromB58String=e=>t.createFromBytes(u.decode("z"+e));const M=e=>114===e.code||112===e.code;function A(e){if(e)return m(e,"base64pad")}t.createFromCID=e=>{if(!(e=n.asCID(e))||!M(e))throw new Error("Supplied PeerID CID is invalid");return new _(e.multihash.bytes)},t.createFromPubKey=async e=>{let t=e;if("string"===typeof t&&(t=g(e,"base64pad")),!(t instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");const r=await f.unmarshalPublicKey(t);return S(void 0,r)},t.createFromPrivKey=async e=>{if("string"===typeof e&&(e=g(e,"base64pad")),!(e instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");const t=await f.unmarshalPrivateKey(e);return S(t,t.public)},t.createFromJSON=async e=>{const t=u.decode("z"+e.id),r=e.privKey&&g(e.privKey,"base64pad"),n=e.pubKey&&g(e.pubKey,"base64pad"),i=n&&await f.unmarshalPublicKey(n);if(!r)return new _(t,void 0,i);const o=await f.unmarshalPrivateKey(r),s=await E(o.public);let a;if(i&&(a=await E(i)),i&&!y(s,a))throw new Error("Public and private key do not match");if(t&&!y(s,t))throw new Error("Id and private key do not match");return new _(t,o,i)},t.createFromProtobuf=async e=>{"string"===typeof e&&(e=g(e,"base16"));let t,r,{id:n,privKey:i,pubKey:o}=p.decode(e);if(i=!!i&&await f.unmarshalPrivateKey(i),o=!!o&&await f.unmarshalPublicKey(o),i&&(r=await E(i.public)),o&&(t=await E(o)),i){if(o&&!y(r,t))throw new Error("Public and private key do not match");return new _(r,i,i.public)}if(o)return new _(t,void 0,o);if(n)return new _(n);throw new Error("Protobuf did not contain any usable key material")},t.parse=e=>("1"!==e.charAt(0)&&"Q"!==e.charAt(0)||(e="z".concat(e)),t.createFromBytes(w.decode(e))),t.isPeerId=e=>Boolean("object"===typeof e&&e._id&&e._idB58String)},68069:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-peer-id"]||(n.roots["libp2p-peer-id"]={});a.PeerIdProto=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.id=s.newBuffer([]),e.prototype.pubKey=s.newBuffer([]),e.prototype.privKey=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(10).bytes(e.id),null!=e.pubKey&&Object.hasOwnProperty.call(e,"pubKey")&&t.uint32(18).bytes(e.pubKey),null!=e.privKey&&Object.hasOwnProperty.call(e,"privKey")&&t.uint32(26).bytes(e.privKey),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PeerIdProto;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.pubKey=e.bytes();break;case 3:n.privKey=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("id"))throw s.ProtocolError("missing required 'id'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PeerIdProto)return e;var t=new a.PeerIdProto;return null!=e.id&&("string"===typeof e.id?s.base64.decode(e.id,t.id=s.newBuffer(s.base64.length(e.id)),0):e.id.length&&(t.id=e.id)),null!=e.pubKey&&("string"===typeof e.pubKey?s.base64.decode(e.pubKey,t.pubKey=s.newBuffer(s.base64.length(e.pubKey)),0):e.pubKey.length&&(t.pubKey=e.pubKey)),null!=e.privKey&&("string"===typeof e.privKey?s.base64.decode(e.privKey,t.privKey=s.newBuffer(s.base64.length(e.privKey)),0):e.privKey.length&&(t.privKey=e.privKey)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=s.newBuffer(r.id))),t.bytes===String?r.pubKey="":(r.pubKey=[],t.bytes!==Array&&(r.pubKey=s.newBuffer(r.pubKey))),t.bytes===String?r.privKey="":(r.privKey=[],t.bytes!==Array&&(r.privKey=s.newBuffer(r.privKey)))),null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?s.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.pubKey&&e.hasOwnProperty("pubKey")&&(r.pubKey=t.bytes===String?s.base64.encode(e.pubKey,0,e.pubKey.length):t.bytes===Array?Array.prototype.slice.call(e.pubKey):e.pubKey),null!=e.privKey&&e.hasOwnProperty("privKey")&&(r.privKey=t.bytes===String?s.base64.encode(e.privKey,0,e.privKey.length):t.bytes===Array?Array.prototype.slice.call(e.privKey):e.privKey),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},80642:(e,t,r)=>{"use strict";const n=r(66698),{Multiaddr:i}=r(57604),o=r(27862),{EventEmitter:s}=r(2331),a=r(39287),u=Object.assign(a("libp2p:bootstrap"),{error:a("libp2p:bootstrap:error")});(e.exports=class extends s{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{list:[]};if(!e.list||!e.list.length)throw new Error("Bootstrap requires a list of peer addresses");super(),this._list=e.list,this._interval=e.interval||1e4,this._timer=null}start(){this._timer||(this._timer=setInterval((()=>this._discoverBootstrapPeers()),this._interval),u("Starting bootstrap node discovery"),this._discoverBootstrapPeers())}_discoverBootstrapPeers(){this._timer&&this._list.forEach((e=>{if(!o.P2P.matches(e))return u.error("Invalid multiaddr");const t=new i(e),r=t.getPeerId();if(!r)return void u.error("Invalid bootstrap multiaddr without peer id");const s=n.createFromB58String(r);try{this.emit("peer",{id:s,multiaddrs:[t]})}catch(a){u.error("Invalid bootstrap peer id",a)}}))}stop(){this._timer&&clearInterval(this._timer),this._timer=null}}).tag="bootstrap"},46543:(e,t,r)=>{"use strict";const n=r(61446),i={16:"aes-128-ctr",32:"aes-256-ctr"};e.exports=function(e){const t=i[e.length];if(!t){const t=Object.entries(i).map((e=>{let[t,r]=e;return"".concat(t," (").concat(r,")")})).join(" / ");throw n(new Error("Invalid key length ".concat(e.length," bytes. Must be ").concat(t)),"ERR_INVALID_KEY_LENGTH")}return t}},79192:(e,t,r)=>{"use strict";r(16221);const n=r(5525),{toString:i}=r(42531),{fromString:o}=r(79740);e.exports={createCipheriv:(e,t,r)=>{const s=n.cipher.createCipher("AES-CTR",i(t,"ascii"));return s.start({iv:i(r,"ascii")}),{update:e=>(s.update(n.util.createBuffer(i(e,"ascii"))),o(s.output.getBytes(),"ascii"))}},createDecipheriv:(e,t,r)=>{const s=n.cipher.createDecipher("AES-CTR",i(t,"ascii"));return s.start({iv:i(r,"ascii")}),{update:e=>(s.update(n.util.createBuffer(i(e,"ascii"))),o(s.output.getBytes(),"ascii"))}}}},66076:(e,t,r)=>{"use strict";const n=r(79192),i=r(46543);t.create=async function(e,t){const r=i(e),o=n.createCipheriv(r,e,t),s=n.createDecipheriv(r,e,t);return{encrypt:async e=>o.update(e),decrypt:async e=>s.update(e)}}},73600:(e,t,r)=>{"use strict";const{concat:n}=r(8034),{fromString:i}=r(79740),o=r(39508);e.exports={create:function(){let{algorithm:e="AES-GCM",nonceLength:t=12,keyLength:r=16,digest:s="SHA-256",saltLength:a=16,iterations:u=32767}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=o.get();async function h(o,h){const l=c.getRandomValues(new Uint8Array(a)),f=c.getRandomValues(new Uint8Array(t)),d={name:e,iv:f},p={name:"PBKDF2",salt:l,iterations:u,hash:{name:s}},y=await c.subtle.importKey("raw",i(h),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),g=await c.subtle.deriveKey(p,y,{name:e,length:r},!0,["encrypt"]),m=await c.subtle.encrypt(d,g,o);return n([l,d.iv,new Uint8Array(m)])}async function l(n,o){const h=n.slice(0,a),l=n.slice(a,a+t),f=n.slice(a+t),d={name:e,iv:l},p={name:"PBKDF2",salt:h,iterations:u,hash:{name:s}},y=await c.subtle.importKey("raw",i(o),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),g=await c.subtle.deriveKey(p,y,{name:e,length:r},!0,["decrypt"]),m=await c.subtle.decrypt(d,g,f);return new Uint8Array(m)}return r*=8,{encrypt:h,decrypt:l}}}},17237:(e,t,r)=>{"use strict";const n=r(39508),i=r(38033),o={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"};t.create=async function(e,t){const r=o[e],s=await n.get().subtle.importKey("raw",t,{name:"HMAC",hash:{name:r}},!1,["sign"]);return{digest:async e=>(async(e,t)=>{const r=await n.get().subtle.sign({name:"HMAC"},e,t);return new Uint8Array(r,r.byteOffset,r.byteLength)})(s,e),length:i[e]}}},38033:e=>{"use strict";e.exports={SHA1:20,SHA256:32,SHA512:64}},25137:(e,t,r)=>{"use strict";const n=r(17237),i=r(66076),o=r(13328);t.aes=i,t.hmac=n,t.keys=o,t.randomBytes=r(25797),t.pbkdf2=r(91885)},2793:(e,t,r)=>{"use strict";const n=r(61446),i=r(39508),{base64urlToBuffer:o}=r(96899),s=r(64045),{toString:a}=r(42531),{concat:u}=r(8034),{equals:c}=r(80215),h={"P-256":256,"P-384":384,"P-521":521};t.generateEphmeralKeyPair=async function(e){s(Object.keys(h),e);const t=await i.get().subtle.generateKey({name:"ECDH",namedCurve:e},!0,["deriveBits"]);return{key:f(await i.get().subtle.exportKey("jwk",t.publicKey)),genSharedKey:async(r,n)=>{let o;o=n?await i.get().subtle.importKey("jwk",p(e,n),{name:"ECDH",namedCurve:e},!1,["deriveBits"]):t.privateKey;const s=[await i.get().subtle.importKey("jwk",d(e,r),{name:"ECDH",namedCurve:e},!1,[]),o],a=await i.get().subtle.deriveBits({name:"ECDH",namedCurve:e,public:s[0]},s[1],h[e]);return new Uint8Array(a,a.byteOffset,a.byteLength)}}};const l={"P-256":32,"P-384":48,"P-521":66};function f(e){const t=l[e.crv];return u([Uint8Array.from([4]),o(e.x,t),o(e.y,t)],1+2*t)}function d(e,t){const r=l[e];if(c(!t.slice(0,1),Uint8Array.from([4])))throw n(new Error("Cannot unmarshal public key - invalid key format"),"ERR_INVALID_KEY_FORMAT");return{kty:"EC",crv:e,x:a(t.slice(1,r+1),"base64url"),y:a(t.slice(1+r),"base64url"),ext:!0}}const p=(e,t)=>({...d(e,t.public),d:a(t.private,"base64url")})},49985:(e,t,r)=>{"use strict";const n=r(61446),{equals:i}=r(80215),{sha256:o}=r(27678),{base58btc:s}=r(59376),{identity:a}=r(4991),u=r(31582),c=r(42139),h=r(39852);class l{constructor(e){this._key=d(e,u.publicKeyLength)}async verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return this._key}get bytes(){return c.PublicKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(e){return i(this.bytes,e.bytes)}async hash(){const{bytes:e}=await o.digest(this.bytes);return e}}class f{constructor(e,t){this._key=d(e,u.privateKeyLength),this._publicKey=d(t,u.publicKeyLength)}async sign(e){return u.hashAndSign(this._key,e)}get public(){return new l(this._publicKey)}marshal(){return this._key}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(e){return i(this.bytes,e.bytes)}async hash(){const{bytes:e}=await o.digest(this.bytes);return e}async id(){const e=await a.digest(this.public.bytes);return s.encode(e.bytes).substring(1)}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"libp2p-key";if("libp2p-key"===t)return h.export(this.bytes,e);throw n(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}function d(e,t){if((e=Uint8Array.from(e||[])).length!==t)throw n(new Error("Key must be a Uint8Array of length ".concat(t,", got ").concat(e.length)),"ERR_INVALID_KEY_TYPE");return e}e.exports={Ed25519PublicKey:l,Ed25519PrivateKey:f,unmarshalEd25519PrivateKey:function(e){if(e.length>u.privateKeyLength){const t=(e=d(e,u.privateKeyLength+u.publicKeyLength)).slice(0,u.privateKeyLength),r=e.slice(u.privateKeyLength,e.length);return new f(t,r)}const t=(e=d(e,u.privateKeyLength)).slice(0,u.privateKeyLength),r=e.slice(u.publicKeyLength);return new f(t,r)},unmarshalEd25519PublicKey:function(e){return e=d(e,u.publicKeyLength),new l(e)},generateKeyPair:async function(){const{privateKey:e,publicKey:t}=await u.generateKey();return new f(e,t)},generateKeyPairFromSeed:async function(e){const{privateKey:t,publicKey:r}=await u.generateKeyFromSeed(e);return new f(t,r)}}},31582:(e,t,r)=>{"use strict";r(5409);const n=r(5525);t.publicKeyLength=n.pki.ed25519.constants.PUBLIC_KEY_BYTE_LENGTH,t.privateKeyLength=n.pki.ed25519.constants.PRIVATE_KEY_BYTE_LENGTH,t.generateKey=async function(){return n.pki.ed25519.generateKeyPair()},t.generateKeyFromSeed=async function(e){return n.pki.ed25519.generateKeyPair({seed:e})},t.hashAndSign=async function(e,t){return n.pki.ed25519.sign({message:t,privateKey:e})},t.hashAndVerify=async function(e,t,r){return n.pki.ed25519.verify({signature:t,message:r,publicKey:e})}},316:(e,t,r)=>{"use strict";const n=r(2793);e.exports=async e=>n.generateEphmeralKeyPair(e)},39852:(e,t,r)=>{"use strict";const{base64:n}=r(86443),i=r(73600);e.exports={export:async function(e,t){const r=i.create(),o=await r.encrypt(e,t);return n.encode(o)}}},54336:(e,t,r)=>{"use strict";const{base64:n}=r(86443),i=r(73600);e.exports={import:async function(e,t){const r=n.decode(e),o=i.create();return await o.decrypt(r,t)}}},13328:(e,t,r)=>{"use strict";const n=r(42139);r(93758),r(79850);const i=r(5525),o=r(61446),{fromString:s}=r(79740),a=r(54336),u={rsa:r(78536),ed25519:r(49985),secp256k1:r(50242)(n,r(25797))},c="secp256k1 support requires libp2p-crypto-secp256k1 package",h="ERR_MISSING_PACKAGE";function l(e){const t=u[e.toLowerCase()];if(!t){const t=Object.keys(u).join(" / ");throw o(new Error("invalid or unsupported key type ".concat(e,". Must be ").concat(t)),"ERR_UNSUPPORTED_KEY_TYPE")}return t}const f=async e=>{const t=n.PrivateKey.decode(e),r=t.Data;switch(t.Type){case n.KeyType.RSA:return u.rsa.unmarshalRsaPrivateKey(r);case n.KeyType.Ed25519:return u.ed25519.unmarshalEd25519PrivateKey(r);case n.KeyType.Secp256k1:if(u.secp256k1)return u.secp256k1.unmarshalSecp256k1PrivateKey(r);throw o(new Error(c),h);default:l(t.Type)}};e.exports={supportedKeys:u,keysPBM:n,keyStretcher:r(19563),generateEphemeralKeyPair:r(316),generateKeyPair:async(e,t)=>l(e).generateKeyPair(t),generateKeyPairFromSeed:async(e,t,r)=>{const n=l(e);if("ed25519"!==e.toLowerCase())throw o(new Error("Seed key derivation is unimplemented for RSA or secp256k1"),"ERR_UNSUPPORTED_KEY_DERIVATION_TYPE");return n.generateKeyPairFromSeed(t,r)},unmarshalPublicKey:e=>{const t=n.PublicKey.decode(e),r=t.Data;switch(t.Type){case n.KeyType.RSA:return u.rsa.unmarshalRsaPublicKey(r);case n.KeyType.Ed25519:return u.ed25519.unmarshalEd25519PublicKey(r);case n.KeyType.Secp256k1:if(u.secp256k1)return u.secp256k1.unmarshalSecp256k1PublicKey(r);throw o(new Error(c),h);default:l(t.Type)}},marshalPublicKey:(e,t)=>(l(t=(t||"rsa").toLowerCase()),e.bytes),unmarshalPrivateKey:f,marshalPrivateKey:(e,t)=>(l(t=(t||"rsa").toLowerCase()),e.bytes),import:async(e,t)=>{try{const r=await a.import(e,t);return f(r)}catch(c){}const r=i.pki.decryptRsaPrivateKey(e,t);if(null===r)throw o(new Error("Cannot read the key, most likely the password is wrong or not a RSA key"),"ERR_CANNOT_DECRYPT_PEM");let n=i.asn1.toDer(i.pki.privateKeyToAsn1(r));return n=s(n.getBytes(),"ascii"),u.rsa.unmarshalRsaPrivateKey(n)}}},8226:(e,t,r)=>{"use strict";r(95842);const n=r(5525),{base64urlToBigInteger:i}=r(96899);function o(e,t){return t.map((t=>i(e[t])))}e.exports={jwk2pub:function(e){return n.pki.setRsaPublicKey(...o(e,["n","e"]))},jwk2priv:function(e){return n.pki.setRsaPrivateKey(...o(e,["n","e","d","p","q","dp","dq","qi"]))}}},19563:(e,t,r)=>{"use strict";const n=r(61446),{concat:i}=r(8034),{fromString:o}=r(79740),s=r(17237),a={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};e.exports=async(e,t,r)=>{const u=a[e];if(!u){const t=Object.keys(a).join(" / ");throw n(new Error("unknown cipher type '".concat(e,"'. Must be ").concat(t)),"ERR_INVALID_CIPHER_TYPE")}if(!t)throw n(new Error("missing hash type"),"ERR_MISSING_HASH_TYPE");const c=u.keySize,h=u.ivSize,l=o("key expansion"),f=2*(h+c+20),d=await s.create(t,r);let p=await d.digest(l);const y=[];let g=0;for(;g<f;){const e=await d.digest(i([p,l]));let t=e.length;g+t>f&&(t=f-g),y.push(e),g+=t,p=await d.digest(p)}const m=f/2,b=i(y),v=b.slice(0,m),w=b.slice(m,f),_=e=>({iv:e.slice(0,h),cipherKey:e.slice(h,h+c),macKey:e.slice(h+c)});return{k1:_(v),k2:_(w)}}},42139:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-crypto-keys"]||(n.roots["libp2p-crypto-keys"]={});a.KeyType=function(){var e={},t=Object.create(e);return t[e[0]="RSA"]=0,t[e[1]="Ed25519"]=1,t[e[2]="Secp256k1"]=2,t}(),a.PublicKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.Type=0,e.prototype.Data=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(8).int32(e.Type),t.uint32(18).bytes(e.Data),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PublicKey;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw s.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw s.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PublicKey)return e;var t=new a.PublicKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?s.base64.decode(e.Data,t.Data=s.newBuffer(s.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=s.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?a.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?s.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),a.PrivateKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.Type=0,e.prototype.Data=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(8).int32(e.Type),t.uint32(18).bytes(e.Data),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PrivateKey;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw s.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw s.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PrivateKey)return e;var t=new a.PrivateKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?s.base64.decode(e.Data,t.Data=s.newBuffer(s.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=s.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?a.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?s.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},75865:(e,t,r)=>{"use strict";const n=r(39508),i=r(25797),{toString:o}=r(42531),{fromString:s}=r(79740);function a(e){return Promise.all([n.get().subtle.exportKey("jwk",e.privateKey),n.get().subtle.exportKey("jwk",e.publicKey)])}t.utils=r(13115),t.generateKey=async function(e){const t=await n.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await a(t);return{privateKey:r[0],publicKey:r[1]}},t.unmarshalPrivateKey=async function(e){const t=[await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await(r=e,n.get().subtle.importKey("jwk",{kty:r.kty,n:r.n,e:r.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"]))];var r;const i=await a({privateKey:t[0],publicKey:t[1]});return{privateKey:i[0],publicKey:i[1]}},t.getRandomValues=i,t.hashAndSign=async function(e,t){const r=await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),i=await n.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(t));return new Uint8Array(i,i.byteOffset,i.byteLength)},t.hashAndVerify=async function(e,t,r){const i=await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return n.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},i,t,r)};const{jwk2pub:u,jwk2priv:c}=r(8226);function h(e,t,r,n){const i=t?u(e):c(e),a=n(o(Uint8Array.from(r),"ascii"),i);return s(a,"ascii")}t.encrypt=function(e,t){return h(e,!0,t,((e,t)=>t.encrypt(e)))},t.decrypt=function(e,t){return h(e,!1,t,((e,t)=>t.decrypt(e)))}},78536:(e,t,r)=>{"use strict";const{sha256:n}=r(27678),i=r(61446),{equals:o}=r(80215),{toString:s}=r(42531);r(16654),r(5409);const a=r(5525),u=r(75865),c=r(42139),h=r(39852);class l{constructor(e){this._key=e}async verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return u.utils.jwkToPkix(this._key)}get bytes(){return c.PublicKey.encode({Type:c.KeyType.RSA,Data:this.marshal()}).finish()}encrypt(e){return u.encrypt(this._key,e)}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}}class f{constructor(e,t){this._key=e,this._publicKey=t}genSecret(){return u.getRandomValues(16)}async sign(e){return u.hashAndSign(this._key,e)}get public(){if(!this._publicKey)throw i(new Error("public key not provided"),"ERR_PUBKEY_NOT_PROVIDED");return new l(this._publicKey)}decrypt(e){return u.decrypt(this._key,e)}marshal(){return u.utils.jwkToPkcs1(this._key)}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.RSA,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}async id(){const e=await this.public.hash();return s(e,"base58btc")}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pkcs-8";if("pkcs-8"===t){const t=new a.util.ByteBuffer(this.marshal()),r=a.asn1.fromDer(t),n=a.pki.privateKeyFromAsn1(r),i={algorithm:"aes256",count:1e4,saltSize:16,prfAlgorithm:"sha512"};return a.pki.encryptRsaPrivateKey(n,e,i)}if("libp2p-key"===t)return h.export(this.bytes,e);throw i(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}e.exports={RsaPublicKey:l,RsaPrivateKey:f,unmarshalRsaPublicKey:function(e){const t=u.utils.pkixToJwk(e);return new l(t)},unmarshalRsaPrivateKey:async function(e){const t=u.utils.pkcs1ToJwk(e),r=await u.unmarshalPrivateKey(t);return new f(r.privateKey,r.publicKey)},generateKeyPair:async function(e){const t=await u.generateKey(e);return new f(t.privateKey,t.publicKey)},fromJwk:async function(e){const t=await u.unmarshalPrivateKey(e);return new f(t.privateKey,t.publicKey)}}},13115:(e,t,r)=>{"use strict";r(93758),r(95842);const n=r(5525),{bigIntegerToUintBase64url:i,base64urlToBigInteger:o}=r(96899),{fromString:s}=r(79740),{toString:a}=r(42531);t.pkcs1ToJwk=function(e){const t=n.asn1.fromDer(a(e,"ascii")),r=n.pki.privateKeyFromAsn1(t);return{kty:"RSA",n:i(r.n),e:i(r.e),d:i(r.d),p:i(r.p),q:i(r.q),dp:i(r.dP),dq:i(r.dQ),qi:i(r.qInv),alg:"RS256",kid:"2011-04-29"}},t.jwkToPkcs1=function(e){const t=n.pki.privateKeyToAsn1({n:o(e.n),e:o(e.e),d:o(e.d),p:o(e.p),q:o(e.q),dP:o(e.dp),dQ:o(e.dq),qInv:o(e.qi)});return s(n.asn1.toDer(t).getBytes(),"ascii")},t.pkixToJwk=function(e){const t=n.asn1.fromDer(a(e,"ascii")),r=n.pki.publicKeyFromAsn1(t);return{kty:"RSA",n:i(r.n),e:i(r.e),alg:"RS256",kid:"2011-04-29"}},t.jwkToPkix=function(e){const t=n.pki.publicKeyToAsn1({n:o(e.n),e:o(e.e)});return s(n.asn1.toDer(t).getBytes(),"ascii")}},50242:(e,t,r)=>{"use strict";const{sha256:n}=r(27678),i=r(61446),{equals:o}=r(80215),{toString:s}=r(42531),a=r(39852);e.exports=(e,t,u)=>{u=u||r(24719)(t);class c{constructor(e){u.validatePublicKey(e),this._key=e}verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return u.compressPublicKey(this._key)}get bytes(){return e.PublicKey.encode({Type:e.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}}class h{constructor(e,t){this._key=e,this._publicKey=t||u.computePublicKey(e),u.validatePrivateKey(this._key),u.validatePublicKey(this._publicKey)}sign(e){return u.hashAndSign(this._key,e)}get public(){return new c(this._publicKey)}marshal(){return this._key}get bytes(){return e.PrivateKey.encode({Type:e.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}async id(){const e=await this.public.hash();return s(e,"base58btc")}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"libp2p-key";if("libp2p-key"===t)return a.export(this.bytes,e);throw i(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}return{Secp256k1PublicKey:c,Secp256k1PrivateKey:h,unmarshalSecp256k1PrivateKey:function(e){return new h(e)},unmarshalSecp256k1PublicKey:function(e){return new c(e)},generateKeyPair:async function(){const e=await u.generateKey();return new h(e)}}}},24719:(e,t,r)=>{"use strict";const n=r(44846),{sha256:i}=r(27678);e.exports=e=>{function t(e){if(!n.privateKeyVerify(e))throw new Error("Invalid private key")}return{generateKey:function(){let t;do{t=e(32)}while(!n.privateKeyVerify(t));return t},privateKeyLength:32,hashAndSign:async function(e,t){const{digest:r}=await i.digest(t),o=n.ecdsaSign(r,e);return n.signatureExport(o.signature)},hashAndVerify:async function(e,t,r){const{digest:o}=await i.digest(r);return t=n.signatureImport(t),n.ecdsaVerify(t,o,e)},compressPublicKey:function(e){if(!n.publicKeyVerify(e))throw new Error("Invalid public key");return n.publicKeyConvert(e,!0)},decompressPublicKey:function(e){return n.publicKeyConvert(e,!1)},validatePrivateKey:t,validatePublicKey:function(e){if(!n.publicKeyVerify(e))throw new Error("Invalid public key")},computePublicKey:function(e){return t(e),n.publicKeyCreate(e)}}}},64045:(e,t,r)=>{"use strict";const n=r(61446);e.exports=function(e,t){if(!e.includes(t)){const r=e.join(" / ");throw n(new Error("Unknown curve: ".concat(t,". Must be ").concat(r)),"ERR_INVALID_CURVE")}}},91885:(e,t,r)=>{"use strict";const n=r(77846),i=r(35139),o=r(61446),s={sha1:"sha1","sha2-256":"sha256","sha2-512":"sha512"};e.exports=function(e,t,r,a,u){const c=s[u];if(!c){const e=Object.keys(s).join(" / ");throw o(new Error("Hash '".concat(u,"' is unknown or not supported. Must be ").concat(e)),"ERR_UNSUPPORTED_HASH_TYPE")}const h=n(e,t,r,a,c);return i.encode64(h)}},25797:(e,t,r)=>{"use strict";const n=r(6543),i=r(61446);e.exports=function(e){if(isNaN(e)||e<=0)throw i(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return n(e)}},96899:(e,t,r)=>{"use strict";r(35139),r(24926);const n=r(5525),{fromString:i}=r(79740),{toString:o}=r(42531),{concat:s}=r(8034);t.bigIntegerToUintBase64url=(e,t)=>{let r=Uint8Array.from(e.abs().toByteArray());if(r=0===r[0]?r.slice(1):r,null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=s([new Uint8Array(t-r.length),r])}return o(r,"base64url")},t.base64urlToBigInteger=e=>{const r=t.base64urlToBuffer(e);return new n.jsbn.BigInteger(o(r,"base16"),16)},t.base64urlToBuffer=(e,t)=>{let r=i(e,"base64urlpad");if(null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=s([new Uint8Array(t-r.length),r])}return r}},39508:(e,t)=>{"use strict";t.get=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:self;const t=e.crypto||e.msCrypto;if(!t||!t.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return t}},25221:(e,t,r)=>{"use strict";const{concat:n}=r(41158),{fromString:i}=r(16406),o=r(2322);e.exports={create:function(){let{algorithm:e="AES-GCM",nonceLength:t=12,keyLength:r=16,digest:s="SHA-256",saltLength:a=16,iterations:u=32767}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=o.get();async function h(o,h){const l=c.getRandomValues(new Uint8Array(a)),f=c.getRandomValues(new Uint8Array(t)),d={name:e,iv:f},p={name:"PBKDF2",salt:l,iterations:u,hash:{name:s}},y=await c.subtle.importKey("raw",i(h),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),g=await c.subtle.deriveKey(p,y,{name:e,length:r},!0,["encrypt"]),m=await c.subtle.encrypt(d,g,o);return n([l,d.iv,new Uint8Array(m)])}async function l(n,o){const h=n.slice(0,a),l=n.slice(a,a+t),f=n.slice(a+t),d={name:e,iv:l},p={name:"PBKDF2",salt:h,iterations:u,hash:{name:s}},y=await c.subtle.importKey("raw",i(o),{name:"PBKDF2"},!1,["deriveKey","deriveBits"]),g=await c.subtle.deriveKey(p,y,{name:e,length:r},!0,["decrypt"]),m=await c.subtle.decrypt(d,g,f);return new Uint8Array(m)}return r*=8,{encrypt:h,decrypt:l}}}},31080:(e,t,r)=>{"use strict";const n=r(2322),i=r(3665),o={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"};t.create=async function(e,t){const r=o[e],s=await n.get().subtle.importKey("raw",t,{name:"HMAC",hash:{name:r}},!1,["sign"]);return{digest:async e=>(async(e,t)=>{const r=await n.get().subtle.sign({name:"HMAC"},e,t);return new Uint8Array(r,r.byteOffset,r.byteLength)})(s,e),length:i[e]}}},3665:e=>{"use strict";e.exports={SHA1:20,SHA256:32,SHA512:64}},84955:(e,t,r)=>{"use strict";const n=r(61446),i=r(2322),{base64urlToBuffer:o}=r(20344),s=r(62927),{toString:a}=r(10157),{concat:u}=r(41158),{equals:c}=r(8552),h={"P-256":256,"P-384":384,"P-521":521};t.generateEphmeralKeyPair=async function(e){s(Object.keys(h),e);const t=await i.get().subtle.generateKey({name:"ECDH",namedCurve:e},!0,["deriveBits"]);return{key:f(await i.get().subtle.exportKey("jwk",t.publicKey)),genSharedKey:async(r,n)=>{let o;o=n?await i.get().subtle.importKey("jwk",p(e,n),{name:"ECDH",namedCurve:e},!1,["deriveBits"]):t.privateKey;const s=[await i.get().subtle.importKey("jwk",d(e,r),{name:"ECDH",namedCurve:e},!1,[]),o],a=await i.get().subtle.deriveBits({name:"ECDH",namedCurve:e,public:s[0]},s[1],h[e]);return new Uint8Array(a,a.byteOffset,a.byteLength)}}};const l={"P-256":32,"P-384":48,"P-521":66};function f(e){const t=l[e.crv];return u([Uint8Array.from([4]),o(e.x,t),o(e.y,t)],1+2*t)}function d(e,t){const r=l[e];if(c(!t.slice(0,1),Uint8Array.from([4])))throw n(new Error("Cannot unmarshal public key - invalid key format"),"ERR_INVALID_KEY_FORMAT");return{kty:"EC",crv:e,x:a(t.slice(1,r+1),"base64url"),y:a(t.slice(1+r),"base64url"),ext:!0}}const p=(e,t)=>({...d(e,t.public),d:a(t.private,"base64url")})},25732:(e,t,r)=>{"use strict";const n=r(61446),{equals:i}=r(8552),{sha256:o}=r(27678),{base58btc:s}=r(59376),{identity:a}=r(4991),u=r(45434),c=r(40232),h=r(25922);class l{constructor(e){this._key=d(e,u.publicKeyLength)}async verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return this._key}get bytes(){return c.PublicKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(e){return i(this.bytes,e.bytes)}async hash(){const{bytes:e}=await o.digest(this.bytes);return e}}class f{constructor(e,t){this._key=d(e,u.privateKeyLength),this._publicKey=d(t,u.publicKeyLength)}async sign(e){return u.hashAndSign(this._key,e)}get public(){return new l(this._publicKey)}marshal(){return this._key}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()}).finish()}equals(e){return i(this.bytes,e.bytes)}async hash(){const{bytes:e}=await o.digest(this.bytes);return e}async id(){const e=await a.digest(this.public.bytes);return s.encode(e.bytes).substring(1)}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"libp2p-key";if("libp2p-key"===t)return h.export(this.bytes,e);throw n(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}function d(e,t){if((e=Uint8Array.from(e||[])).length!==t)throw n(new Error("Key must be a Uint8Array of length ".concat(t,", got ").concat(e.length)),"ERR_INVALID_KEY_TYPE");return e}e.exports={Ed25519PublicKey:l,Ed25519PrivateKey:f,unmarshalEd25519PrivateKey:function(e){if(e.length>u.privateKeyLength){const t=(e=d(e,u.privateKeyLength+u.publicKeyLength)).slice(0,u.privateKeyLength),r=e.slice(u.privateKeyLength,e.length);return new f(t,r)}const t=(e=d(e,u.privateKeyLength)).slice(0,u.privateKeyLength),r=e.slice(u.publicKeyLength);return new f(t,r)},unmarshalEd25519PublicKey:function(e){return e=d(e,u.publicKeyLength),new l(e)},generateKeyPair:async function(){const{privateKey:e,publicKey:t}=await u.generateKey();return new f(e,t)},generateKeyPairFromSeed:async function(e){const{privateKey:t,publicKey:r}=await u.generateKeyFromSeed(e);return new f(t,r)}}},45434:(e,t,r)=>{"use strict";const n=r(12877);function i(e,r){const n=new Uint8Array(t.privateKeyLength);for(let t=0;t<32;t++)n[t]=e[t],n[32+t]=r[t];return n}t.publicKeyLength=32,t.privateKeyLength=64,t.generateKey=async function(){const e=n.utils.randomPrivateKey(),t=await n.getPublicKey(e);return{privateKey:i(e,t),publicKey:t}},t.generateKeyFromSeed=async function(e){if(32!==e.length)throw new TypeError('"seed" must be 32 bytes in length.');if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');const t=e,r=await n.getPublicKey(t);return{privateKey:i(t,r),publicKey:r}},t.hashAndSign=function(e,t){const r=e.slice(0,32);return n.sign(t,r)},t.hashAndVerify=function(e,t,r){return n.verify(t,r,e)}},87908:(e,t,r)=>{"use strict";const n=r(84955);e.exports=async e=>n.generateEphmeralKeyPair(e)},25922:(e,t,r)=>{"use strict";const{base64:n}=r(86443),i=r(25221);e.exports={export:async function(e,t){const r=i.create(),o=await r.encrypt(e,t);return n.encode(o)}}},43426:(e,t,r)=>{"use strict";const{base64:n}=r(86443),i=r(25221);e.exports={import:async function(e,t){const r=n.decode(e),o=i.create();return await o.decrypt(r,t)}}},81735:(e,t,r)=>{"use strict";const n=r(40232);r(93758),r(79850);const i=r(5525),o=r(61446),{fromString:s}=r(16406),a=r(43426),u={rsa:r(59343),ed25519:r(25732),secp256k1:r(96281)(n,r(49203))},c="secp256k1 support requires libp2p-crypto-secp256k1 package",h="ERR_MISSING_PACKAGE";function l(e){const t=u[e.toLowerCase()];if(!t){const t=Object.keys(u).join(" / ");throw o(new Error("invalid or unsupported key type ".concat(e,". Must be ").concat(t)),"ERR_UNSUPPORTED_KEY_TYPE")}return t}const f=async e=>{const t=n.PrivateKey.decode(e),r=t.Data;switch(t.Type){case n.KeyType.RSA:return u.rsa.unmarshalRsaPrivateKey(r);case n.KeyType.Ed25519:return u.ed25519.unmarshalEd25519PrivateKey(r);case n.KeyType.Secp256k1:if(u.secp256k1)return u.secp256k1.unmarshalSecp256k1PrivateKey(r);throw o(new Error(c),h);default:l(t.Type)}};e.exports={supportedKeys:u,keysPBM:n,keyStretcher:r(21643),generateEphemeralKeyPair:r(87908),generateKeyPair:async(e,t)=>l(e).generateKeyPair(t),generateKeyPairFromSeed:async(e,t,r)=>{const n=l(e);if("ed25519"!==e.toLowerCase())throw o(new Error("Seed key derivation is unimplemented for RSA or secp256k1"),"ERR_UNSUPPORTED_KEY_DERIVATION_TYPE");return n.generateKeyPairFromSeed(t,r)},unmarshalPublicKey:e=>{const t=n.PublicKey.decode(e),r=t.Data;switch(t.Type){case n.KeyType.RSA:return u.rsa.unmarshalRsaPublicKey(r);case n.KeyType.Ed25519:return u.ed25519.unmarshalEd25519PublicKey(r);case n.KeyType.Secp256k1:if(u.secp256k1)return u.secp256k1.unmarshalSecp256k1PublicKey(r);throw o(new Error(c),h);default:l(t.Type)}},marshalPublicKey:(e,t)=>(l(t=(t||"rsa").toLowerCase()),e.bytes),unmarshalPrivateKey:f,marshalPrivateKey:(e,t)=>(l(t=(t||"rsa").toLowerCase()),e.bytes),import:async(e,t)=>{try{const r=await a.import(e,t);return f(r)}catch(c){}const r=i.pki.decryptRsaPrivateKey(e,t);if(null===r)throw o(new Error("Cannot read the key, most likely the password is wrong or not a RSA key"),"ERR_CANNOT_DECRYPT_PEM");let n=i.asn1.toDer(i.pki.privateKeyToAsn1(r));return n=s(n.getBytes(),"ascii"),u.rsa.unmarshalRsaPrivateKey(n)}}},33726:(e,t,r)=>{"use strict";r(95842);const n=r(5525),{base64urlToBigInteger:i}=r(20344);function o(e,t){return t.map((t=>i(e[t])))}e.exports={jwk2pub:function(e){return n.pki.setRsaPublicKey(...o(e,["n","e"]))},jwk2priv:function(e){return n.pki.setRsaPrivateKey(...o(e,["n","e","d","p","q","dp","dq","qi"]))}}},21643:(e,t,r)=>{"use strict";const n=r(61446),{concat:i}=r(41158),{fromString:o}=r(16406),s=r(31080),a={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};e.exports=async(e,t,r)=>{const u=a[e];if(!u){const t=Object.keys(a).join(" / ");throw n(new Error("unknown cipher type '".concat(e,"'. Must be ").concat(t)),"ERR_INVALID_CIPHER_TYPE")}if(!t)throw n(new Error("missing hash type"),"ERR_MISSING_HASH_TYPE");const c=u.keySize,h=u.ivSize,l=o("key expansion"),f=2*(h+c+20),d=await s.create(t,r);let p=await d.digest(l);const y=[];let g=0;for(;g<f;){const e=await d.digest(i([p,l]));let t=e.length;g+t>f&&(t=f-g),y.push(e),g+=t,p=await d.digest(p)}const m=f/2,b=i(y),v=b.slice(0,m),w=b.slice(m,f),_=e=>({iv:e.slice(0,h),cipherKey:e.slice(h,h+c),macKey:e.slice(h+c)});return{k1:_(v),k2:_(w)}}},40232:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-crypto-keys"]||(n.roots["libp2p-crypto-keys"]={});a.KeyType=function(){var e={},t=Object.create(e);return t[e[0]="RSA"]=0,t[e[1]="Ed25519"]=1,t[e[2]="Secp256k1"]=2,t}(),a.PublicKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.Type=0,e.prototype.Data=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(8).int32(e.Type),t.uint32(18).bytes(e.Data),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PublicKey;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw s.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw s.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PublicKey)return e;var t=new a.PublicKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?s.base64.decode(e.Data,t.Data=s.newBuffer(s.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=s.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?a.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?s.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),a.PrivateKey=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.Type=0,e.prototype.Data=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(8).int32(e.Type),t.uint32(18).bytes(e.Data),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PrivateKey;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.Type=e.int32();break;case 2:n.Data=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("Type"))throw s.ProtocolError("missing required 'Type'",{instance:n});if(!n.hasOwnProperty("Data"))throw s.ProtocolError("missing required 'Data'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PrivateKey)return e;var t=new a.PrivateKey;switch(e.Type){case"RSA":case 0:t.Type=0;break;case"Ed25519":case 1:t.Type=1;break;case"Secp256k1":case 2:t.Type=2}return null!=e.Data&&("string"===typeof e.Data?s.base64.decode(e.Data,t.Data=s.newBuffer(s.base64.length(e.Data)),0):e.Data.length&&(t.Data=e.Data)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.Type=t.enums===String?"RSA":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=s.newBuffer(r.Data)))),null!=e.Type&&e.hasOwnProperty("Type")&&(r.Type=t.enums===String?a.KeyType[e.Type]:e.Type),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?s.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},40631:(e,t,r)=>{"use strict";const n=r(2322),i=r(49203),{toString:o}=r(10157),{fromString:s}=r(16406);function a(e){return Promise.all([n.get().subtle.exportKey("jwk",e.privateKey),n.get().subtle.exportKey("jwk",e.publicKey)])}t.utils=r(14714),t.generateKey=async function(e){const t=await n.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await a(t);return{privateKey:r[0],publicKey:r[1]}},t.unmarshalPrivateKey=async function(e){const t=[await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await(r=e,n.get().subtle.importKey("jwk",{kty:r.kty,n:r.n,e:r.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"]))];var r;const i=await a({privateKey:t[0],publicKey:t[1]});return{privateKey:i[0],publicKey:i[1]}},t.getRandomValues=i,t.hashAndSign=async function(e,t){const r=await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),i=await n.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(t));return new Uint8Array(i,i.byteOffset,i.byteLength)},t.hashAndVerify=async function(e,t,r){const i=await n.get().subtle.importKey("jwk",e,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return n.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},i,t,r)};const{jwk2pub:u,jwk2priv:c}=r(33726);function h(e,t,r,n){const i=t?u(e):c(e),a=n(o(Uint8Array.from(r),"ascii"),i);return s(a,"ascii")}t.encrypt=function(e,t){return h(e,!0,t,((e,t)=>t.encrypt(e)))},t.decrypt=function(e,t){return h(e,!1,t,((e,t)=>t.decrypt(e)))}},59343:(e,t,r)=>{"use strict";const{sha256:n}=r(27678),i=r(61446),{equals:o}=r(8552),{toString:s}=r(10157);r(16654);const a=r(5525),u=r(40631),c=r(40232),h=r(25922);class l{constructor(e){this._key=e}async verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return u.utils.jwkToPkix(this._key)}get bytes(){return c.PublicKey.encode({Type:c.KeyType.RSA,Data:this.marshal()}).finish()}encrypt(e){return u.encrypt(this._key,e)}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}}class f{constructor(e,t){this._key=e,this._publicKey=t}genSecret(){return u.getRandomValues(16)}async sign(e){return u.hashAndSign(this._key,e)}get public(){if(!this._publicKey)throw i(new Error("public key not provided"),"ERR_PUBKEY_NOT_PROVIDED");return new l(this._publicKey)}decrypt(e){return u.decrypt(this._key,e)}marshal(){return u.utils.jwkToPkcs1(this._key)}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.RSA,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}async id(){const e=await this.public.hash();return s(e,"base58btc")}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pkcs-8";if("pkcs-8"===t){const t=new a.util.ByteBuffer(this.marshal()),r=a.asn1.fromDer(t),n=a.pki.privateKeyFromAsn1(r),i={algorithm:"aes256",count:1e4,saltSize:16,prfAlgorithm:"sha512"};return a.pki.encryptRsaPrivateKey(n,e,i)}if("libp2p-key"===t)return h.export(this.bytes,e);throw i(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}e.exports={RsaPublicKey:l,RsaPrivateKey:f,unmarshalRsaPublicKey:function(e){const t=u.utils.pkixToJwk(e);return new l(t)},unmarshalRsaPrivateKey:async function(e){const t=u.utils.pkcs1ToJwk(e),r=await u.unmarshalPrivateKey(t);return new f(r.privateKey,r.publicKey)},generateKeyPair:async function(e){const t=await u.generateKey(e);return new f(t.privateKey,t.publicKey)},fromJwk:async function(e){const t=await u.unmarshalPrivateKey(e);return new f(t.privateKey,t.publicKey)}}},14714:(e,t,r)=>{"use strict";r(93758),r(95842);const n=r(5525),{bigIntegerToUintBase64url:i,base64urlToBigInteger:o}=r(20344),{fromString:s}=r(16406),{toString:a}=r(10157);t.pkcs1ToJwk=function(e){const t=n.asn1.fromDer(a(e,"ascii")),r=n.pki.privateKeyFromAsn1(t);return{kty:"RSA",n:i(r.n),e:i(r.e),d:i(r.d),p:i(r.p),q:i(r.q),dp:i(r.dP),dq:i(r.dQ),qi:i(r.qInv),alg:"RS256",kid:"2011-04-29"}},t.jwkToPkcs1=function(e){const t=n.pki.privateKeyToAsn1({n:o(e.n),e:o(e.e),d:o(e.d),p:o(e.p),q:o(e.q),dP:o(e.dp),dQ:o(e.dq),qInv:o(e.qi)});return s(n.asn1.toDer(t).getBytes(),"ascii")},t.pkixToJwk=function(e){const t=n.asn1.fromDer(a(e,"ascii")),r=n.pki.publicKeyFromAsn1(t);return{kty:"RSA",n:i(r.n),e:i(r.e),alg:"RS256",kid:"2011-04-29"}},t.jwkToPkix=function(e){const t=n.pki.publicKeyToAsn1({n:o(e.n),e:o(e.e)});return s(n.asn1.toDer(t).getBytes(),"ascii")}},96281:(e,t,r)=>{"use strict";const{sha256:n}=r(27678),i=r(61446),{equals:o}=r(8552),{toString:s}=r(10157),a=r(25922);e.exports=(e,t,u)=>{u=u||r(81361)();class c{constructor(e){u.validatePublicKey(e),this._key=e}verify(e,t){return u.hashAndVerify(this._key,t,e)}marshal(){return u.compressPublicKey(this._key)}get bytes(){return e.PublicKey.encode({Type:e.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}}class h{constructor(e,t){this._key=e,this._publicKey=t||u.computePublicKey(e),u.validatePrivateKey(this._key),u.validatePublicKey(this._publicKey)}sign(e){return u.hashAndSign(this._key,e)}get public(){return new c(this._publicKey)}marshal(){return this._key}get bytes(){return e.PrivateKey.encode({Type:e.KeyType.Secp256k1,Data:this.marshal()}).finish()}equals(e){return o(this.bytes,e.bytes)}async hash(){const{bytes:e}=await n.digest(this.bytes);return e}async id(){const e=await this.public.hash();return s(e,"base58btc")}async export(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"libp2p-key";if("libp2p-key"===t)return a.export(this.bytes,e);throw i(new Error("export format '".concat(t,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT")}}return{Secp256k1PublicKey:c,Secp256k1PrivateKey:h,unmarshalSecp256k1PrivateKey:function(e){return new h(e)},unmarshalSecp256k1PublicKey:function(e){return new c(e)},generateKeyPair:async function(){const e=await u.generateKey();return new h(e)}}}},81361:(e,t,r)=>{"use strict";const n=r(61446),i=r(46440),{sha256:o}=r(27678);e.exports=()=>({generateKey:function(){return i.utils.randomPrivateKey()},privateKeyLength:32,hashAndSign:async function(e,t){const{digest:r}=await o.digest(t);try{return await i.sign(r,e)}catch(s){throw n(s,"ERR_INVALID_INPUT")}},hashAndVerify:async function(e,t,r){try{const{digest:n}=await o.digest(r);return i.verify(t,n,e)}catch(s){throw n(s,"ERR_INVALID_INPUT")}},compressPublicKey:function(e){return i.Point.fromHex(e).toRawBytes(!0)},decompressPublicKey:function(e){return i.Point.fromHex(e).toRawBytes(!1)},validatePrivateKey:function(e){try{i.getPublicKey(e,!0)}catch(t){throw n(t,"ERR_INVALID_PRIVATE_KEY")}},validatePublicKey:function(e){try{i.Point.fromHex(e)}catch(t){throw n(t,"ERR_INVALID_PUBLIC_KEY")}},computePublicKey:function(e){try{return i.getPublicKey(e,!0)}catch(t){throw n(t,"ERR_INVALID_PRIVATE_KEY")}}})},62927:(e,t,r)=>{"use strict";const n=r(61446);e.exports=function(e,t){if(!e.includes(t)){const r=e.join(" / ");throw n(new Error("Unknown curve: ".concat(t,". Must be ").concat(r)),"ERR_INVALID_CURVE")}}},49203:(e,t,r)=>{"use strict";const n=r(6543),i=r(61446);e.exports=function(e){if(isNaN(e)||e<=0)throw i(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return n(e)}},20344:(e,t,r)=>{"use strict";r(35139),r(24926);const n=r(5525),{fromString:i}=r(16406),{toString:o}=r(10157),{concat:s}=r(41158);t.bigIntegerToUintBase64url=(e,t)=>{let r=Uint8Array.from(e.abs().toByteArray());if(r=0===r[0]?r.slice(1):r,null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=s([new Uint8Array(t-r.length),r])}return o(r,"base64url")},t.base64urlToBigInteger=e=>{const r=t.base64urlToBuffer(e);return new n.jsbn.BigInteger(o(r,"base16"),16)},t.base64urlToBuffer=(e,t)=>{let r=i(e,"base64urlpad");if(null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=s([new Uint8Array(t-r.length),r])}return r}},2322:(e,t)=>{"use strict";t.get=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:globalThis;const t=e.crypto;if(!t||!t.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return t}},22974:(e,t)=>{"use strict";t.codes={ERR_INVALID_SIGNATURE_POLICY:"ERR_INVALID_SIGNATURE_POLICY",ERR_UNHANDLED_SIGNATURE_POLICY:"ERR_UNHANDLED_SIGNATURE_POLICY",ERR_MISSING_SIGNATURE:"ERR_MISSING_SIGNATURE",ERR_MISSING_SEQNO:"ERR_MISSING_SEQNO",ERR_INVALID_SIGNATURE:"ERR_INVALID_SIGNATURE",ERR_UNEXPECTED_FROM:"ERR_UNEXPECTED_FROM",ERR_UNEXPECTED_SIGNATURE:"ERR_UNEXPECTED_SIGNATURE",ERR_UNEXPECTED_KEY:"ERR_UNEXPECTED_KEY",ERR_UNEXPECTED_SEQNO:"ERR_UNEXPECTED_SEQNO"}},76650:(e,t,r)=>{"use strict";const n=r(39287),{EventEmitter:i}=r(2331),o=r(61446),{pipe:s}=r(91522),{default:a}=r(10523),u=r(3251),{codes:c}=r(22974),{RPC:h}=r(6967),l=r(91963),{SignaturePolicy:f}=r(48496),d=r(45305),{signMessage:p,verifySignature:y}=r(29786);class g extends i{constructor(e){let{debugName:t,multicodecs:r,libp2p:i,globalSignaturePolicy:s=f.StrictSign,canRelayMessage:u=!1,emitSelf:h=!1,messageProcessingConcurrency:l=10}=e;if("string"!==typeof t)throw new Error("a debugname `string` is required");if(!r)throw new Error("multicodecs are required");if(!i)throw new Error("libp2p is required");if(super(),this.log=Object.assign(n(t),{err:n("".concat(t,":error"))}),this.multicodecs=d.ensureArray(r),this._libp2p=i,this.registrar=i.registrar,this.peerId=i.peerId,this.started=!1,this.topics=new Map,this.subscriptions=new Set,this.peers=new Map,!f[s])throw o(new Error("Invalid global signature policy"),c.ERR_INVALID_SIGNATURE_POLICY);this.globalSignaturePolicy=s,this.canRelayMessage=u,this.emitSelf=h,this.topicValidators=new Map,this.queue=new a({concurrency:l}),this._registrarId=void 0,this._onIncomingStream=this._onIncomingStream.bind(this),this._onPeerConnected=this._onPeerConnected.bind(this),this._onPeerDisconnected=this._onPeerDisconnected.bind(this)}start(){if(this.started)return;this.log("starting"),this.registrar.handle(this.multicodecs,this._onIncomingStream);const e=new u({multicodecs:this.multicodecs,handlers:{onConnect:this._onPeerConnected,onDisconnect:this._onPeerDisconnected}});this._registrarId=this.registrar.register(e),this.log("started"),this.started=!0}stop(){this.started&&(this.registrar.unregister(this._registrarId),this.log("stopping"),this.peers.forEach((e=>e.close())),this.peers=new Map,this.subscriptions=new Set,this.started=!1,this.log("stopped"))}_onIncomingStream(e){let{protocol:t,stream:r,connection:n}=e;const i=n.remotePeer,o=i.toB58String(),s=this._addPeer(i,t),a=s.attachInboundStream(r);this._processMessages(o,a,s)}async _onPeerConnected(e,t){const r=e.toB58String();this.log("connected",r);try{const{stream:r,protocol:n}=await t.newStream(this.multicodecs),i=this._addPeer(e,n);await i.attachOutboundStream(r)}catch(n){this.log.err(n)}this._sendSubscriptions(r,Array.from(this.subscriptions),!0)}_onPeerDisconnected(e,t){const r=e.toB58String();this.log("connection ended",r,t?t.message:""),this._removePeer(e)}_addPeer(e,t){const r=e.toB58String(),n=this.peers.get(r);if(n)return n;this.log("new peer",r);const i=new l({id:e,protocol:t});return this.peers.set(r,i),i.once("close",(()=>this._removePeer(e))),i}_removePeer(e){if(!e)return;const t=e.toB58String(),r=this.peers.get(t);if(r){r.removeAllListeners(),r.close(),this.log("delete peer",t),this.peers.delete(t);for(const e of this.topics.values())e.delete(t);return r}}async _processMessages(e,t,r){try{await s(t,(async t=>{for await(const n of t){const t=n instanceof Uint8Array?n:n.slice(),i=this._decodeRpc(t);(async()=>{try{await this._processRpc(e,r,i)}catch(t){this.log.err(t)}})()}}))}catch(n){this._onPeerDisconnected(r.id,n)}}async _processRpc(e,t,r){this.log("rpc from",e);const n=r.subscriptions,i=r.msgs;return n.length&&(n.forEach((t=>{this._processRpcSubOpt(e,t)})),this.emit("pubsub:subscription-change",t.id,n)),this._acceptFrom(e)?(i.length&&this.queue.addAll(i.map((t=>async()=>{if(this.canRelayMessage||t.topicIDs&&t.topicIDs.some((e=>this.subscriptions.has(e))))try{const r=d.normalizeInRpcMessage(t,e);await this._processRpcMessage(r)}catch(r){this.log.err(r)}else this.log("received message we didn't subscribe to. Dropping.")}))),!0):(this.log("received message from unacceptable peer %s",e),!1)}_processRpcSubOpt(e,t){const r=t.topicID;if(!r)return;let n=this.topics.get(r);n||(n=new Set,this.topics.set(r,n)),t.subscribe?n.add(e):n.delete(e)}async _processRpcMessage(e){if(this.peerId.toB58String()!==e.from||this.emitSelf){try{await this.validate(e)}catch(t){return void this.log("Message is invalid, dropping it. %O",t)}return this._emitMessage(e),this._publish(d.normalizeOutRpcMessage(e))}}_emitMessage(e){e.topicIDs.forEach((t=>{this.subscriptions.has(t)&&this.emit(t,e)}))}getMsgId(e){const t=this.globalSignaturePolicy;switch(t){case f.StrictSign:return d.msgId(e.from,e.seqno);case f.StrictNoSign:return d.noSignMsgId(e.data);default:throw o(new Error("Cannot get message id: unhandled signature policy: "+t),c.ERR_UNHANDLED_SIGNATURE_POLICY)}}_acceptFrom(e){return!0}_decodeRpc(e){return h.decode(e)}_encodeRpc(e){return h.encode(e).finish()}_sendRpc(e,t){const r=this.peers.get(e);if(r&&r.isWritable)r.write(this._encodeRpc(t));else{const t="Cannot send RPC to ".concat(e," as there is no open stream to it available");this.log.err(t)}}_sendSubscriptions(e,t,r){return this._sendRpc(e,{subscriptions:t.map((e=>({topicID:e,subscribe:r})))})}async validate(e){const t=this.globalSignaturePolicy;switch(t){case f.StrictNoSign:if(e.from)throw o(new Error("StrictNoSigning: from should not be present"),c.ERR_UNEXPECTED_FROM);if(e.signature)throw o(new Error("StrictNoSigning: signature should not be present"),c.ERR_UNEXPECTED_SIGNATURE);if(e.key)throw o(new Error("StrictNoSigning: key should not be present"),c.ERR_UNEXPECTED_KEY);if(e.seqno)throw o(new Error("StrictNoSigning: seqno should not be present"),c.ERR_UNEXPECTED_SEQNO);break;case f.StrictSign:if(!e.signature)throw o(new Error("StrictSigning: Signing required and no signature was present"),c.ERR_MISSING_SIGNATURE);if(!e.seqno)throw o(new Error("StrictSigning: Signing required and no seqno was present"),c.ERR_MISSING_SEQNO);if(!await y(e))throw o(new Error("StrictSigning: Invalid message signature"),c.ERR_INVALID_SIGNATURE);break;default:throw o(new Error("Cannot validate message: unhandled signature policy: "+t),c.ERR_UNHANDLED_SIGNATURE_POLICY)}for(const r of e.topicIDs){const t=this.topicValidators.get(r);t&&await t(r,e)}}_buildMessage(e){const t=this.globalSignaturePolicy;switch(t){case f.StrictSign:return e.from=this.peerId.toB58String(),e.seqno=d.randomSeqno(),p(this.peerId,e);case f.StrictNoSign:return Promise.resolve(e);default:throw o(new Error("Cannot build message: unhandled signature policy: "+t),c.ERR_UNHANDLED_SIGNATURE_POLICY)}}getSubscribers(e){if(!this.started)throw o(new Error("not started yet"),"ERR_NOT_STARTED_YET");if(!e||"string"!==typeof e)throw o(new Error("a string topic must be provided"),"ERR_NOT_VALID_TOPIC");const t=this.topics.get(e);return t?Array.from(t):[]}async publish(e,t){if(!this.started)throw new Error("Pubsub has not started");this.log("publish",e,t);const r={receivedFrom:this.peerId.toB58String(),data:t,topicIDs:[e]},n=await this._buildMessage(r),i=d.normalizeInRpcMessage(n);this.emitSelf&&this._emitMessage(i),await this._publish(i)}_publish(e){throw o(new Error("publish must be implemented by the subclass"),"ERR_NOT_IMPLEMENTED")}subscribe(e){if(!this.started)throw new Error("Pubsub has not started");this.subscriptions.has(e)||(this.subscriptions.add(e),this.peers.forEach(((t,r)=>this._sendSubscriptions(r,[e],!0))))}unsubscribe(e){if(!this.started)throw new Error("Pubsub is not started");this.subscriptions.has(e)&&0===this.listenerCount(e)&&(this.subscriptions.delete(e),this.peers.forEach(((t,r)=>this._sendSubscriptions(r,[e],!1))))}getTopics(){if(!this.started)throw new Error("Pubsub is not started");return Array.from(this.subscriptions)}}g.utils=d,g.SignaturePolicy=f,e.exports=g},6967:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-pubsub-rpc"]||(n.roots["libp2p-pubsub-rpc"]={});a.RPC=function(){function e(e){if(this.subscriptions=[],this.msgs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.subscriptions=s.emptyArray,e.prototype.msgs=s.emptyArray,e.encode=function(e,t){if(t||(t=o.create()),null!=e.subscriptions&&e.subscriptions.length)for(var r=0;r<e.subscriptions.length;++r)a.RPC.SubOpts.encode(e.subscriptions[r],t.uint32(10).fork()).ldelim();if(null!=e.msgs&&e.msgs.length)for(r=0;r<e.msgs.length;++r)a.RPC.Message.encode(e.msgs[r],t.uint32(18).fork()).ldelim();return t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.RPC;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.subscriptions&&n.subscriptions.length||(n.subscriptions=[]),n.subscriptions.push(a.RPC.SubOpts.decode(e,e.uint32()));break;case 2:n.msgs&&n.msgs.length||(n.msgs=[]),n.msgs.push(a.RPC.Message.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.RPC)return e;var t=new a.RPC;if(e.subscriptions){if(!Array.isArray(e.subscriptions))throw TypeError(".RPC.subscriptions: array expected");t.subscriptions=[];for(var r=0;r<e.subscriptions.length;++r){if("object"!==typeof e.subscriptions[r])throw TypeError(".RPC.subscriptions: object expected");t.subscriptions[r]=a.RPC.SubOpts.fromObject(e.subscriptions[r])}}if(e.msgs){if(!Array.isArray(e.msgs))throw TypeError(".RPC.msgs: array expected");t.msgs=[];for(r=0;r<e.msgs.length;++r){if("object"!==typeof e.msgs[r])throw TypeError(".RPC.msgs: object expected");t.msgs[r]=a.RPC.Message.fromObject(e.msgs[r])}}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.subscriptions=[],r.msgs=[]),e.subscriptions&&e.subscriptions.length){r.subscriptions=[];for(var n=0;n<e.subscriptions.length;++n)r.subscriptions[n]=a.RPC.SubOpts.toObject(e.subscriptions[n],t)}if(e.msgs&&e.msgs.length){r.msgs=[];for(n=0;n<e.msgs.length;++n)r.msgs[n]=a.RPC.Message.toObject(e.msgs[n],t)}return r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.SubOpts=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var t;return e.prototype.subscribe=null,e.prototype.topicID=null,Object.defineProperty(e.prototype,"_subscribe",{get:s.oneOfGetter(t=["subscribe"]),set:s.oneOfSetter(t)}),Object.defineProperty(e.prototype,"_topicID",{get:s.oneOfGetter(t=["topicID"]),set:s.oneOfSetter(t)}),e.encode=function(e,t){return t||(t=o.create()),null!=e.subscribe&&Object.hasOwnProperty.call(e,"subscribe")&&t.uint32(8).bool(e.subscribe),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&t.uint32(18).string(e.topicID),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.RPC.SubOpts;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.subscribe=e.bool();break;case 2:n.topicID=e.string();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.RPC.SubOpts)return e;var t=new a.RPC.SubOpts;return null!=e.subscribe&&(t.subscribe=Boolean(e.subscribe)),null!=e.topicID&&(t.topicID=String(e.topicID)),t},e.toObject=function(e,t){t||(t={});var r={};return null!=e.subscribe&&e.hasOwnProperty("subscribe")&&(r.subscribe=e.subscribe,t.oneofs&&(r._subscribe="subscribe")),null!=e.topicID&&e.hasOwnProperty("topicID")&&(r.topicID=e.topicID,t.oneofs&&(r._topicID="topicID")),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.Message=function(){function e(e){if(this.topicIDs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var t;return e.prototype.from=null,e.prototype.data=null,e.prototype.seqno=null,e.prototype.topicIDs=s.emptyArray,e.prototype.signature=null,e.prototype.key=null,Object.defineProperty(e.prototype,"_from",{get:s.oneOfGetter(t=["from"]),set:s.oneOfSetter(t)}),Object.defineProperty(e.prototype,"_data",{get:s.oneOfGetter(t=["data"]),set:s.oneOfSetter(t)}),Object.defineProperty(e.prototype,"_seqno",{get:s.oneOfGetter(t=["seqno"]),set:s.oneOfSetter(t)}),Object.defineProperty(e.prototype,"_signature",{get:s.oneOfGetter(t=["signature"]),set:s.oneOfSetter(t)}),Object.defineProperty(e.prototype,"_key",{get:s.oneOfGetter(t=["key"]),set:s.oneOfSetter(t)}),e.encode=function(e,t){if(t||(t=o.create()),null!=e.from&&Object.hasOwnProperty.call(e,"from")&&t.uint32(10).bytes(e.from),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),null!=e.seqno&&Object.hasOwnProperty.call(e,"seqno")&&t.uint32(26).bytes(e.seqno),null!=e.topicIDs&&e.topicIDs.length)for(var r=0;r<e.topicIDs.length;++r)t.uint32(34).string(e.topicIDs[r]);return null!=e.signature&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(42).bytes(e.signature),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(50).bytes(e.key),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.RPC.Message;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.from=e.bytes();break;case 2:n.data=e.bytes();break;case 3:n.seqno=e.bytes();break;case 4:n.topicIDs&&n.topicIDs.length||(n.topicIDs=[]),n.topicIDs.push(e.string());break;case 5:n.signature=e.bytes();break;case 6:n.key=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.RPC.Message)return e;var t=new a.RPC.Message;if(null!=e.from&&("string"===typeof e.from?s.base64.decode(e.from,t.from=s.newBuffer(s.base64.length(e.from)),0):e.from.length&&(t.from=e.from)),null!=e.data&&("string"===typeof e.data?s.base64.decode(e.data,t.data=s.newBuffer(s.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),null!=e.seqno&&("string"===typeof e.seqno?s.base64.decode(e.seqno,t.seqno=s.newBuffer(s.base64.length(e.seqno)),0):e.seqno.length&&(t.seqno=e.seqno)),e.topicIDs){if(!Array.isArray(e.topicIDs))throw TypeError(".RPC.Message.topicIDs: array expected");t.topicIDs=[];for(var r=0;r<e.topicIDs.length;++r)t.topicIDs[r]=String(e.topicIDs[r])}return null!=e.signature&&("string"===typeof e.signature?s.base64.decode(e.signature,t.signature=s.newBuffer(s.base64.length(e.signature)),0):e.signature.length&&(t.signature=e.signature)),null!=e.key&&("string"===typeof e.key?s.base64.decode(e.key,t.key=s.newBuffer(s.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.topicIDs=[]),null!=e.from&&e.hasOwnProperty("from")&&(r.from=t.bytes===String?s.base64.encode(e.from,0,e.from.length):t.bytes===Array?Array.prototype.slice.call(e.from):e.from,t.oneofs&&(r._from="from")),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?s.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data,t.oneofs&&(r._data="data")),null!=e.seqno&&e.hasOwnProperty("seqno")&&(r.seqno=t.bytes===String?s.base64.encode(e.seqno,0,e.seqno.length):t.bytes===Array?Array.prototype.slice.call(e.seqno):e.seqno,t.oneofs&&(r._seqno="seqno")),e.topicIDs&&e.topicIDs.length){r.topicIDs=[];for(var n=0;n<e.topicIDs.length;++n)r.topicIDs[n]=e.topicIDs[n]}return null!=e.signature&&e.hasOwnProperty("signature")&&(r.signature=t.bytes===String?s.base64.encode(e.signature,0,e.signature.length):t.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,t.oneofs&&(r._signature="signature")),null!=e.key&&e.hasOwnProperty("key")&&(r.key=t.bytes===String?s.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key,t.oneofs&&(r._key="key")),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e.exports=a},29786:(e,t,r)=>{"use strict";const n=r(71234),{RPC:i}=r(6967),{concat:o}=r(41158),{fromString:s}=r(16406),a=s("libp2p-pubsub:"),{normalizeOutRpcMessage:u}=r(45305);async function c(e){if(!e.from)throw new Error("Could not get the public key from the originator id");const t=n.createFromB58String(e.from);if(e.key){const r=await n.createFromPubKey(e.key);if(r.equals(t))return r.pubKey;throw new Error("Public Key does not match the originator")}if(t.pubKey)return t.pubKey;throw new Error("Could not get the public key from the originator id")}e.exports={messagePublicKey:c,signMessage:async function(e,t){const r=o([a,i.Message.encode(u(t)).finish()]),n=await e.privKey.sign(r);return{...t,signature:n,key:e.pubKey.bytes}},SignPrefix:a,verifySignature:async function(e){if(!e.signature)throw new Error("Message must contain a signature to be verified");if(!e.from)throw new Error("Message must contain a from property to be verified");const t=o([a,i.Message.encode({...e,from:n.createFromB58String(e.from).toBytes(),signature:void 0,key:void 0}).finish()]);return(await c(e)).verify(t,e.signature)}}},91963:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p-pubsub:peer-streams"),{error:n("libp2p-pubsub:peer-streams:err")}),{EventEmitter:o}=r(2331),s=r(4666),a=r(89858),{pipe:u}=r(91522),{source:c}=r(1315),h=r(90834).default;e.exports=class extends o{constructor(e){let{id:t,protocol:r}=e;super(),this.id=t,this.protocol=r,this._rawOutboundStream=null,this._rawInboundStream=null,this._inboundAbortController=new h,this.outboundStream=null,this.inboundStream=null}get isReadable(){return Boolean(this.inboundStream)}get isWritable(){return Boolean(this.outboundStream)}write(e){if(!this.outboundStream){const e=this.id.toB58String();throw new Error("No writable connection to "+e)}this.outboundStream.push(e)}attachInboundStream(e){return this._rawInboundStream=e,this.inboundStream=c(u(this._rawInboundStream,s.decode()),this._inboundAbortController.signal,{returnOnAbort:!0}),this.emit("stream:inbound"),this.inboundStream}async attachOutboundStream(e){const t=this.outboundStream;this.outboundStream&&await this.outboundStream.end(),this._rawOutboundStream=e,this.outboundStream=a({onEnd:e=>{this._rawOutboundStream&&this._rawOutboundStream.reset&&this._rawOutboundStream.reset(),this._rawOutboundStream=null,this.outboundStream=null,e&&this.emit("close")}}),u(this.outboundStream,s.encode(),this._rawOutboundStream).catch((e=>{i.error(e)})),t||this.emit("stream:outbound")}close(){this.outboundStream&&this.outboundStream.end(),this.inboundStream&&this._inboundAbortController.abort(),this._rawOutboundStream=null,this.outboundStream=null,this._rawInboundStream=null,this.inboundStream=null,this.emit("close")}}},48496:(e,t)=>{"use strict";t.SignaturePolicy={StrictSign:"StrictSign",StrictNoSign:"StrictNoSign"}},45305:(e,t,r)=>{"use strict";const n=r(49203),{toString:i}=r(10157),{fromString:o}=r(16406),s=r(71234),{sha256:a}=r(27678);e.exports={randomSeqno:()=>n(8),msgId:(e,t)=>{let r;r=e instanceof Uint8Array?s.createFromBytes(e).id:s.parse(e).id;const n=new Uint8Array(r.length+t.length);return n.set(r,0),n.set(t,r.length),n},noSignMsgId:e=>a.encode(e),anyMatch:(e,t)=>{let r;r=Array.isArray(t)?e=>t.indexOf(e)>-1:e=>t.has(e);for(const n of e)if(r(n))return!0;return!1},ensureArray:e=>Array.isArray(e)?e:[e],normalizeInRpcMessage:(e,t)=>{const r=Object.assign({},e);return e.from instanceof Uint8Array&&(r.from=i(e.from,"base58btc")),t&&(r.receivedFrom=t),r},normalizeOutRpcMessage:e=>{const t=Object.assign({},e);return"string"===typeof e.from&&(t.from=o(e.from,"base58btc")),"string"===typeof e.data&&(t.data=o(e.data)),t}}},75295:e=>{"use strict";const t=()=>{},r=Symbol.for("@libp2p/js-interfaces/topology");class n{constructor(e){let{min:r=0,max:n=1/0,handlers:i={}}=e;this.min=r,this.max=n,this._onConnect=i.onConnect||t,this._onDisconnect=i.onDisconnect||t,this.peers=new Set}get[Symbol.toStringTag](){return"Topology"}get[r](){return!0}static isTopology(e){return Boolean(e&&e[r])}set registrar(e){this._registrar=e}disconnect(e){this._onDisconnect(e)}}e.exports=n},3251:(e,t,r)=>{"use strict";const n=r(75295),i=Symbol.for("@libp2p/js-interfaces/topology/multicodec-topology");class o extends n{constructor(e){let{min:t,max:r,multicodecs:n,handlers:i}=e;if(super({min:t,max:r,handlers:i}),!n)throw new Error("one or more multicodec should be provided");if(!i)throw new Error("the handlers should be provided");if("function"!==typeof i.onConnect)throw new Error("the 'onConnect' handler must be provided");if("function"!==typeof i.onDisconnect)throw new Error("the 'onDisconnect' handler must be provided");this.multicodecs=Array.isArray(n)?n:[n],this._registrar=void 0,this._onProtocolChange=this._onProtocolChange.bind(this),this._onPeerConnect=this._onPeerConnect.bind(this)}get[Symbol.toStringTag](){return"Topology"}get[i](){return!0}static isMulticodecTopology(e){return Boolean(e&&e[i])}set registrar(e){this._registrar=e,this._registrar.peerStore.on("change:protocols",this._onProtocolChange),this._registrar.connectionManager.on("peer:connect",this._onPeerConnect),this._updatePeers(this._registrar.peerStore.peers.values())}_updatePeers(e){for(const{id:t,protocols:r}of e)if(this.multicodecs.filter((e=>r.includes(e))).length){this.peers.add(t.toB58String());const e=this._registrar.getConnection(t);e&&this._onConnect(t,e)}else this.peers.delete(t.toB58String())}_onProtocolChange(e){let{peerId:t,protocols:r}=e;const n=this.peers.has(t.toB58String()),i=r.filter((e=>this.multicodecs.includes(e)));n&&0===i.length&&this._onDisconnect(t);for(const o of r)if(this.multicodecs.includes(o)){const e=this._registrar.peerStore.get(t);return void this._updatePeers([e])}}_onPeerConnect(e){const t=e.remotePeer,r=this._registrar.peerStore.protoBook.get(t);r&&this.multicodecs.find((e=>r.includes(e)))&&(this.peers.add(t.toB58String()),this._onConnect(t,e))}}e.exports=o},71234:(e,t,r)=>{"use strict";const{CID:n}=r(91759),i=r(36206),o=r(29936),s=r(59376),a=r(86443),{base58btc:u}=r(59376),{base32:c}=r(36206),{base16:h}=r(9092),l=r(27893),f=r(81735),d=r(93077),{PeerIdProto:p}=r(52461),{equals:y}=r(8552),{fromString:g}=r(16406),{toString:m}=r(10157),{identity:b}=r(4991),v={...i,...o,...s,...a},w=Object.keys(v).reduce(((e,t)=>e.or(v[t])),c.decoder);const _=d(class{constructor(e,t,r){if(!(e instanceof Uint8Array))throw new Error("invalid id provided");if(t&&r&&!y(t.public.bytes,r.bytes))throw new Error("inconsistent arguments");this._id=e,this._idB58String=u.encode(this.id).substring(1),this._privKey=t,this._pubKey=r}get id(){return this._id}set id(e){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(e){this._privKey=e}get pubKey(){if(this._pubKey)return this._pubKey;if(this._privKey)return this._privKey.public;try{const e=l.decode(this.id);e.code===b.code&&(this._pubKey=f.unmarshalPublicKey(e.digest))}catch(e){}return this._pubKey}set pubKey(e){this._pubKey=e}marshalPubKey(){if(this.pubKey)return f.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return f.marshalPrivateKey(this.privKey)}marshal(e){return p.encode({id:this.toBytes(),pubKey:this.marshalPubKey(),privKey:e?null:this.marshalPrivKey()}).finish()}toPrint(){let e=this.toB58String();e.startsWith("Qm")&&(e=e.slice(2));let t=6;return e.length<t&&(t=e.length),"<peer.ID "+e.substr(0,t)+">"}toJSON(){return{id:this.toB58String(),privKey:A(this.marshalPrivKey()),pubKey:A(this.marshalPubKey())}}toHexString(){return h.encode(this.id).substring(1)}toBytes(){return this.id}toB58String(){return this._idB58String}toString(){if(!this._idCIDString){const e=n.createV1(114,l.decode(this.id));Object.defineProperty(this,"_idCIDString",{value:e.toString(),enumerable:!1})}return this._idCIDString}equals(e){if(e instanceof Uint8Array)return y(this.id,e);if(e.id)return y(this.id,e.id);throw new Error("not valid Id")}isEqual(e){return this.equals(e)}isValid(){return Boolean(this.privKey&&this.privKey.public&&this.privKey.public.bytes&&this.pubKey.bytes instanceof Uint8Array&&y(this.privKey.public.bytes,this.pubKey.bytes))}hasInlinePublicKey(){try{if(l.decode(this.id).code===b.code)return!0}catch(e){}return!1}},{className:"PeerId",symbolName:"@libp2p/js-peer-id/PeerId"});t=e.exports=_;const E=e=>e.bytes.length<=42?l.create(b.code,e.bytes).bytes:e.hash(),S=async(e,t)=>{const r=await E(t);return new _(r,e,t)};t.create=async e=>{(e=e||{}).bits=e.bits||2048,e.keyType=e.keyType||"RSA";const t=await f.generateKeyPair(e.keyType,e.bits);return S(t,t.public)},t.createFromHexString=e=>new _(h.decode("f"+e)),t.createFromBytes=e=>{try{const r=n.decode(e);if(!M(r))throw new Error("Supplied PeerID CID is invalid");return t.createFromCID(r)}catch{if(l.decode(e).code!==b.code)throw new Error("Supplied PeerID CID is invalid");return new _(e)}},t.createFromB58String=e=>t.createFromBytes(u.decode("z"+e));const M=e=>114===e.code||112===e.code;function A(e){if(e)return m(e,"base64pad")}t.createFromCID=e=>{if(!(e=n.asCID(e))||!M(e))throw new Error("Supplied PeerID CID is invalid");return new _(e.multihash.bytes)},t.createFromPubKey=async e=>{let t=e;if("string"===typeof t&&(t=g(e,"base64pad")),!(t instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");const r=await f.unmarshalPublicKey(t);return S(void 0,r)},t.createFromPrivKey=async e=>{if("string"===typeof e&&(e=g(e,"base64pad")),!(e instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");const t=await f.unmarshalPrivateKey(e);return S(t,t.public)},t.createFromJSON=async e=>{const t=u.decode("z"+e.id),r=e.privKey&&g(e.privKey,"base64pad"),n=e.pubKey&&g(e.pubKey,"base64pad"),i=n&&await f.unmarshalPublicKey(n);if(!r)return new _(t,void 0,i);const o=await f.unmarshalPrivateKey(r),s=await E(o.public);let a;if(i&&(a=await E(i)),i&&!y(s,a))throw new Error("Public and private key do not match");if(t&&!y(s,t))throw new Error("Id and private key do not match");return new _(t,o,i)},t.createFromProtobuf=async e=>{"string"===typeof e&&(e=g(e,"base16"));let t,r,{id:n,privKey:i,pubKey:o}=p.decode(e);if(i=!!i&&await f.unmarshalPrivateKey(i),o=!!o&&await f.unmarshalPublicKey(o),i&&(r=await E(i.public)),o&&(t=await E(o)),i){if(o&&!y(r,t))throw new Error("Public and private key do not match");return new _(r,i,i.public)}if(o)return new _(t,void 0,o);if(n)return new _(n);throw new Error("Protobuf did not contain any usable key material")},t.parse=e=>("1"!==e.charAt(0)&&"Q"!==e.charAt(0)||(e="z".concat(e)),t.createFromBytes(w.decode(e))),t.isPeerId=e=>Boolean("object"===typeof e&&e._id&&e._idB58String)},52461:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-peer-id"]||(n.roots["libp2p-peer-id"]={});a.PeerIdProto=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.id=s.newBuffer([]),e.prototype.pubKey=s.newBuffer([]),e.prototype.privKey=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(10).bytes(e.id),null!=e.pubKey&&Object.hasOwnProperty.call(e,"pubKey")&&t.uint32(18).bytes(e.pubKey),null!=e.privKey&&Object.hasOwnProperty.call(e,"privKey")&&t.uint32(26).bytes(e.privKey),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PeerIdProto;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.pubKey=e.bytes();break;case 3:n.privKey=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("id"))throw s.ProtocolError("missing required 'id'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PeerIdProto)return e;var t=new a.PeerIdProto;return null!=e.id&&("string"===typeof e.id?s.base64.decode(e.id,t.id=s.newBuffer(s.base64.length(e.id)),0):e.id.length&&(t.id=e.id)),null!=e.pubKey&&("string"===typeof e.pubKey?s.base64.decode(e.pubKey,t.pubKey=s.newBuffer(s.base64.length(e.pubKey)),0):e.pubKey.length&&(t.pubKey=e.pubKey)),null!=e.privKey&&("string"===typeof e.privKey?s.base64.decode(e.privKey,t.privKey=s.newBuffer(s.base64.length(e.privKey)),0):e.privKey.length&&(t.privKey=e.privKey)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=s.newBuffer(r.id))),t.bytes===String?r.pubKey="":(r.pubKey=[],t.bytes!==Array&&(r.pubKey=s.newBuffer(r.pubKey))),t.bytes===String?r.privKey="":(r.privKey=[],t.bytes!==Array&&(r.privKey=s.newBuffer(r.privKey)))),null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?s.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.pubKey&&e.hasOwnProperty("pubKey")&&(r.pubKey=t.bytes===String?s.base64.encode(e.pubKey,0,e.pubKey.length):t.bytes===Array?Array.prototype.slice.call(e.pubKey):e.pubKey),null!=e.privKey&&e.hasOwnProperty("privKey")&&(r.privKey=t.bytes===String?s.base64.encode(e.privKey,0,e.privKey.length):t.bytes===Array?Array.prototype.slice.call(e.privKey):e.privKey),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},26192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERR_TOPIC_VALIDATOR_IGNORE=t.ERR_TOPIC_VALIDATOR_REJECT=t.TimeCacheDuration=t.GossipsubSeenTTL=t.GossipsubIWantFollowupTime=t.GossipsubMaxIHaveMessages=t.GossipsubMaxIHaveLength=t.GossipsubGraftFloodThreshold=t.GossipsubOpportunisticGraftPeers=t.GossipsubOpportunisticGraftTicks=t.GossipsubDirectConnectInitialDelay=t.GossipsubDirectConnectTicks=t.GossipsubConnectionTimeout=t.GossipsubMaxPendingConnections=t.GossipsubConnectors=t.GossipsubPruneBackoffTicks=t.GossipsubPruneBackoff=t.GossipsubPrunePeers=t.GossipsubFanoutTTL=t.GossipsubHeartbeatInterval=t.GossipsubHeartbeatInitialDelay=t.GossipsubGossipRetransmission=t.GossipsubGossipFactor=t.GossipsubDlazy=t.GossipsubHistoryGossip=t.GossipsubHistoryLength=t.GossipsubDout=t.GossipsubDscore=t.GossipsubDhi=t.GossipsubDlo=t.GossipsubD=t.GossipsubIDv11=t.GossipsubIDv10=t.FloodsubID=t.minute=t.second=void 0,t.second=1e3,t.minute=60*t.second,t.FloodsubID="/floodsub/1.0.0",t.GossipsubIDv10="/meshsub/1.0.0",t.GossipsubIDv11="/meshsub/1.1.0",t.GossipsubD=6,t.GossipsubDlo=4,t.GossipsubDhi=12,t.GossipsubDscore=4,t.GossipsubDout=2,t.GossipsubHistoryLength=5,t.GossipsubHistoryGossip=3,t.GossipsubDlazy=6,t.GossipsubGossipFactor=.25,t.GossipsubGossipRetransmission=3,t.GossipsubHeartbeatInitialDelay=100,t.GossipsubHeartbeatInterval=t.second,t.GossipsubFanoutTTL=t.minute,t.GossipsubPrunePeers=16,t.GossipsubPruneBackoff=t.minute,t.GossipsubPruneBackoffTicks=15,t.GossipsubConnectors=8,t.GossipsubMaxPendingConnections=128,t.GossipsubConnectionTimeout=30*t.second,t.GossipsubDirectConnectTicks=300,t.GossipsubDirectConnectInitialDelay=t.second,t.GossipsubOpportunisticGraftTicks=60,t.GossipsubOpportunisticGraftPeers=2,t.GossipsubGraftFloodThreshold=10*t.second,t.GossipsubMaxIHaveLength=5e3,t.GossipsubMaxIHaveMessages=10,t.GossipsubIWantFollowupTime=3*t.second,t.GossipsubSeenTTL=30*t.second,t.TimeCacheDuration=12e4,t.ERR_TOPIC_VALIDATOR_REJECT="ERR_TOPIC_VALIDATOR_REJECT",t.ERR_TOPIC_VALIDATOR_IGNORE="ERR_TOPIC_VALIDATOR_IGNORE"},57775:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGossipPeers=void 0;const n=r(56785);t.getGossipPeers=function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>!0;const o=e.topics.get(t);if(!o)return new Set;let s=[];return o.forEach((t=>{const r=e.peers.get(t);r&&n.hasGossipProtocol(r.protocol)&&i(t)&&s.push(t)})),s=n.shuffle(s),r>0&&s.length>r&&(s=s.slice(0,r)),new Set(s)}},87497:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Heartbeat=void 0;const s=o(r(26192)),a=r(57775),u=r(56785);t.Heartbeat=class{constructor(e){this.gossipsub=e}start(){if(this._heartbeatTimer)return;const e=this._heartbeat.bind(this),t=setTimeout((()=>{e(),this._heartbeatTimer.runPeriodically(e,this.gossipsub._options.heartbeatInterval)}),s.GossipsubHeartbeatInitialDelay);this._heartbeatTimer={_intervalId:void 0,runPeriodically:(e,t)=>{this._heartbeatTimer._intervalId=setInterval(e,t)},cancel:()=>{clearTimeout(t),clearInterval(this._heartbeatTimer._intervalId)}}}stop(){this._heartbeatTimer&&(this._heartbeatTimer.cancel(),this._heartbeatTimer=null)}_heartbeat(){const{D:e,Dlo:t,Dhi:r,Dscore:n,Dout:i,fanoutTTL:o}=this.gossipsub._options;this.gossipsub.heartbeatTicks++;const c=new Map,h=e=>{let t=c.get(e);return void 0===t&&(t=this.gossipsub.score.score(e),c.set(e,t)),t},l=new Map,f=new Map,d=new Map;this.gossipsub._clearBackoff(),this.gossipsub.peerhave.clear(),this.gossipsub.iasked.clear(),this.gossipsub._applyIwantPenalties(),this.gossipsub._directConnect(),this.gossipsub.mesh.forEach(((o,c)=>{const p=e=>{this.gossipsub.log("HEARTBEAT: Remove mesh link to %s in %s",e,c),this.gossipsub.score.prune(e,c),this.gossipsub._addBackoff(e,c),o.delete(e);const t=f.get(e);t?t.push(c):f.set(e,[c])},y=e=>{this.gossipsub.log("HEARTBEAT: Add mesh link to %s in %s",e,c),this.gossipsub.score.graft(e,c),o.add(e);const t=l.get(e);t?t.push(c):l.set(e,[c])};if(o.forEach((e=>{const t=h(e);t<0&&(this.gossipsub.log("HEARTBEAT: Prune peer %s with negative score: score=%d, topic=%s",e,t,c),p(e),d.set(e,!0))})),o.size<t){const t=this.gossipsub.backoff.get(c),r=e-o.size;a.getGossipPeers(this.gossipsub,c,r,(e=>!o.has(e)&&!this.gossipsub.direct.has(e)&&(!t||!t.has(e))&&h(e)>=0)).forEach(y)}if(o.size>r){let t=Array.from(o);t.sort(((e,t)=>h(t)-h(e))),t=t.slice(0,n).concat(u.shuffle(t.slice(n)));let r=0;if(t.slice(0,e).forEach((e=>{this.gossipsub.outbound.get(e)&&r++})),r<i){const n=e=>{const r=t[e];for(let n=e;n>0;n--)t[n]=t[n-1];t[0]=r};if(r>0){let i=r;for(let r=1;r<e&&i>0;r++)this.gossipsub.outbound.get(t[r])&&(n(r),i--)}let i=e-r;for(let r=e;r<t.length&&i>0;r++)this.gossipsub.outbound.get(t[r])&&(n(r),i--)}t.slice(e).forEach(p)}if(o.size>=t){let e=0;if(o.forEach((t=>{this.gossipsub.outbound.get(t)&&e++})),e<i){const t=i-e,r=this.gossipsub.backoff.get(c);a.getGossipPeers(this.gossipsub,c,t,(e=>!o.has(e)&&!this.gossipsub.direct.has(e)&&(!r||!r.has(e))&&h(e)>=0)).forEach(y)}}if(this.gossipsub.heartbeatTicks%s.GossipsubOpportunisticGraftTicks===0&&o.size>1){const e=Array.from(o).sort(((e,t)=>h(e)-h(t))),t=Math.floor(o.size/2),r=h(e[t]);if(r<this.gossipsub._options.scoreThresholds.opportunisticGraftThreshold){const e=this.gossipsub.backoff.get(c);a.getGossipPeers(this.gossipsub,c,s.GossipsubOpportunisticGraftPeers,(t=>o.has(t)&&!this.gossipsub.direct.has(t)&&(!e||!e.has(t))&&h(t)>r)).forEach((e=>{this.gossipsub.log("HEARTBEAT: Opportunistically graft peer %s on topic %s",e,c),y(e)}))}}this.gossipsub._emitGossip(c,o)}));const p=this.gossipsub._now();this.gossipsub.lastpub.forEach(((e,t)=>{e+o<p&&(this.gossipsub.fanout.delete(t),this.gossipsub.lastpub.delete(t))})),this.gossipsub.fanout.forEach(((t,r)=>{const n=this.gossipsub.topics.get(r);if(t.forEach((e=>{(!n.has(e)||h(e)<this.gossipsub._options.scoreThresholds.publishThreshold)&&t.delete(e)})),t.size<e){const n=e-t.size;a.getGossipPeers(this.gossipsub,r,n,(e=>!t.has(e)&&!this.gossipsub.direct.has(e)&&h(e)>=this.gossipsub._options.scoreThresholds.publishThreshold)).forEach((e=>{t.add(e)}))}this.gossipsub._emitGossip(r,t)})),this.gossipsub._sendGraftPrune(l,f,d),this.gossipsub._flush(),this.gossipsub.messageCache.shift(),this.gossipsub.emit("gossipsub:heartbeat")}}},38423:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};const a=o(r(76650)),u=r(72016),c=r(64603),h=o(r(26192)),l=r(87497),f=r(57775),d=r(56785),p=r(41391),y=r(23825),g=r(38976),m=r(71234),b=r(5503);class v extends a.default{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=[h.GossipsubIDv11,h.GossipsubIDv10],n=Object.assign(Object.assign({gossipIncoming:!0,fallbackToFloodsub:!0,floodPublish:!0,doPX:!1,directPeers:[],D:h.GossipsubD,Dlo:h.GossipsubDlo,Dhi:h.GossipsubDhi,Dscore:h.GossipsubDscore,Dout:h.GossipsubDout,Dlazy:h.GossipsubDlazy,heartbeatInterval:h.GossipsubHeartbeatInterval,fanoutTTL:h.GossipsubFanoutTTL,mcacheLength:h.GossipsubHistoryLength,mcacheGossip:h.GossipsubHistoryGossip,seenTTL:h.GossipsubSeenTTL},t),{scoreParams:p.createPeerScoreParams(t.scoreParams),scoreThresholds:p.createPeerScoreThresholds(t.scoreThresholds)});n.fallbackToFloodsub&&r.push(h.FloodsubID),super(Object.assign({debugName:"libp2p:gossipsub",multicodecs:r,libp2p:e},n)),this._options=n,this.direct=new Set(n.directPeers.map((e=>e.id.toB58String()))),n.directPeers.forEach((t=>{e.peerStore.addressBook.add(t.id,t.addrs)})),this.seenCache=new g({validity:n.seenTTL/1e3}),this.mesh=new Map,this.fanout=new Map,this.lastpub=new Map,this.gossip=new Map,this.control=new Map,this.peerhave=new Map,this.iasked=new Map,this.backoff=new Map,this.outbound=new Map,this.messageCache=t.messageCache||new u.MessageCache(n.mcacheGossip,n.mcacheLength,this.getMsgId.bind(this)),this.heartbeat=new l.Heartbeat(this),this.heartbeatTicks=0,this.gossipTracer=new y.IWantTracer(this.getMsgId.bind(this)),this._libp2p=e,this.score=new p.PeerScore(this._options.scoreParams,e.connectionManager,this.getMsgId.bind(this))}_decodeRpc(e){return c.RPC.decode(e)}_encodeRpc(e){return c.RPC.encode(e).finish()}_addPeer(e,t){const r=super._addPeer(e,t);this.score.addPeer(e.toB58String());let n=!1;for(const i of this._libp2p.connectionManager.getAll(e))if("outbound"===i.stat.direction&&Array.from(i.registry.values()).some((e=>t===e.protocol))){n=!0;break}return this.outbound.set(r.id.toB58String(),n),r}_removePeer(e){const t=super._removePeer(e),r=e.toB58String();for(const n of this.mesh.values())n.delete(r);for(const n of this.fanout.values())n.delete(r);return this.gossip.delete(r),this.control.delete(r),this.outbound.delete(r),this.score.removePeer(r),t}_processRpc(e,t,r){const n=Object.create(null,{_processRpc:{get:()=>super._processRpc}});return s(this,void 0,void 0,(function*(){return!!(yield n._processRpc.call(this,e,t,r))&&(r.control&&this._processRpcControlMessage(e,r.control),!0)}))}_processRpcControlMessage(e,t){if(!t)return;const r=t.ihave?this._handleIHave(e,t.ihave):[],n=t.iwant?this._handleIWant(e,t.iwant):[],i=t.graft?this._handleGraft(e,t.graft):[];if(t.prune&&this._handlePrune(e,t.prune),!r.length&&!n.length&&!i.length)return;const o=d.createGossipRpc(n,{iwant:r,prune:i});this._sendRpc(e,o)}_processRpcMessage(e){const t=Object.create(null,{_processRpcMessage:{get:()=>super._processRpcMessage}});return s(this,void 0,void 0,(function*(){const r=yield this.getMsgId(e),n=d.messageIdToString(r);this.seenCache.has(n)?this.score.duplicateMessage(e):(this.seenCache.put(n),yield this.score.validateMessage(e),yield t._processRpcMessage.call(this,e))}))}_acceptFrom(e){return this.direct.has(e)||this.score.score(e)>=this._options.scoreThresholds.graylistThreshold}validate(e){const t=Object.create(null,{validate:{get:()=>super.validate}});return s(this,void 0,void 0,(function*(){try{yield t.validate.call(this,e)}catch(r){throw this.score.rejectMessage(e,r.code),this.gossipTracer.rejectMessage(e,r.code),r}}))}_handleIHave(e,t){if(!t.length)return[];const r=this.score.score(e);if(r<this._options.scoreThresholds.gossipThreshold)return this.log("IHAVE: ignoring peer %s with score below threshold [ score = %d ]",e,r),[];const n=(this.peerhave.get(e)||0)+1;if(this.peerhave.set(e,n),n>h.GossipsubMaxIHaveMessages)return this.log("IHAVE: peer %s has advertised too many times (%d) within this heartbeat interval; ignoring",e,n),[];const i=this.iasked.get(e)||0;if(i>=h.GossipsubMaxIHaveLength)return this.log("IHAVE: peer %s has already advertised too many messages (%d); ignoring",e,i),[];const o=new Map;if(t.forEach((e=>{let{topicID:t,messageIDs:r}=e;t&&r&&this.mesh.has(t)&&r.forEach((e=>{const t=d.messageIdToString(e);this.seenCache.has(t)||o.set(t,e)}))})),!o.size)return[];let s=o.size;s+i>h.GossipsubMaxIHaveLength&&(s=h.GossipsubMaxIHaveLength-i),this.log("IHAVE: Asking for %d out of %d messages from %s",s,o.size,e);let a=Array.from(o.values());return d.shuffle(a),a=a.slice(0,s),this.iasked.set(e,i+s),this.gossipTracer.addPromise(e,a),[{messageIDs:a}]}_handleIWant(e,t){if(!t.length)return[];const r=this.score.score(e);if(r<this._options.scoreThresholds.gossipThreshold)return this.log("IWANT: ignoring peer %s with score below threshold [score = %d]",e,r),[];const n=new Map;return t.forEach((t=>{let{messageIDs:r}=t;r&&r.forEach((t=>{const[r,i]=this.messageCache.getForPeer(t,e);r&&(i>h.GossipsubGossipRetransmission?this.log("IWANT: Peer %s has asked for message %s too many times: ignoring request",e,t):n.set(d.messageIdToString(t),r))}))})),n.size?(this.log("IWANT: Sending %d messages to %s",n.size,e),Array.from(n.values()).map(a.utils.normalizeOutRpcMessage)):[]}_handleGraft(e,t){const r=[],n=this.score.score(e),i=this._now();let o=this._options.doPX;return t.forEach((t=>{let{topicID:s}=t;var a;if(!s)return;const u=this.mesh.get(s);if(!u)return void(o=!1);if(u.has(e))return;if(this.direct.has(e))return this.log("GRAFT: ignoring request from direct peer %s",e),r.push(s),void(o=!1);const c=null===(a=this.backoff.get(s))||void 0===a?void 0:a.get(e);if("number"===typeof c&&i<c){this.log("GRAFT: ignoring backed off peer %s",e),this.score.addPenalty(e,1),o=!1;const t=c+h.GossipsubGraftFloodThreshold-h.GossipsubPruneBackoff;return i<t&&this.score.addPenalty(e,1),this._addBackoff(e,s),void r.push(s)}return n<0?(this.log("GRAFT: ignoring peer %s with negative score: score=%d, topic=%s",e,n,s),r.push(s),o=!1,void this._addBackoff(e,s)):u.size>=this._options.Dhi&&!this.outbound.get(e)?(r.push(s),void this._addBackoff(e,s)):(this.log("GRAFT: Add mesh link from %s in %s",e,s),this.score.graft(e,s),void u.add(e))})),r.length?r.map((t=>this._makePrune(e,t,o))):[]}_handlePrune(e,t){const r=this.score.score(e);t.forEach((t=>{let{topicID:n,backoff:i,peers:o}=t;if(!n)return;const s=this.mesh.get(n);if(s&&(this.log("PRUNE: Remove mesh link to %s in %s",e,n),this.score.prune(e,n),s.delete(e),"number"===typeof i&&i>0?this._doAddBackoff(e,n,1e3*i):this._addBackoff(e,n),o&&o.length)){if(r<this._options.scoreThresholds.acceptPXThreshold)return void this.log("PRUNE: ignoring PX from peer %s with insufficient score [score = %d, topic = %s]",e,r,n);this._pxConnect(o)}}))}_addBackoff(e,t){this._doAddBackoff(e,t,h.GossipsubPruneBackoff)}_doAddBackoff(e,t,r){let n=this.backoff.get(t);n||(n=new Map,this.backoff.set(t,n));const i=this._now()+r;(n.get(e)||0)<i&&n.set(e,i)}_applyIwantPenalties(){this.gossipTracer.getBrokenPromises().forEach(((e,t)=>{this.log("peer %s didn't follow up in %d IWANT requests; adding penalty",t,e),this.score.addPenalty(t,e)}))}_clearBackoff(){if(this.heartbeatTicks%h.GossipsubPruneBackoffTicks!==0)return;const e=this._now();this.backoff.forEach(((t,r)=>{t.forEach(((r,n)=>{r<e&&t.delete(n)})),0===t.size&&this.backoff.delete(r)}))}_directConnect(){if(this.heartbeatTicks%h.GossipsubDirectConnectTicks!==0)return;const e=[];this.direct.forEach((t=>{const r=this.peers.get(t);r&&r.isWritable||e.push(t)})),e.length&&e.forEach((e=>{this._connect(e)}))}_pxConnect(e){return s(this,void 0,void 0,(function*(){e.length>h.GossipsubPrunePeers&&(d.shuffle(e),e=e.slice(0,h.GossipsubPrunePeers));const t=[];yield Promise.all(e.map((e=>s(this,void 0,void 0,(function*(){if(!e.peerID)return;const r=m.createFromBytes(e.peerID).toB58String();if(!this.peers.has(r))if(e.signedPeerRecord)try{const n=yield b.openAndCertify(e.signedPeerRecord,"libp2p-peer-record"),i=n.peerId.toB58String();if(r!==i)return void this.log("bogus peer record obtained through px: peer ID %s doesn't match expected peer %s",i,r);if(!this._libp2p.peerStore.addressBook.consumePeerRecord(n))return void this.log("bogus peer record obtained through px: could not add peer record to address book");t.push(r)}catch(n){this.log("bogus peer record obtained through px: invalid signature or not a peer record")}else t.push(r)}))))),t.length&&t.forEach((e=>this._connect(e)))}))}start(){super.start(),this.heartbeat.start(),this.score.start(),this._directPeerInitial=setTimeout((()=>{this.direct.forEach((e=>{this._connect(e)}))}),h.GossipsubDirectConnectInitialDelay)}stop(){super.stop(),this.heartbeat.stop(),this.score.stop(),this.mesh=new Map,this.fanout=new Map,this.lastpub=new Map,this.gossip=new Map,this.control=new Map,this.peerhave=new Map,this.iasked=new Map,this.backoff=new Map,this.outbound=new Map,this.gossipTracer.clear(),clearTimeout(this._directPeerInitial)}_connect(e){this.log("Initiating connection with %s",e),this._libp2p.dialProtocol(m.createFromB58String(e),this.multicodecs)}subscribe(e){super.subscribe(e),this.join(e)}unsubscribe(e){super.unsubscribe(e),this.leave(e)}join(e){if(!this.started)throw new Error("Gossipsub has not started");this.log("JOIN %s",e);const t=this.fanout.get(e);if(t)t.forEach((e=>{this.score.score(e)<0&&t.delete(e)})),t.size<this._options.D&&f.getGossipPeers(this,e,this._options.D-t.size,(e=>!t.has(e)&&!this.direct.has(e)&&this.score.score(e)>=0)).forEach((e=>t.add(e))),this.mesh.set(e,t),this.fanout.delete(e),this.lastpub.delete(e);else{const t=f.getGossipPeers(this,e,this._options.D,(e=>!this.direct.has(e)&&this.score.score(e)>=0));this.mesh.set(e,t)}this.mesh.get(e).forEach((t=>{this.log("JOIN: Add mesh link to %s in %s",t,e),this._sendGraft(t,e)}))}leave(e){if(!this.started)throw new Error("Gossipsub has not started");this.log("LEAVE %s",e);const t=this.mesh.get(e);t&&(t.forEach((t=>{this.log("LEAVE: Remove mesh link to %s in %s",t,e),this._sendPrune(t,e)})),this.mesh.delete(e))}_publish(e){return s(this,void 0,void 0,(function*(){e.receivedFrom!==this.peerId.toB58String()&&(this.score.deliverMessage(e),this.gossipTracer.deliverMessage(e));const t=yield this.getMsgId(e),r=d.messageIdToString(t);this.seenCache.put(r),this.messageCache.put(e);const n=new Set;e.topicIDs.forEach((t=>{const r=this.topics.get(t);if(r)if(this._options.floodPublish&&e.from===this.peerId.toB58String())r.forEach((e=>{(this.direct.has(e)||this.score.score(e)>=this._options.scoreThresholds.publishThreshold)&&n.add(e)}));else{this.direct.forEach((e=>{n.add(e)})),r.forEach((e=>{const t=this.score.score(e),r=this.peers.get(e);r&&r.protocol===h.FloodsubID&&t>=this._options.scoreThresholds.publishThreshold&&n.add(e)}));let e=this.mesh.get(t);if(!e||!e.size){if(e=this.fanout.get(t),!e){const r=f.getGossipPeers(this,t,this._options.D,(e=>this.score.score(e)>=this._options.scoreThresholds.publishThreshold));r.size>0?(e=r,this.fanout.set(t,r)):e=new Set}this.lastpub.set(t,this._now())}e.forEach((e=>{n.add(e)}))}}));const i=d.createGossipRpc([a.utils.normalizeOutRpcMessage(e)]);n.forEach((t=>{t!==e.from&&this._sendRpc(t,i)}))}))}_sendGraft(e,t){const r=[{topicID:t}],n=d.createGossipRpc([],{graft:r});this._sendRpc(e,n)}_sendPrune(e,t){const r=[this._makePrune(e,t,this._options.doPX)],n=d.createGossipRpc([],{prune:r});this._sendRpc(e,n)}_sendRpc(e,t){const r=this.peers.get(e);if(!r||!r.isWritable)return;const n=this.control.get(e);n&&(this._piggybackControl(e,t,n),this.control.delete(e));const i=this.gossip.get(e);i&&(this._piggybackGossip(e,t,i),this.gossip.delete(e)),r.write(c.RPC.encode(t).finish())}_piggybackControl(e,t,r){const n=(r.graft||[]).filter((t=>{let{topicID:r}=t;return(r&&this.mesh.get(r)||new Set).has(e)})),i=(r.prune||[]).filter((t=>{let{topicID:r}=t;return!(r&&this.mesh.get(r)||new Set).has(e)}));(n.length||i.length)&&(t.control?(t.control.graft=t.control.graft&&t.control.graft.concat(n),t.control.prune=t.control.prune&&t.control.prune.concat(i)):t.control={ihave:[],iwant:[],graft:n,prune:i})}_piggybackGossip(e,t,r){t.control||(t.control={ihave:[],iwant:[],graft:[],prune:[]}),t.control.ihave=r}_sendGraftPrune(e,t,r){const n=this._options.doPX;for(const[i,o]of e){const e=o.map((e=>({topicID:e})));let s=[];const a=t.get(i);a&&(s=a.map((e=>this._makePrune(i,e,n&&!r.get(i)))),t.delete(i));const u=d.createGossipRpc([],{graft:e,prune:s});this._sendRpc(i,u)}for(const[i,o]of t){const e=o.map((e=>this._makePrune(i,e,n&&!r.get(i)))),t=d.createGossipRpc([],{prune:e});this._sendRpc(i,t)}}_emitGossip(e,t){const r=this.messageCache.getGossipIDs(e);if(!r.length)return;d.shuffle(r),r.length>h.GossipsubMaxIHaveLength&&this.log("too many messages for gossip; will truncate IHAVE list (%d messages)",r.length);const n=[],i=this.topics.get(e);if(!i)return;i.forEach((e=>{const r=this.peers.get(e);r&&!t.has(e)&&!this.direct.has(e)&&d.hasGossipProtocol(r.protocol)&&this.score.score(e)>=this._options.scoreThresholds.gossipThreshold&&n.push(e)}));let o=this._options.Dlazy;const s=h.GossipsubGossipFactor*n.length;s>o&&(o=s),o>n.length?o=n.length:d.shuffle(n),n.slice(0,o).forEach((t=>{let n=r;r.length>h.GossipsubMaxIHaveLength&&(n=d.shuffle(n.slice()).slice(0,h.GossipsubMaxIHaveLength)),this._pushGossip(t,{topicID:e,messageIDs:n})}))}_flush(){for(const[e,t]of this.gossip.entries()){this.gossip.delete(e);const r=d.createGossipRpc([],{ihave:t});this._sendRpc(e,r)}for(const[e,t]of this.control.entries()){this.control.delete(e);const r=d.createGossipRpc([],{graft:t.graft,prune:t.prune});this._sendRpc(e,r)}}_pushGossip(e,t){this.log("Add gossip to %s",e);const r=this.gossip.get(e)||[];this.gossip.set(e,r.concat(t))}_now(){return Date.now()}_makePrune(e,t,r){if(this.peers.get(e).protocol===h.GossipsubIDv10)return{topicID:t,peers:[]};const n=h.GossipsubPruneBackoff/1e3,i=[];if(r){f.getGossipPeers(this,t,h.GossipsubPrunePeers,(t=>t!==e&&this.score.score(t)>=0)).forEach((e=>{const t=m.createFromB58String(e);i.push({peerID:t.toBytes(),signedPeerRecord:this._libp2p.peerStore.addressBook.getRawEnvelope(t)})}))}return{topicID:t,peers:i,backoff:n}}}v.multicodec=h.GossipsubIDv11,e.exports=v},72016:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageCache=void 0;const i=r(56785);t.MessageCache=class{constructor(e,t,r){this.msgs=new Map,this.peertx=new Map,this.history=[];for(let n=0;n<t;n++)this.history[n]=[];this.gossip=e,this.msgIdFn=r}put(e){return n(this,void 0,void 0,(function*(){const t=yield this.getMsgId(e),r=i.messageIdToString(t);this.msgs.set(r,e),this.history[0].push({msgID:t,topics:e.topicIDs})}))}getMsgId(e){return this.msgIdFn(e)}get(e){return this.msgs.get(i.messageIdToString(e))}getForPeer(e,t){const r=i.messageIdToString(e),n=this.msgs.get(r);if(!n)return[void 0,0];let o=this.peertx.get(r);o||(o=new Map,this.peertx.set(r,o));const s=(o.get(t)||0)+1;return o.set(t,s),[n,s]}getGossipIDs(e){const t=[];for(let r=0;r<this.gossip;r++)this.history[r].forEach((r=>{for(const n of r.topics)if(n===e){t.push(r.msgID);break}}));return t}shift(){this.history[this.history.length-1].forEach((e=>{const t=i.messageIdToString(e.msgID);this.msgs.delete(t),this.peertx.delete(t)})),this.history.pop(),this.history.unshift([])}}},64603:function(e,t,r){var n,i,o;i=[r(6018)],void 0===(o="function"===typeof(n=function(e){"use strict";var t=e.Reader,r=e.Writer,n=e.util,i=e.roots.default||(e.roots.default={});return i.RPC=function(){function o(e){if(this.subscriptions=[],this.msgs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var s;return o.prototype.subscriptions=n.emptyArray,o.prototype.msgs=n.emptyArray,o.prototype.control=null,Object.defineProperty(o.prototype,"_control",{get:n.oneOfGetter(s=["control"]),set:n.oneOfSetter(s)}),o.encode=function(e,t){if(t||(t=r.create()),null!=e.subscriptions&&e.subscriptions.length)for(var n=0;n<e.subscriptions.length;++n)i.RPC.SubOpts.encode(e.subscriptions[n],t.uint32(10).fork()).ldelim();if(null!=e.msgs&&e.msgs.length)for(n=0;n<e.msgs.length;++n)i.RPC.Message.encode(e.msgs[n],t.uint32(18).fork()).ldelim();return null!=e.control&&Object.hasOwnProperty.call(e,"control")&&i.RPC.ControlMessage.encode(e.control,t.uint32(26).fork()).ldelim(),t},o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var n=void 0===r?e.len:e.pos+r,o=new i.RPC;e.pos<n;){var s=e.uint32();switch(s>>>3){case 1:o.subscriptions&&o.subscriptions.length||(o.subscriptions=[]),o.subscriptions.push(i.RPC.SubOpts.decode(e,e.uint32()));break;case 2:o.msgs&&o.msgs.length||(o.msgs=[]),o.msgs.push(i.RPC.Message.decode(e,e.uint32()));break;case 3:o.control=i.RPC.ControlMessage.decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.fromObject=function(e){if(e instanceof i.RPC)return e;var t=new i.RPC;if(e.subscriptions){if(!Array.isArray(e.subscriptions))throw TypeError(".RPC.subscriptions: array expected");t.subscriptions=[];for(var r=0;r<e.subscriptions.length;++r){if("object"!==typeof e.subscriptions[r])throw TypeError(".RPC.subscriptions: object expected");t.subscriptions[r]=i.RPC.SubOpts.fromObject(e.subscriptions[r])}}if(e.msgs){if(!Array.isArray(e.msgs))throw TypeError(".RPC.msgs: array expected");for(t.msgs=[],r=0;r<e.msgs.length;++r){if("object"!==typeof e.msgs[r])throw TypeError(".RPC.msgs: object expected");t.msgs[r]=i.RPC.Message.fromObject(e.msgs[r])}}if(null!=e.control){if("object"!==typeof e.control)throw TypeError(".RPC.control: object expected");t.control=i.RPC.ControlMessage.fromObject(e.control)}return t},o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.subscriptions=[],r.msgs=[]),e.subscriptions&&e.subscriptions.length){r.subscriptions=[];for(var n=0;n<e.subscriptions.length;++n)r.subscriptions[n]=i.RPC.SubOpts.toObject(e.subscriptions[n],t)}if(e.msgs&&e.msgs.length)for(r.msgs=[],n=0;n<e.msgs.length;++n)r.msgs[n]=i.RPC.Message.toObject(e.msgs[n],t);return null!=e.control&&e.hasOwnProperty("control")&&(r.control=i.RPC.ControlMessage.toObject(e.control,t),t.oneofs&&(r._control="control")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.SubOpts=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var s;return o.prototype.subscribe=null,o.prototype.topicID=null,Object.defineProperty(o.prototype,"_subscribe",{get:n.oneOfGetter(s=["subscribe"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_topicID",{get:n.oneOfGetter(s=["topicID"]),set:n.oneOfSetter(s)}),o.encode=function(e,t){return t||(t=r.create()),null!=e.subscribe&&Object.hasOwnProperty.call(e,"subscribe")&&t.uint32(8).bool(e.subscribe),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&t.uint32(18).string(e.topicID),t},o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var n=void 0===r?e.len:e.pos+r,o=new i.RPC.SubOpts;e.pos<n;){var s=e.uint32();switch(s>>>3){case 1:o.subscribe=e.bool();break;case 2:o.topicID=e.string();break;default:e.skipType(7&s)}}return o},o.fromObject=function(e){if(e instanceof i.RPC.SubOpts)return e;var t=new i.RPC.SubOpts;return null!=e.subscribe&&(t.subscribe=Boolean(e.subscribe)),null!=e.topicID&&(t.topicID=String(e.topicID)),t},o.toObject=function(e,t){t||(t={});var r={};return null!=e.subscribe&&e.hasOwnProperty("subscribe")&&(r.subscribe=e.subscribe,t.oneofs&&(r._subscribe="subscribe")),null!=e.topicID&&e.hasOwnProperty("topicID")&&(r.topicID=e.topicID,t.oneofs&&(r._topicID="topicID")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.Message=function(){function o(e){if(this.topicIDs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var s;return o.prototype.from=null,o.prototype.data=null,o.prototype.seqno=null,o.prototype.topicIDs=n.emptyArray,o.prototype.signature=null,o.prototype.key=null,Object.defineProperty(o.prototype,"_from",{get:n.oneOfGetter(s=["from"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_data",{get:n.oneOfGetter(s=["data"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_seqno",{get:n.oneOfGetter(s=["seqno"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_signature",{get:n.oneOfGetter(s=["signature"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_key",{get:n.oneOfGetter(s=["key"]),set:n.oneOfSetter(s)}),o.encode=function(e,t){if(t||(t=r.create()),null!=e.from&&Object.hasOwnProperty.call(e,"from")&&t.uint32(10).bytes(e.from),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),null!=e.seqno&&Object.hasOwnProperty.call(e,"seqno")&&t.uint32(26).bytes(e.seqno),null!=e.topicIDs&&e.topicIDs.length)for(var n=0;n<e.topicIDs.length;++n)t.uint32(34).string(e.topicIDs[n]);return null!=e.signature&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(42).bytes(e.signature),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(50).bytes(e.key),t},o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var n=void 0===r?e.len:e.pos+r,o=new i.RPC.Message;e.pos<n;){var s=e.uint32();switch(s>>>3){case 1:o.from=e.bytes();break;case 2:o.data=e.bytes();break;case 3:o.seqno=e.bytes();break;case 4:o.topicIDs&&o.topicIDs.length||(o.topicIDs=[]),o.topicIDs.push(e.string());break;case 5:o.signature=e.bytes();break;case 6:o.key=e.bytes();break;default:e.skipType(7&s)}}return o},o.fromObject=function(e){if(e instanceof i.RPC.Message)return e;var t=new i.RPC.Message;if(null!=e.from&&("string"===typeof e.from?n.base64.decode(e.from,t.from=n.newBuffer(n.base64.length(e.from)),0):e.from.length&&(t.from=e.from)),null!=e.data&&("string"===typeof e.data?n.base64.decode(e.data,t.data=n.newBuffer(n.base64.length(e.data)),0):e.data.length&&(t.data=e.data)),null!=e.seqno&&("string"===typeof e.seqno?n.base64.decode(e.seqno,t.seqno=n.newBuffer(n.base64.length(e.seqno)),0):e.seqno.length&&(t.seqno=e.seqno)),e.topicIDs){if(!Array.isArray(e.topicIDs))throw TypeError(".RPC.Message.topicIDs: array expected");t.topicIDs=[];for(var r=0;r<e.topicIDs.length;++r)t.topicIDs[r]=String(e.topicIDs[r])}return null!=e.signature&&("string"===typeof e.signature?n.base64.decode(e.signature,t.signature=n.newBuffer(n.base64.length(e.signature)),0):e.signature.length&&(t.signature=e.signature)),null!=e.key&&("string"===typeof e.key?n.base64.decode(e.key,t.key=n.newBuffer(n.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),t},o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.topicIDs=[]),null!=e.from&&e.hasOwnProperty("from")&&(r.from=t.bytes===String?n.base64.encode(e.from,0,e.from.length):t.bytes===Array?Array.prototype.slice.call(e.from):e.from,t.oneofs&&(r._from="from")),null!=e.data&&e.hasOwnProperty("data")&&(r.data=t.bytes===String?n.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data,t.oneofs&&(r._data="data")),null!=e.seqno&&e.hasOwnProperty("seqno")&&(r.seqno=t.bytes===String?n.base64.encode(e.seqno,0,e.seqno.length):t.bytes===Array?Array.prototype.slice.call(e.seqno):e.seqno,t.oneofs&&(r._seqno="seqno")),e.topicIDs&&e.topicIDs.length){r.topicIDs=[];for(var i=0;i<e.topicIDs.length;++i)r.topicIDs[i]=e.topicIDs[i]}return null!=e.signature&&e.hasOwnProperty("signature")&&(r.signature=t.bytes===String?n.base64.encode(e.signature,0,e.signature.length):t.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,t.oneofs&&(r._signature="signature")),null!=e.key&&e.hasOwnProperty("key")&&(r.key=t.bytes===String?n.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key,t.oneofs&&(r._key="key")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.ControlMessage=function(){function o(e){if(this.ihave=[],this.iwant=[],this.graft=[],this.prune=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return o.prototype.ihave=n.emptyArray,o.prototype.iwant=n.emptyArray,o.prototype.graft=n.emptyArray,o.prototype.prune=n.emptyArray,o.encode=function(e,t){if(t||(t=r.create()),null!=e.ihave&&e.ihave.length)for(var n=0;n<e.ihave.length;++n)i.RPC.ControlIHave.encode(e.ihave[n],t.uint32(10).fork()).ldelim();if(null!=e.iwant&&e.iwant.length)for(n=0;n<e.iwant.length;++n)i.RPC.ControlIWant.encode(e.iwant[n],t.uint32(18).fork()).ldelim();if(null!=e.graft&&e.graft.length)for(n=0;n<e.graft.length;++n)i.RPC.ControlGraft.encode(e.graft[n],t.uint32(26).fork()).ldelim();if(null!=e.prune&&e.prune.length)for(n=0;n<e.prune.length;++n)i.RPC.ControlPrune.encode(e.prune[n],t.uint32(34).fork()).ldelim();return t},o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var n=void 0===r?e.len:e.pos+r,o=new i.RPC.ControlMessage;e.pos<n;){var s=e.uint32();switch(s>>>3){case 1:o.ihave&&o.ihave.length||(o.ihave=[]),o.ihave.push(i.RPC.ControlIHave.decode(e,e.uint32()));break;case 2:o.iwant&&o.iwant.length||(o.iwant=[]),o.iwant.push(i.RPC.ControlIWant.decode(e,e.uint32()));break;case 3:o.graft&&o.graft.length||(o.graft=[]),o.graft.push(i.RPC.ControlGraft.decode(e,e.uint32()));break;case 4:o.prune&&o.prune.length||(o.prune=[]),o.prune.push(i.RPC.ControlPrune.decode(e,e.uint32()));break;default:e.skipType(7&s)}}return o},o.fromObject=function(e){if(e instanceof i.RPC.ControlMessage)return e;var t=new i.RPC.ControlMessage;if(e.ihave){if(!Array.isArray(e.ihave))throw TypeError(".RPC.ControlMessage.ihave: array expected");t.ihave=[];for(var r=0;r<e.ihave.length;++r){if("object"!==typeof e.ihave[r])throw TypeError(".RPC.ControlMessage.ihave: object expected");t.ihave[r]=i.RPC.ControlIHave.fromObject(e.ihave[r])}}if(e.iwant){if(!Array.isArray(e.iwant))throw TypeError(".RPC.ControlMessage.iwant: array expected");for(t.iwant=[],r=0;r<e.iwant.length;++r){if("object"!==typeof e.iwant[r])throw TypeError(".RPC.ControlMessage.iwant: object expected");t.iwant[r]=i.RPC.ControlIWant.fromObject(e.iwant[r])}}if(e.graft){if(!Array.isArray(e.graft))throw TypeError(".RPC.ControlMessage.graft: array expected");for(t.graft=[],r=0;r<e.graft.length;++r){if("object"!==typeof e.graft[r])throw TypeError(".RPC.ControlMessage.graft: object expected");t.graft[r]=i.RPC.ControlGraft.fromObject(e.graft[r])}}if(e.prune){if(!Array.isArray(e.prune))throw TypeError(".RPC.ControlMessage.prune: array expected");for(t.prune=[],r=0;r<e.prune.length;++r){if("object"!==typeof e.prune[r])throw TypeError(".RPC.ControlMessage.prune: object expected");t.prune[r]=i.RPC.ControlPrune.fromObject(e.prune[r])}}return t},o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.ihave=[],r.iwant=[],r.graft=[],r.prune=[]),e.ihave&&e.ihave.length){r.ihave=[];for(var n=0;n<e.ihave.length;++n)r.ihave[n]=i.RPC.ControlIHave.toObject(e.ihave[n],t)}if(e.iwant&&e.iwant.length)for(r.iwant=[],n=0;n<e.iwant.length;++n)r.iwant[n]=i.RPC.ControlIWant.toObject(e.iwant[n],t);if(e.graft&&e.graft.length)for(r.graft=[],n=0;n<e.graft.length;++n)r.graft[n]=i.RPC.ControlGraft.toObject(e.graft[n],t);if(e.prune&&e.prune.length)for(r.prune=[],n=0;n<e.prune.length;++n)r.prune[n]=i.RPC.ControlPrune.toObject(e.prune[n],t);return r},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.ControlIHave=function(){function o(e){if(this.messageIDs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var s;return o.prototype.topicID=null,o.prototype.messageIDs=n.emptyArray,Object.defineProperty(o.prototype,"_topicID",{get:n.oneOfGetter(s=["topicID"]),set:n.oneOfSetter(s)}),o.encode=function(e,t){if(t||(t=r.create()),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&t.uint32(10).string(e.topicID),null!=e.messageIDs&&e.messageIDs.length)for(var n=0;n<e.messageIDs.length;++n)t.uint32(18).bytes(e.messageIDs[n]);return t},o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var n=void 0===r?e.len:e.pos+r,o=new i.RPC.ControlIHave;e.pos<n;){var s=e.uint32();switch(s>>>3){case 1:o.topicID=e.string();break;case 2:o.messageIDs&&o.messageIDs.length||(o.messageIDs=[]),o.messageIDs.push(e.bytes());break;default:e.skipType(7&s)}}return o},o.fromObject=function(e){if(e instanceof i.RPC.ControlIHave)return e;var t=new i.RPC.ControlIHave;if(null!=e.topicID&&(t.topicID=String(e.topicID)),e.messageIDs){if(!Array.isArray(e.messageIDs))throw TypeError(".RPC.ControlIHave.messageIDs: array expected");t.messageIDs=[];for(var r=0;r<e.messageIDs.length;++r)"string"===typeof e.messageIDs[r]?n.base64.decode(e.messageIDs[r],t.messageIDs[r]=n.newBuffer(n.base64.length(e.messageIDs[r])),0):e.messageIDs[r].length&&(t.messageIDs[r]=e.messageIDs[r])}return t},o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.messageIDs=[]),null!=e.topicID&&e.hasOwnProperty("topicID")&&(r.topicID=e.topicID,t.oneofs&&(r._topicID="topicID")),e.messageIDs&&e.messageIDs.length){r.messageIDs=[];for(var i=0;i<e.messageIDs.length;++i)r.messageIDs[i]=t.bytes===String?n.base64.encode(e.messageIDs[i],0,e.messageIDs[i].length):t.bytes===Array?Array.prototype.slice.call(e.messageIDs[i]):e.messageIDs[i]}return r},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.ControlIWant=function(){function o(e){if(this.messageIDs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return o.prototype.messageIDs=n.emptyArray,o.encode=function(e,t){if(t||(t=r.create()),null!=e.messageIDs&&e.messageIDs.length)for(var n=0;n<e.messageIDs.length;++n)t.uint32(10).bytes(e.messageIDs[n]);return t},o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var n=void 0===r?e.len:e.pos+r,o=new i.RPC.ControlIWant;e.pos<n;){var s=e.uint32();s>>>3===1?(o.messageIDs&&o.messageIDs.length||(o.messageIDs=[]),o.messageIDs.push(e.bytes())):e.skipType(7&s)}return o},o.fromObject=function(e){if(e instanceof i.RPC.ControlIWant)return e;var t=new i.RPC.ControlIWant;if(e.messageIDs){if(!Array.isArray(e.messageIDs))throw TypeError(".RPC.ControlIWant.messageIDs: array expected");t.messageIDs=[];for(var r=0;r<e.messageIDs.length;++r)"string"===typeof e.messageIDs[r]?n.base64.decode(e.messageIDs[r],t.messageIDs[r]=n.newBuffer(n.base64.length(e.messageIDs[r])),0):e.messageIDs[r].length&&(t.messageIDs[r]=e.messageIDs[r])}return t},o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.messageIDs=[]),e.messageIDs&&e.messageIDs.length){r.messageIDs=[];for(var i=0;i<e.messageIDs.length;++i)r.messageIDs[i]=t.bytes===String?n.base64.encode(e.messageIDs[i],0,e.messageIDs[i].length):t.bytes===Array?Array.prototype.slice.call(e.messageIDs[i]):e.messageIDs[i]}return r},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.ControlGraft=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var s;return o.prototype.topicID=null,Object.defineProperty(o.prototype,"_topicID",{get:n.oneOfGetter(s=["topicID"]),set:n.oneOfSetter(s)}),o.encode=function(e,t){return t||(t=r.create()),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&t.uint32(10).string(e.topicID),t},o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var n=void 0===r?e.len:e.pos+r,o=new i.RPC.ControlGraft;e.pos<n;){var s=e.uint32();s>>>3===1?o.topicID=e.string():e.skipType(7&s)}return o},o.fromObject=function(e){if(e instanceof i.RPC.ControlGraft)return e;var t=new i.RPC.ControlGraft;return null!=e.topicID&&(t.topicID=String(e.topicID)),t},o.toObject=function(e,t){t||(t={});var r={};return null!=e.topicID&&e.hasOwnProperty("topicID")&&(r.topicID=e.topicID,t.oneofs&&(r._topicID="topicID")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.ControlPrune=function(){function o(e){if(this.peers=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var s;return o.prototype.topicID=null,o.prototype.peers=n.emptyArray,o.prototype.backoff=null,Object.defineProperty(o.prototype,"_topicID",{get:n.oneOfGetter(s=["topicID"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_backoff",{get:n.oneOfGetter(s=["backoff"]),set:n.oneOfSetter(s)}),o.encode=function(e,t){if(t||(t=r.create()),null!=e.topicID&&Object.hasOwnProperty.call(e,"topicID")&&t.uint32(10).string(e.topicID),null!=e.peers&&e.peers.length)for(var n=0;n<e.peers.length;++n)i.RPC.PeerInfo.encode(e.peers[n],t.uint32(18).fork()).ldelim();return null!=e.backoff&&Object.hasOwnProperty.call(e,"backoff")&&t.uint32(24).uint64(e.backoff),t},o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var n=void 0===r?e.len:e.pos+r,o=new i.RPC.ControlPrune;e.pos<n;){var s=e.uint32();switch(s>>>3){case 1:o.topicID=e.string();break;case 2:o.peers&&o.peers.length||(o.peers=[]),o.peers.push(i.RPC.PeerInfo.decode(e,e.uint32()));break;case 3:o.backoff=e.uint64();break;default:e.skipType(7&s)}}return o},o.fromObject=function(e){if(e instanceof i.RPC.ControlPrune)return e;var t=new i.RPC.ControlPrune;if(null!=e.topicID&&(t.topicID=String(e.topicID)),e.peers){if(!Array.isArray(e.peers))throw TypeError(".RPC.ControlPrune.peers: array expected");t.peers=[];for(var r=0;r<e.peers.length;++r){if("object"!==typeof e.peers[r])throw TypeError(".RPC.ControlPrune.peers: object expected");t.peers[r]=i.RPC.PeerInfo.fromObject(e.peers[r])}}return null!=e.backoff&&(n.Long?(t.backoff=n.Long.fromValue(e.backoff)).unsigned=!0:"string"===typeof e.backoff?t.backoff=parseInt(e.backoff,10):"number"===typeof e.backoff?t.backoff=e.backoff:"object"===typeof e.backoff&&(t.backoff=new n.LongBits(e.backoff.low>>>0,e.backoff.high>>>0).toNumber(!0))),t},o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.peers=[]),null!=e.topicID&&e.hasOwnProperty("topicID")&&(r.topicID=e.topicID,t.oneofs&&(r._topicID="topicID")),e.peers&&e.peers.length){r.peers=[];for(var o=0;o<e.peers.length;++o)r.peers[o]=i.RPC.PeerInfo.toObject(e.peers[o],t)}return null!=e.backoff&&e.hasOwnProperty("backoff")&&("number"===typeof e.backoff?r.backoff=t.longs===String?String(e.backoff):e.backoff:r.backoff=t.longs===String?n.Long.prototype.toString.call(e.backoff):t.longs===Number?new n.LongBits(e.backoff.low>>>0,e.backoff.high>>>0).toNumber(!0):e.backoff,t.oneofs&&(r._backoff="backoff")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.PeerInfo=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var s;return o.prototype.peerID=null,o.prototype.signedPeerRecord=null,Object.defineProperty(o.prototype,"_peerID",{get:n.oneOfGetter(s=["peerID"]),set:n.oneOfSetter(s)}),Object.defineProperty(o.prototype,"_signedPeerRecord",{get:n.oneOfGetter(s=["signedPeerRecord"]),set:n.oneOfSetter(s)}),o.encode=function(e,t){return t||(t=r.create()),null!=e.peerID&&Object.hasOwnProperty.call(e,"peerID")&&t.uint32(10).bytes(e.peerID),null!=e.signedPeerRecord&&Object.hasOwnProperty.call(e,"signedPeerRecord")&&t.uint32(18).bytes(e.signedPeerRecord),t},o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var n=void 0===r?e.len:e.pos+r,o=new i.RPC.PeerInfo;e.pos<n;){var s=e.uint32();switch(s>>>3){case 1:o.peerID=e.bytes();break;case 2:o.signedPeerRecord=e.bytes();break;default:e.skipType(7&s)}}return o},o.fromObject=function(e){if(e instanceof i.RPC.PeerInfo)return e;var t=new i.RPC.PeerInfo;return null!=e.peerID&&("string"===typeof e.peerID?n.base64.decode(e.peerID,t.peerID=n.newBuffer(n.base64.length(e.peerID)),0):e.peerID.length&&(t.peerID=e.peerID)),null!=e.signedPeerRecord&&("string"===typeof e.signedPeerRecord?n.base64.decode(e.signedPeerRecord,t.signedPeerRecord=n.newBuffer(n.base64.length(e.signedPeerRecord)),0):e.signedPeerRecord.length&&(t.signedPeerRecord=e.signedPeerRecord)),t},o.toObject=function(e,t){t||(t={});var r={};return null!=e.peerID&&e.hasOwnProperty("peerID")&&(r.peerID=t.bytes===String?n.base64.encode(e.peerID,0,e.peerID.length):t.bytes===Array?Array.prototype.slice.call(e.peerID):e.peerID,t.oneofs&&(r._peerID="peerID")),null!=e.signedPeerRecord&&e.hasOwnProperty("signedPeerRecord")&&(r.signedPeerRecord=t.bytes===String?n.base64.encode(e.signedPeerRecord,0,e.signedPeerRecord.length):t.bytes===Array?Array.prototype.slice.call(e.signedPeerRecord):e.signedPeerRecord,t.oneofs&&(r._signedPeerRecord="signedPeerRecord")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o}(),i})?n.apply(t,i):n)||(e.exports=o)},21243:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeScore=void 0,t.computeScore=function(e,t,r,n){let i=0;Object.entries(t.topics).forEach((e=>{let[t,n]=e;const o=r.topics[t];if(!o)return;let s=0;if(n.inMesh){let e=n.meshTime/o.timeInMeshQuantum;e>o.timeInMeshCap&&(e=o.timeInMeshCap),s+=e*o.timeInMeshWeight}if(s+=n.firstMessageDeliveries*o.firstMessageDeliveriesWeight,n.meshMessageDeliveriesActive&&n.meshMessageDeliveries<o.meshMessageDeliveriesThreshold){const e=o.meshMessageDeliveriesThreshold-n.meshMessageDeliveries;s+=e*e*o.meshMessageDeliveriesWeight}s+=n.meshFailurePenalty*o.meshFailurePenaltyWeight;s+=n.invalidMessageDeliveries*n.invalidMessageDeliveries*o.invalidMessageDeliveriesWeight,i+=s*o.topicWeight})),r.topicScoreCap>0&&i>r.topicScoreCap&&(i=r.topicScoreCap);const o=r.appSpecificScore(e);i+=o*r.appSpecificWeight,t.ips.forEach((e=>{if(r.IPColocationFactorWhitelist.has(e))return;const t=n.get(e),o=t?t.size:0;if(o>r.IPColocationFactorThreshold){const e=o-r.IPColocationFactorThreshold;i+=e*e*r.IPColocationFactorWeight}}));const s=t.behaviourPenalty*t.behaviourPenalty;return i+=s*r.behaviourPenaltyWeight,i}},62919:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERR_INVALID_PEER_SCORE_THRESHOLDS=t.ERR_INVALID_PEER_SCORE_PARAMS=void 0,t.ERR_INVALID_PEER_SCORE_PARAMS="ERR_INVALID_PEER_SCORE_PARAMS",t.ERR_INVALID_PEER_SCORE_THRESHOLDS="ERR_INVALID_PEER_SCORE_THRESHOLDS"},41391:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3897),t),i(r(74217),t),i(r(27210),t)},24150:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDeliveries=t.DeliveryRecordStatus=void 0;const i=r(26192),o=n(r(38350)),s=r(56785);var a;!function(e){e[e.unknown=0]="unknown",e[e.valid=1]="valid",e[e.invalid=2]="invalid",e[e.ignored=3]="ignored"}(a=t.DeliveryRecordStatus||(t.DeliveryRecordStatus={}));t.MessageDeliveries=class{constructor(){this.records=new Map,this.queue=new o.default}ensureRecord(e){const t=s.messageIdToString(e);let r=this.records.get(t);if(r)return r;r={status:a.unknown,firstSeen:Date.now(),validated:0,peers:new Set},this.records.set(t,r);const n={msgId:t,expire:Date.now()+i.TimeCacheDuration};return this.queue.push(n),r}gc(){const e=Date.now();let t=this.queue.peekFront();for(;t&&t.expire<e;)this.records.delete(t.msgId),this.queue.shift(),t=this.queue.peekFront()}clear(){this.records.clear(),this.queue.clear()}}},3897:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTopicScoreParams=t.validatePeerScoreParams=t.createTopicScoreParams=t.createPeerScoreParams=t.defaultTopicScoreParams=t.defaultPeerScoreParams=void 0;const n=r(62919),i=r(61446);function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign({},t.defaultTopicScoreParams),e)}function s(e){if(e.topicWeight<0)throw i(new Error("invalid topic weight; must be >= 0"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0===e.timeInMeshQuantum)throw i(new Error("invalid TimeInMeshQuantum; must be non zero"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.timeInMeshWeight<0)throw i(new Error("invalid TimeInMeshWeight; must be positive (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.timeInMeshWeight&&e.timeInMeshQuantum<=0)throw i(new Error("invalid TimeInMeshQuantum; must be positive"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.timeInMeshWeight&&e.timeInMeshCap<=0)throw i(new Error("invalid TimeInMeshCap; must be positive"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.firstMessageDeliveriesWeight<0)throw i(new Error("invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.firstMessageDeliveriesWeight&&(e.firstMessageDeliveriesDecay<=0||e.firstMessageDeliveriesDecay>=1))throw i(new Error("invalid FirstMessageDeliveriesDecay; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.firstMessageDeliveriesWeight&&e.firstMessageDeliveriesCap<=0)throw i(new Error("invalid FirstMessageDeliveriesCap; must be positive"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.meshMessageDeliveriesWeight>0)throw i(new Error("invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.meshMessageDeliveriesWeight&&(e.meshMessageDeliveriesDecay<=0||e.meshMessageDeliveriesDecay>=1))throw i(new Error("invalid MeshMessageDeliveriesDecay; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.meshMessageDeliveriesWeight&&e.meshMessageDeliveriesCap<=0)throw i(new Error("invalid MeshMessageDeliveriesCap; must be positive"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.meshMessageDeliveriesWeight&&e.meshMessageDeliveriesThreshold<=0)throw i(new Error("invalid MeshMessageDeliveriesThreshold; must be positive"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.meshMessageDeliveriesWindow<0)throw i(new Error("invalid MeshMessageDeliveriesWindow; must be non-negative"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.meshMessageDeliveriesWeight&&e.meshMessageDeliveriesActivation<1e3)throw i(new Error("invalid MeshMessageDeliveriesActivation; must be at least 1s"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.meshFailurePenaltyWeight>0)throw i(new Error("invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.meshFailurePenaltyWeight&&(e.meshFailurePenaltyDecay<=0||e.meshFailurePenaltyDecay>=1))throw i(new Error("invalid MeshFailurePenaltyDecay; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.invalidMessageDeliveriesWeight>0)throw i(new Error("invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.invalidMessageDeliveriesDecay<=0||e.invalidMessageDeliveriesDecay>=1)throw i(new Error("invalid InvalidMessageDeliveriesDecay; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS)}t.defaultPeerScoreParams={topics:{},topicScoreCap:10,appSpecificScore:()=>0,appSpecificWeight:10,IPColocationFactorWeight:-5,IPColocationFactorThreshold:10,IPColocationFactorWhitelist:new Set,behaviourPenaltyWeight:-10,behaviourPenaltyDecay:.2,decayInterval:1e3,decayToZero:.1,retainScore:36e5},t.defaultTopicScoreParams={topicWeight:.5,timeInMeshWeight:1,timeInMeshQuantum:1,timeInMeshCap:3600,firstMessageDeliveriesWeight:1,firstMessageDeliveriesDecay:.5,firstMessageDeliveriesCap:2e3,meshMessageDeliveriesWeight:-1,meshMessageDeliveriesDecay:.5,meshMessageDeliveriesCap:100,meshMessageDeliveriesThreshold:20,meshMessageDeliveriesWindow:10,meshMessageDeliveriesActivation:5e3,meshFailurePenaltyWeight:-1,meshFailurePenaltyDecay:.5,invalidMessageDeliveriesWeight:-1,invalidMessageDeliveriesDecay:.3},t.createPeerScoreParams=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign(Object.assign({},t.defaultPeerScoreParams),e),{topics:e.topics?Object.entries(e.topics).reduce(((e,t)=>{let[r,n]=t;return e[r]=o(n),e}),{}):{}})},t.createTopicScoreParams=o,t.validatePeerScoreParams=function(e){for(const[r,o]of Object.entries(e.topics))try{s(o)}catch(t){throw i(new Error("invalid score parameters for topic ".concat(r,": ").concat(t.message)),n.ERR_INVALID_PEER_SCORE_PARAMS)}if(e.topicScoreCap<0)throw i(new Error("invalid topic score cap; must be positive (or 0 for no cap)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(null===e.appSpecificScore||void 0===e.appSpecificScore)throw i(new Error("missing application specific score function"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.IPColocationFactorWeight>0)throw i(new Error("invalid IPColocationFactorWeight; must be negative (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.IPColocationFactorWeight&&e.IPColocationFactorThreshold<1)throw i(new Error("invalid IPColocationFactorThreshold; must be at least 1"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.behaviourPenaltyWeight>0)throw i(new Error("invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(0!==e.behaviourPenaltyWeight&&(e.behaviourPenaltyDecay<=0||e.behaviourPenaltyDecay>=1))throw i(new Error("invalid BehaviourPenaltyDecay; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.decayInterval<1e3)throw i(new Error("invalid DecayInterval; must be at least 1s"),n.ERR_INVALID_PEER_SCORE_PARAMS);if(e.decayToZero<=0||e.decayToZero>=1)throw i(new Error("invalid DecayToZero; must be between 0 and 1"),n.ERR_INVALID_PEER_SCORE_PARAMS)},t.validateTopicScoreParams=s},74217:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validatePeerScoreThresholds=t.createPeerScoreThresholds=t.defaultPeerScoreThresholds=void 0;const n=r(62919),i=r(61446);t.defaultPeerScoreThresholds={gossipThreshold:-10,publishThreshold:-50,graylistThreshold:-80,acceptPXThreshold:10,opportunisticGraftThreshold:20},t.createPeerScoreThresholds=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign({},t.defaultPeerScoreThresholds),e)},t.validatePeerScoreThresholds=function(e){if(e.gossipThreshold>0)throw i(new Error("invalid gossip threshold; it must be <= 0"),n.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(e.publishThreshold>0||e.publishThreshold>e.gossipThreshold)throw i(new Error("invalid publish threshold; it must be <= 0 and <= gossip threshold"),n.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(e.graylistThreshold>0||e.graylistThreshold>e.publishThreshold)throw i(new Error("invalid graylist threshold; it must be <= 0 and <= publish threshold"),n.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(e.acceptPXThreshold<0)throw i(new Error("invalid accept PX threshold; it must be >= 0"),n.ERR_INVALID_PEER_SCORE_THRESHOLDS);if(e.opportunisticGraftThreshold<0)throw i(new Error("invalid opportunistic grafting threshold; it must be >= 0"),n.ERR_INVALID_PEER_SCORE_THRESHOLDS)}},27210:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PeerScore=void 0;const o=r(3897),s=r(77120),a=r(21243),u=r(24150),c=r(26192),h=i(r(71234)),l=r(39287),f=r(22974),{ERR_INVALID_SIGNATURE:d,ERR_MISSING_SIGNATURE:p}=f.codes,y=l("libp2p:gossipsub:score");t.PeerScore=class{constructor(e,t,r){o.validatePeerScoreParams(e),this.params=e,this._connectionManager=t,this.peerStats=new Map,this.peerIPs=new Map,this.deliveryRecords=new u.MessageDeliveries,this.msgId=r}start(){this._backgroundInterval?y("Peer score already running"):(this._backgroundInterval=setInterval((()=>this.background()),this.params.decayInterval),y("started"))}stop(){this._backgroundInterval?(clearInterval(this._backgroundInterval),delete this._backgroundInterval,this.peerIPs.clear(),this.peerStats.clear(),this.deliveryRecords.clear(),y("stopped")):y("Peer score already stopped")}background(){this._refreshScores(),this._updateIPs(),this.deliveryRecords.gc()}_refreshScores(){const e=Date.now(),t=this.params.decayToZero;this.peerStats.forEach(((r,n)=>{r.connected?(Object.entries(r.topics).forEach((r=>{let[n,i]=r;const o=this.params.topics[n];o&&(i.firstMessageDeliveries*=o.firstMessageDeliveriesDecay,i.firstMessageDeliveries<t&&(i.firstMessageDeliveries=0),i.meshMessageDeliveries*=o.meshMessageDeliveriesDecay,i.meshMessageDeliveries<t&&(i.meshMessageDeliveries=0),i.meshFailurePenalty*=o.meshFailurePenaltyDecay,i.meshFailurePenalty<t&&(i.meshFailurePenalty=0),i.invalidMessageDeliveries*=o.invalidMessageDeliveriesDecay,i.invalidMessageDeliveries<t&&(i.invalidMessageDeliveries=0),i.inMesh&&(i.meshTime=e-i.graftTime,i.meshTime>o.meshMessageDeliveriesActivation&&(i.meshMessageDeliveriesActive=!0)))})),r.behaviourPenalty*=this.params.behaviourPenaltyDecay,r.behaviourPenalty<t&&(r.behaviourPenalty=0)):e>r.expire&&(this._removeIPs(n,r.ips),this.peerStats.delete(n))}))}score(e){const t=this.peerStats.get(e);return t?a.computeScore(e,t,this.params,this.peerIPs):0}addPenalty(e,t){const r=this.peerStats.get(e);r&&(r.behaviourPenalty+=t)}addPeer(e){const t=s.createPeerStats({connected:!0});this.peerStats.set(e,t);const r=this._getIPs(e);this._setIPs(e,r,t.ips),t.ips=r}removePeer(e){const t=this.peerStats.get(e);if(t){if(this.score(e)>0)return this._removeIPs(e,t.ips),void this.peerStats.delete(e);Object.entries(t.topics).forEach((e=>{let[t,r]=e;r.firstMessageDeliveries=0;const n=this.params.topics[t].meshMessageDeliveriesThreshold;if(r.inMesh&&r.meshMessageDeliveriesActive&&r.meshMessageDeliveries<n){const e=n-r.meshMessageDeliveries;r.meshFailurePenalty+=e*e}r.inMesh=!1})),t.connected=!1,t.expire=Date.now()+this.params.retainScore}}graft(e,t){const r=this.peerStats.get(e);if(!r)return;const n=s.ensureTopicStats(t,r,this.params);n&&(n.inMesh=!0,n.graftTime=Date.now(),n.meshTime=0,n.meshMessageDeliveriesActive=!1)}prune(e,t){const r=this.peerStats.get(e);if(!r)return;const n=s.ensureTopicStats(t,r,this.params);if(!n)return;const i=this.params.topics[t].meshMessageDeliveriesThreshold;if(n.meshMessageDeliveriesActive&&n.meshMessageDeliveries<i){const e=i-n.meshMessageDeliveries;n.meshFailurePenalty+=e*e}n.inMesh=!1}validateMessage(e){return n(this,void 0,void 0,(function*(){this.deliveryRecords.ensureRecord(yield this.msgId(e))}))}deliverMessage(e){return n(this,void 0,void 0,(function*(){const t=e.receivedFrom;this._markFirstMessageDelivery(t,e);const r=this.deliveryRecords.ensureRecord(yield this.msgId(e)),n=Date.now();r.status===u.DeliveryRecordStatus.unknown?(r.status=u.DeliveryRecordStatus.valid,r.validated=n,r.peers.forEach((r=>{r!==t&&this._markDuplicateMessageDelivery(r,e)}))):y("unexpected delivery: message from %s was first seen %s ago and has delivery status %d",t,n-r.firstSeen,u.DeliveryRecordStatus[r.status])}))}rejectMessage(e,t){return n(this,void 0,void 0,(function*(){const r=e.receivedFrom;switch(t){case p:case d:return void this._markInvalidMessageDelivery(r,e)}const n=this.deliveryRecords.ensureRecord(yield this.msgId(e));n.status===u.DeliveryRecordStatus.unknown?t!==c.ERR_TOPIC_VALIDATOR_IGNORE?(n.status=u.DeliveryRecordStatus.invalid,this._markInvalidMessageDelivery(r,e),n.peers.forEach((t=>{this._markInvalidMessageDelivery(t,e)}))):n.status=u.DeliveryRecordStatus.ignored:y("unexpected rejection: message from %s was first seen %s ago and has delivery status %d",r,Date.now()-n.firstSeen,u.DeliveryRecordStatus[n.status])}))}duplicateMessage(e){return n(this,void 0,void 0,(function*(){const t=e.receivedFrom,r=this.deliveryRecords.ensureRecord(yield this.msgId(e));if(!r.peers.has(t))switch(r.status){case u.DeliveryRecordStatus.unknown:r.peers.add(t);break;case u.DeliveryRecordStatus.valid:r.peers.add(t),this._markDuplicateMessageDelivery(t,e,r.validated);break;case u.DeliveryRecordStatus.invalid:this._markInvalidMessageDelivery(t,e)}}))}_markInvalidMessageDelivery(e,t){const r=this.peerStats.get(e);r&&t.topicIDs.forEach((e=>{const t=s.ensureTopicStats(e,r,this.params);t&&(t.invalidMessageDeliveries+=1)}))}_markFirstMessageDelivery(e,t){const r=this.peerStats.get(e);r&&t.topicIDs.forEach((e=>{const t=s.ensureTopicStats(e,r,this.params);if(!t)return;let n=this.params.topics[e].firstMessageDeliveriesCap;t.firstMessageDeliveries+=1,t.firstMessageDeliveries>n&&(t.firstMessageDeliveries=n),t.inMesh&&(n=this.params.topics[e].meshMessageDeliveriesCap,t.meshMessageDeliveries+=1,t.meshMessageDeliveries>n&&(t.meshMessageDeliveries=n))}))}_markDuplicateMessageDelivery(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.peerStats.get(e);if(!n)return;const i=r?Date.now():0;t.topicIDs.forEach((e=>{const t=s.ensureTopicStats(e,n,this.params);if(!t)return;if(!t.inMesh)return;const o=this.params.topics[e];if(r&&i>r+o.meshMessageDeliveriesWindow)return;const a=o.meshMessageDeliveriesCap;t.meshMessageDeliveries+=1,t.meshMessageDeliveries>a&&(t.meshMessageDeliveries=a)}))}_getIPs(e){return this._connectionManager.getAll(h.default.createFromB58String(e)).map((e=>e.remoteAddr.toOptions().host))}_setIPs(e,t,r){e:for(const n of t){for(const e of r)if(n===e)continue e;let t=this.peerIPs.get(n);t||(t=new Set,this.peerIPs.set(n,t)),t.add(e)}e:for(const n of r){for(const e of t)if(n===e)continue e;const r=this.peerIPs.get(n);r&&(r.delete(e),r.size||this.peerIPs.delete(n))}}_removeIPs(e,t){t.forEach((t=>{const r=this.peerIPs.get(t);r&&(r.delete(e),r.size||this.peerIPs.delete(t))}))}_updateIPs(){this.peerStats.forEach(((e,t)=>{const r=this._getIPs(t);this._setIPs(t,r,e.ips),e.ips=r}))}}},77120:(e,t)=>{"use strict";function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({inMesh:!1,graftTime:0,meshTime:0,firstMessageDeliveries:0,meshMessageDeliveries:0,meshMessageDeliveriesActive:!1,meshFailurePenalty:0,invalidMessageDeliveries:0},e)}Object.defineProperty(t,"__esModule",{value:!0}),t.ensureTopicStats=t.createTopicStats=t.createPeerStats=void 0,t.createPeerStats=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Object.assign({connected:!1,expire:0,ips:[],behaviourPenalty:0},e),{topics:e.topics?Object.entries(e.topics).reduce(((e,t)=>{let[n,i]=t;return e[n]=r(i),e}),{}):{}})},t.createTopicStats=r,t.ensureTopicStats=function(e,t,n){let i=t.topics[e];return i||(n.topics[e]?(t.topics[e]=i=r(),i):void 0)}},23825:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(t){o(t)}}function a(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.IWantTracer=void 0;const i=r(26192),o=r(56785),s=r(22974),{ERR_INVALID_SIGNATURE:a,ERR_MISSING_SIGNATURE:u}=s.codes;t.IWantTracer=class{constructor(e){this.getMsgId=e,this.promises=new Map}addPromise(e,t){const r=t[Math.floor(Math.random()*t.length)],n=o.messageIdToString(r);let s=this.promises.get(n);s||(s=new Map,this.promises.set(n,s)),s.has(e)||s.set(e,Date.now()+i.GossipsubIWantFollowupTime)}getBrokenPromises(){const e=Date.now(),t=new Map;return this.promises.forEach(((r,n)=>{r.forEach(((n,i)=>{n<e&&(t.set(i,(t.get(i)||0)+1),r.delete(i))})),r.size||this.promises.delete(n)})),t}deliverMessage(e){return n(this,void 0,void 0,(function*(){const t=yield this.getMsgId(e),r=o.messageIdToString(t);this.promises.delete(r)}))}rejectMessage(e,t){return n(this,void 0,void 0,(function*(){switch(t){case a:case u:return}const r=yield this.getMsgId(e),n=o.messageIdToString(r);this.promises.delete(n)}))}clear(){this.promises.clear()}}},43848:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createGossipRpc=void 0,t.createGossipRpc=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{subscriptions:[],msgs:e,control:Object.assign({ihave:[],iwant:[],graft:[],prune:[]},t)}}},1614:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasGossipProtocol=void 0;const n=r(26192);t.hasGossipProtocol=function(e){return e===n.GossipsubIDv10||e===n.GossipsubIDv11}},56785:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(43848),t),i(r(30568),t),i(r(1614),t),i(r(23431),t)},23431:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.messageIdToString=void 0;const n=r(10157);t.messageIdToString=function(e){return n.toString(e,"base64")}},30568:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shuffle=void 0,t.shuffle=function(e){if(e.length<=1)return e;for(let t=0;t<e.length;t++){const r=Math.floor(Math.random()*Math.floor(e.length)),n=e[t];e[t]=e[r],e[r]=n}return e}},98299:(e,t,r)=>{"use strict";const n=r(96732),{Multiaddr:i}=r(57604),o=r(61446),{OPEN:s,CLOSING:a,CLOSED:u}=r(10204),c=Symbol.for("@libp2p/interface-connection/connection");class h{constructor(e){let{localAddr:t,remoteAddr:r,localPeer:a,remotePeer:u,newStream:c,close:h,getStreams:l,stat:f}=e;!function(e,t,r,s,a,u,c){if(e&&!i.isMultiaddr(e))throw o(new Error("localAddr must be an instance of multiaddr"),"ERR_INVALID_PARAMETERS");if(!n.isPeerId(t))throw o(new Error("localPeer must be an instance of peer-id"),"ERR_INVALID_PARAMETERS");if(!n.isPeerId(r))throw o(new Error("remotePeer must be an instance of peer-id"),"ERR_INVALID_PARAMETERS");if("function"!==typeof s)throw o(new Error("new stream must be a function"),"ERR_INVALID_PARAMETERS");if("function"!==typeof a)throw o(new Error("close must be a function"),"ERR_INVALID_PARAMETERS");if("function"!==typeof u)throw o(new Error("getStreams must be a function"),"ERR_INVALID_PARAMETERS");if(!c)throw o(new Error("connection metadata object must be provided"),"ERR_INVALID_PARAMETERS");if("inbound"!==c.direction&&"outbound"!==c.direction)throw o(new Error('direction must be "inbound" or "outbound"'),"ERR_INVALID_PARAMETERS");if(!c.timeline)throw o(new Error("connection timeline object must be provided in the stat object"),"ERR_INVALID_PARAMETERS");if(!c.timeline.open)throw o(new Error("connection open timestamp must be provided"),"ERR_INVALID_PARAMETERS");if(!c.timeline.upgraded)throw o(new Error("connection upgraded timestamp must be provided"),"ERR_INVALID_PARAMETERS")}(t,a,u,c,h,l,f),this.id=parseInt(String(1e9*Math.random())).toString(36)+Date.now(),this.localAddr=t,this.remoteAddr=r,this.localPeer=a,this.remotePeer=u,this._stat={...f,status:s},this._newStream=c,this._close=h,this._getStreams=l,this.registry=new Map,this.tags=[]}get[Symbol.toStringTag](){return"Connection"}get[c](){return!0}static isConnection(e){return Boolean(e&&e[c])}get stat(){return this._stat}get streams(){return this._getStreams()}async newStream(e){if(this.stat.status===a)throw o(new Error("the connection is being closed"),"ERR_CONNECTION_BEING_CLOSED");if(this.stat.status===u)throw o(new Error("the connection is closed"),"ERR_CONNECTION_CLOSED");Array.isArray(e)||(e=[e]);const{stream:t,protocol:r}=await this._newStream(e);return this.addStream(t,{protocol:r}),{stream:t,protocol:r}}addStream(e,t){let{protocol:r,metadata:n={}}=t;this.registry.set(e.id,{protocol:r,...n})}removeStream(e){this.registry.delete(e)}async close(){if(this.stat.status!==u){if(this._closing)return this._closing;this.stat.status=a,this._closing=await this._close(),this._stat.timeline.close=Date.now(),this.stat.status=u}}}e.exports=h},27653:(e,t,r)=>{"use strict";t.Connection=r(98299)},10204:e=>{"use strict";e.exports={OPEN:"open",CLOSING:"closing",CLOSED:"closed"}},57860:(e,t)=>{"use strict";t.SignaturePolicy={StrictSign:"StrictSign",StrictNoSign:"StrictNoSign"}},82714:e=>{"use strict";const t=()=>{},r=Symbol.for("@libp2p/js-interfaces/topology");class n{constructor(e){let{min:r=0,max:n=1/0,handlers:i={}}=e;this.min=r,this.max=n,this._onConnect=i.onConnect||t,this._onDisconnect=i.onDisconnect||t,this.peers=new Set}get[Symbol.toStringTag](){return"Topology"}get[r](){return!0}static isTopology(e){return Boolean(e&&e[r])}set registrar(e){this._registrar=e}disconnect(e){this._onDisconnect(e)}}e.exports=n},7642:(e,t,r)=>{"use strict";const n=r(16980),i=r(64277);e.exports=e=>async function*(){const t=new o;for await(const r of e){const e=t.write(r);e.length&&(yield e)}}();class o{constructor(){this._buffer=new i,this._bufferProxy=new Proxy({},{get:(e,t)=>"l"===t[0]?this._buffer[t]:this._buffer.get(parseInt(t))}),this._headerInfo=null}write(e){if(!e||!e.length)return[];this._buffer.append(e);const t=[];for(;this._buffer.length;){if(!this._headerInfo)try{this._headerInfo=this._decodeHeader(this._bufferProxy)}catch(r){break}const{id:e,type:n,length:i,offset:o}=this._headerInfo;if(this._buffer.length-o<i)break;t.push({id:e,type:n,data:this._buffer.shallowSlice(o,o+i)}),this._buffer.consume(o+i),this._headerInfo=null}return t}_decodeHeader(e){const t=n.decode(e);let r=n.decode.bytes;const i=n.decode(e,r);return r+=n.decode.bytes,{id:t>>3,type:7&t,offset:r,length:i}}}},61479:(e,t,r)=>{"use strict";const n=r(16980),i=r(64277),o=10240;const s=new class{constructor(){this._pool=new Uint8Array(o),this._poolOffset=0}write(e){const t=this._pool;let r=this._poolOffset;n.encode(e.id<<3|e.type,t,r),r+=n.encode.bytes,n.encode(e.data?e.data.length:0,t,r),r+=n.encode.bytes;const i=t.subarray(this._poolOffset,r);return o-r<100?(this._pool=new Uint8Array(o),this._poolOffset=0):this._poolOffset=r,e.data?[i,e.data]:i}};e.exports=e=>async function*(){for await(const t of e)Array.isArray(t)?yield new i(t.map((e=>s.write(e)))):yield new i(s.write(t))}()},60880:(e,t,r)=>{"use strict";t.encode=r(61479),t.decode=r(7642)},94149:(e,t,r)=>{"use strict";e.exports=r(4072)},92077:(e,t)=>{"use strict";const r=Object.freeze({NEW_STREAM:0,MESSAGE_RECEIVER:1,MESSAGE_INITIATOR:2,CLOSE_RECEIVER:3,CLOSE_INITIATOR:4,RESET_RECEIVER:5,RESET_INITIATOR:6});t.MessageTypes=r,t.InitiatorMessageTypes=Object.freeze({NEW_STREAM:r.NEW_STREAM,MESSAGE:r.MESSAGE_INITIATOR,CLOSE:r.CLOSE_INITIATOR,RESET:r.RESET_INITIATOR}),t.ReceiverMessageTypes=Object.freeze({MESSAGE:r.MESSAGE_RECEIVER,CLOSE:r.CLOSE_RECEIVER,RESET:r.RESET_RECEIVER}),t.MessageTypeNames=Object.freeze(Object.entries(r).reduce(((e,t)=>(e[t[1]]=t[0],e)),{}))},4072:(e,t,r)=>{"use strict";const n=r(91522),i=r(89858),o=r(39287)("libp2p:mplex"),s=r(1315),a=r(60880),u=r(10070),{MessageTypes:c,MessageTypeNames:h}=r(92077),l=r(68025);class f{constructor(e){e="function"===typeof(e=e||{})?{onStream:e}:e,this._streamId=0,this._streams={initiators:new Map,receivers:new Map},this._options=e,this.sink=this._createSink(),this.source=this._createSource(),this.onStream=e.onStream,this.onStreamEnd=e.onStreamEnd}get streams(){const e=[];return this._streams.initiators.forEach((t=>{e.push(t)})),this._streams.receivers.forEach((t=>{e.push(t)})),e}newStream(e){const t=this._streamId++;e=null==e?t.toString():String(e);const r=this._streams.initiators;return this._newStream({id:t,name:e,type:"initiator",registry:r})}_newReceiverStream(e){let{id:t,name:r}=e;const n=this._streams.receivers;return this._newStream({id:t,name:r,type:"receiver",registry:n})}_newStream(e){let{id:t,name:r,type:n,registry:i}=e;if(i.has(t))throw new Error("".concat(n," stream ").concat(t," already exists!"));o("new %s stream %s %s",n,t,r);const s=l({id:t,name:r,send:e=>(o.enabled&&o("%s stream %s %s send",n,t,r,{...e,type:h[e.type],data:e.data&&e.data.slice()}),this.source.push(e)),type:n,onEnd:()=>{o("%s stream %s %s ended",n,t,r),i.delete(t),this.onStreamEnd&&this.onStreamEnd(s)},maxMsgSize:this._options.maxMsgSize});return i.set(t,s),s}_createSink(){return async e=>{this._options.signal&&(e=s(e,this._options.signal));try{await n(e,a.decode,u(this._options.maxMsgSize),(async e=>{for await(const t of e)for(const e of t)this._handleIncoming(e)}))}catch(t){return o("error in sink",t),this.source.end(t)}this.source.end()}}_createSource(){const e=i({onEnd:e=>{const{initiators:t,receivers:r}=this._streams;for(const n of t.values())n.abort(e);for(const n of r.values())n.abort(e)},writev:!0});return Object.assign(a.encode(e),{push:e.push,end:e.end,return:e.return})}_handleIncoming(e){let{id:t,type:r,data:n}=e;if(o.enabled&&o("incoming message",{id:t,type:h[r],data:n.slice()}),r===c.NEW_STREAM&&this.onStream){const e=this._newReceiverStream({id:t,name:n.toString()});return this.onStream(e)}const i=(1&r?this._streams.initiators:this._streams.receivers).get(t);if(!i)return o("missing stream %s",t);switch(r){case c.MESSAGE_INITIATOR:case c.MESSAGE_RECEIVER:i.source.push(n);break;case c.CLOSE_INITIATOR:case c.CLOSE_RECEIVER:i.close();break;case c.RESET_INITIATOR:case c.RESET_RECEIVER:i.reset();break;default:o("unknown message type %s",r)}}}f.multicodec="/mplex/6.7.0",e.exports=f},10070:e=>{"use strict";const t=1<<20;e.exports=e=>{e=e||t;const r=t=>{if(t.data&&t.data.length>e)throw Object.assign(new Error("message size too large!"),{code:"ERR_MSG_TOO_BIG"})};return e=>async function*(){for await(const t of e)Array.isArray(t)?t.forEach(r):r(t),yield t}()},e.exports.MAX_MSG_SIZE=t},68025:(e,t,r)=>{"use strict";const n=r(1315),i=r(90834),o=r(39287)("libp2p:mplex:stream"),s=r(89858),a=r(64277),u=r(61446),{MAX_MSG_SIZE:c}=r(10070),{InitiatorMessageTypes:h,ReceiverMessageTypes:l}=r(92077),f="ERR_MPLEX_STREAM_RESET";e.exports=e=>{let{id:t,name:r,send:d,onEnd:p=(()=>{}),type:y="initiator",maxMsgSize:g=c}=e;const m=new i,b=new i,v="initiator"===y?h:l,w="initiator"===y?"i".concat(t):"r".concat(t);r=String(null==r?t:r);let _,E=!1,S=!1;const M=e=>{S||(S=!0,o("%s stream %s sink end",y,r,e),e&&!_&&(_=e),E&&(A.timeline.close=Date.now(),p(_)))},A={close:()=>A.source.end(),abort:e=>{o("%s stream %s abort",y,r,e),A.source.end(e),m.abort(),M(e)},reset:()=>{const e=u(new Error("stream reset"),f);b.abort(),A.source.end(e),M(e)},sink:async e=>{e=n(e,[{signal:m.signal,options:{abortMessage:"stream aborted",abortCode:"ERR_MPLEX_STREAM_ABORT"}},{signal:b.signal,options:{abortMessage:"stream reset",abortCode:f}}]),"initiator"===y&&d({id:t,type:v.NEW_STREAM,data:r});try{for await(let r of e)for(;r.length;){if(r.length<=g){d({id:t,type:v.MESSAGE,data:r});break}r=a.isBufferList(r)?r:new a(r),d({id:t,type:v.MESSAGE,data:r.shallowSlice(0,g)}),r.consume(g)}}catch(i){return i.code===f?o("%s stream %s reset",y,r):(o("%s stream %s error",y,r,i),d({id:t,type:v.RESET})),A.source.end(i),M(i)}d({id:t,type:v.CLOSE}),M()},source:s((e=>{E||(E=!0,o("%s stream %s source end",y,r,e),e&&!_&&(_=e),S&&(A.timeline.close=Date.now(),p(_)))})),timeline:{open:Date.now(),close:null},id:w};return A}},92646:(e,t,r)=>{"use strict";const n=r(91934);function i(e,t){const r=n(e.multiaddr),i=n(t.multiaddr);return r&&!i?1:!r&&i||e.isCertified&&!t.isCertified?-1:!e.isCertified&&t.isCertified?1:0}e.exports.publicAddressesFirst=function(e){return[...e].sort(i)}},83805:e=>{"use strict";e.exports=function(e,t){return e.length===t.length&&t.sort()&&e.sort().every(((e,r)=>t[r].equals(e)))}},15678:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:ip-port-to-multiaddr"),{error:n("libp2p:ip-port-to-multiaddr:err")}),{Multiaddr:o}=r(57604),s=r(61446),{Address4:a,Address6:u}=r(8236),c={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};e.exports=function(e,t){if("string"!==typeof e)throw s(new Error("invalid ip provided: ".concat(e)),c.ERR_INVALID_IP_PARAMETER);if("string"===typeof t&&(t=parseInt(t)),isNaN(t))throw s(new Error("invalid port provided: ".concat(t)),c.ERR_INVALID_PORT_PARAMETER);try{return new a(e),new o("/ip4/".concat(e,"/tcp/").concat(t))}catch{}try{const r=new u(e);return r.is4()?new o("/ip4/".concat(r.to4().correctForm(),"/tcp/").concat(t)):new o("/ip6/".concat(e,"/tcp/").concat(t))}catch(r){const n="invalid ip:port for creating a multiaddr: ".concat(e,":").concat(t);throw i.error(n),s(new Error(n),c.ERR_INVALID_IP)}},e.exports.Errors=c},86627:(e,t,r)=>{"use strict";const n=r(54384);e.exports=function(e){const{address:t}=e.nodeAddress();return n(t)}},91934:(e,t,r)=>{"use strict";const n=r(98072);e.exports=function(e){const{address:t}=e.nodeAddress();return n(t)}},51972:(e,t,r)=>{"use strict";const{source:n}=r(1315),i=r(39287)("libp2p:stream:converter");e.exports=function(e){let{stream:t,remoteAddr:r,localAddr:o}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sink:a,source:u}=t,c={async sink(e){s.signal&&(e=n(e,s.signal));try{await a(e)}catch(t){"aborted"!==t.type&&i(t)}h()},source:s.signal?n(u,s.signal):u,conn:t,localAddr:o,remoteAddr:r,timeline:{open:Date.now(),close:void 0},close:()=>(a(new Uint8Array(0)),h())};function h(){return c.timeline.close||(c.timeline.close=Date.now()),Promise.resolve()}return c}},20033:(e,t)=>{"use strict";t.CODE_P2P=421,t.CODE_CIRCUIT=290,t.CODE_TCP=6,t.CODE_WS=477,t.CODE_WSS=478,t.CLOSE_TIMEOUT=2e3},81842:(e,t,r)=>{"use strict";const n=r(27862),{CODE_CIRCUIT:i,CODE_P2P:o,CODE_TCP:s,CODE_WS:a,CODE_WSS:u}=r(20033);e.exports={all:e=>e.filter((e=>{if(e.protoCodes().includes(i))return!1;const t=e.decapsulateCode(o);return n.WebSockets.matches(t)||n.WebSocketsSecure.matches(t)})),dnsWss:e=>e.filter((e=>{if(e.protoCodes().includes(i))return!1;const t=e.decapsulateCode(o);return n.WebSocketsSecure.matches(t)&&n.DNS.matches(t.decapsulateCode(s).decapsulateCode(u))})),dnsWsOrWss:e=>e.filter((e=>{if(e.protoCodes().includes(i))return!1;const t=e.decapsulateCode(o);return n.WebSockets.matches(t)?n.DNS.matches(t.decapsulateCode(s).decapsulateCode(a)):n.WebSocketsSecure.matches(t)&&n.DNS.matches(t.decapsulateCode(s).decapsulateCode(u))}))}},70585:(e,t,r)=>{"use strict";const n=r(1929),i=r(93077),o=r(23911),{AbortError:s}=r(1315),a=r(44966),u=r(39287),c=u("libp2p:websockets");c.error=u("libp2p:websockets:error");const h=r(72954),l=r(41346),f=r(64363),d=r(81842);e.exports=i(class{constructor(e){let{upgrader:t,filter:r}=e;if(!t)throw new Error("An upgrader must be provided. See https://github.com/libp2p/interface-transport#upgrader.");this._upgrader=t,this._filter=r}async dial(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c("dialing %s",e);const r=await this._connect(e,t),n=f(r,{remoteAddr:e,signal:t.signal});c("new outbound connection %s",n.remoteAddr);const i=await this._upgrader.upgradeOutbound(n);return c("outbound connection %s upgraded",n.remoteAddr),i}async _connect(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.signal&&t.signal.aborted)throw new s;const r=e.toOptions();c("dialing %s:%s",r.host,r.port);const i=a(),u=e=>{const t="connection error: ".concat(e.message);c.error(t),i.reject(e)},h=n(o(e),Object.assign({binary:!0},t));if(h.socket.on?h.socket.on("error",u):h.socket.onerror=u,!t.signal)return await Promise.race([h.connected(),i.promise]),c("connected %s",e),h;let l;const f=new Promise(((e,r)=>{if(l=()=>{r(new s),setTimeout((()=>{h.close()}))},t.signal.aborted)return l();t.signal.addEventListener("abort",l)}));try{await Promise.race([f,i.promise,h.connected()])}finally{t.signal.removeEventListener("abort",l)}return c("connected %s",e),h}createListener(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"function"===typeof e&&(t=e,e={}),l({handler:t,upgrader:this._upgrader},e)}filter(e){return e=Array.isArray(e)?e:[e],this._filter?this._filter(e):h.isBrowser||h.isWebWorker?d.dnsWss(e):d.all(e)}},{className:"WebSockets",symbolName:"@libp2p/js-libp2p-websockets/websockets"})},41346:e=>{"use strict";e.exports=function(){throw new Error("WebSocket Servers can not be created in the browser!")}},64363:(e,t,r)=>{"use strict";const n=r(1315),{CLOSE_TIMEOUT:i}=r(20033),o=r(15678),s=r(31317),a=r(39287),u=a("libp2p:websockets:socket");u.error=a("libp2p:websockets:socket:error"),e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={async sink(r){t.signal&&(r=n(r,t.signal));try{await e.sink(async function*(){for await(const e of r)yield e instanceof Uint8Array?e:e.slice()}())}catch(i){"aborted"!==i.type&&u.error(i)}},source:t.signal?n(e.source,t.signal):e.source,conn:e,localAddr:t.localAddr||(e.localAddress&&e.localPort?o(e.localAddress,e.localPort):void 0),remoteAddr:t.remoteAddr||o(e.remoteAddress,e.remotePort),timeline:{open:Date.now()},async close(){const t=Date.now();try{await s(e.close(),i)}catch(n){const{host:i,port:o}=r.remoteAddr.toOptions();u("timeout closing stream to %s:%s after %dms, destroying it manually",i,o,Date.now()-t),e.destroy()}finally{r.timeline.close=Date.now()}}};return e.socket.once&&e.socket.once("close",(()=>{r.timeline.close||(r.timeline.close=Date.now())})),r}},61594:function(e,t,r){var n=r(21964);!function(e){"use strict";async function*t(e,t){let r=[];for await(const n of t)r.push(n),r.length===e&&(yield r,r=[]);r.length>0&&(yield r)}function*r(e,t){let r=[];for(const n of t)r.push(n),r.length===e&&(yield r,r=[]);r.length>0&&(yield r)}function i(e,n){return void 0===n?t=>i(e,t):n[Symbol.asyncIterator]?t(e,n):r(e,n)}function o(e){if("function"===typeof e.next)return e;if("function"===typeof e[Symbol.iterator])return e[Symbol.iterator]();if("function"===typeof e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();throw new TypeError('"values" does not to conform to any of the iterator or iterable protocols')}function s(){let e,t;return{promise:new Promise(((r,n)=>{t=r,e=n})),reject:e,resolve:t}}function a(e,t){const r=o(t),n=[],i=[];let a=!1,u=!1;function c(){for(;i.length>0&&n.length>0;){const e=i.shift(),{error:t,value:r}=n.shift();t?e.reject(t):e.resolve({done:!1,value:r})}for(;i.length>0&&u;){const{resolve:e}=i.shift();e({done:!0,value:void 0})}}async function h(){if(!u&&!a&&!(n.length>=e)){a=!0;try{const{done:e,value:t}=await r.next();e?u=!0:n.push({value:t})}catch(t){u=!0,n.push({error:t})}c(),a=!1,h()}}async function l(){if(n.length>0){const{error:e,value:t}=n.shift();if(e)throw e;return h(),{done:!1,value:t}}if(u)return{done:!0,value:void 0};const e=s();return i.push(e),h(),e.promise}const f={next:l,[Symbol.asyncIterator]:()=>f};return f}function*u(e,t){const r=[];let n;try{for(const n of t)r.push(n),r.length<=e||(yield r.shift())}catch(i){n=i}for(const o of r)yield o;if(n)throw n}function c(e,t){return void 0===t?t=>c(e,t):0===e?t:t[Symbol.asyncIterator]?a(e,t):u(e,t)}async function h(e){const t=[];for await(const r of e)t.push(r);return t}function l(e){return e[Symbol.asyncIterator]?h(e):Array.from(e)}async function*f(e){for await(const t of e)yield*t}function*d(e){for(const t of e)yield*t}function p(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.find((e=>void 0!==e[Symbol.asyncIterator]))?f(t):d(t)}async function y(e){for await(const t of e);}function g(e){if(e[Symbol.asyncIterator])return y(e);for(const t of e);}async function*m(e,t){for await(const r of t)await e(r)&&(yield r)}function b(e,t){return void 0===t?t=>m(e,t):m(e,t)}async function*v(e){for await(const t of e)t&&"string"!==typeof t&&(t[Symbol.iterator]||t[Symbol.asyncIterator])?yield*v(t):yield t}async function*w(e,t){for await(const r of t)yield await e(r)}function _(e,t){return void 0===t?t=>w(e,t):w(e,t)}function E(e,t){return void 0===t?t=>E(e,t):b((e=>void 0!==e&&null!==e),v(_(e,t)))}function S(e,t,r){const n=o(r),i=[],a=[];let u=!1,c=!1,h=0,l=null;function f(){for(;a.length>0&&i.length>0;){const{resolve:e}=a.shift();e({done:!1,value:i.shift()})}for(;a.length>0&&0===h&&u;){const{resolve:e,reject:t}=a.shift();l?(t(l),l=null):e({done:!0,value:void 0})}}async function d(){if(u)f();else if(!c&&!(h+i.length>=e)){c=!0,h++;try{const{done:e,value:t}=await n.next();e?(u=!0,h--,f()):p(t)}catch(t){u=!0,h--,l=t,f()}c=!1,d()}}async function p(e){try{const r=await t(e);if(r&&r[Symbol.asyncIterator])for await(const e of r)i.push(e);else i.push(r)}catch(r){u=!0,l=r}h--,f(),d()}async function y(){if(0===i.length){const e=s();return a.push(e),d(),e.promise}const e=i.shift();return d(),{done:!1,value:e}}const g={next:y,[Symbol.asyncIterator]:()=>g};return g}function M(e,t,r){return void 0===t?(t,r)=>r?M(e,t,r):M(e,t):void 0===r?r=>M(e,t,r):b((e=>void 0!==e&&null!==e),v(S(e,t,r)))}async function A(e){return new Promise((t=>{e.once("readable",(()=>{t()}))}))}async function*I(e){for(;;){const t=e.read();if(null===t){if(e._readableState.ended)break;await A(e)}else yield t}}function k(e){return"function"===typeof e[Symbol.asyncIterator]?e:I(e)}async function*T(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=new Set(t.map(o));for(;n.size>0;)for(const e of n){const t=await e.next();t.done?n.delete(e):yield t.value}}function R(e){let t=e();for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];for(const o of n)t=o(t);return t}async function*P(e,t,r){let n=null;const i=e=>({value:t(e)}),s=async function*(e){for await(const t of e){if(n)return;yield t}},a=o(R((()=>r),c(1),s,_(i),c(e-1)));for(;;){const{value:e,done:t}=await a.next();if(t)break;try{const t=await e.value;n||(yield t)}catch(u){n=u}}if(n)throw n}function C(e,t,r){return void 0===t?(t,r)=>C(e,t,r):void 0===r?r=>C(e,t,r):1===e?_(t,r):P(e,t,r)}function O(e,t,r){return void 0===t?(t,r)=>r?O(e,t,r):O(e,t):void 0===r?r=>O(e,t,r):b((e=>void 0!==e&&null!==e),v(C(e,t,r)))}async function*x(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=t.map(o),i=new Set,s=new Map;let a=null,u=null,c=null;const h=e=>{a=e,u&&u(e)},l=e=>{c&&c(e)},f=()=>new Promise(((e,t)=>{if(a&&t(a),s.size>0)return e();c=e,u=t})),d=e=>{const t=Promise.resolve(e.next()).then((async r=>{let{done:n,value:o}=r;n||s.set(e,o),i.delete(t)}));i.add(t),t.then(l,h)};for(const o of n)d(o);for(;;){if(0===i.size&&0===s.size)return;await f();for(const[e,t]of s)s.delete(e),yield t,d(e)}}async function B(e,t,r){let n=t;for await(const i of r)n=await e(n,i);return n}function D(e,t,r){return void 0===t?(t,r)=>r?B(e,t,r):D(e,t):void 0===r?r=>D(e,t,r):B(e,t,r)}async function*N(e,t){let r=0;for await(const n of t)if(yield await n,r++,r>=e)break}function*L(e,t){let r=0;for(const n of t)if(yield n,r++,r>=e)break}function K(e,t){return void 0===t?t=>K(e,t):t[Symbol.asyncIterator]?N(e,t):L(e,t)}async function*U(e,t){for await(const r of t)await e(r),yield r}function j(e,t){return void 0===t?t=>U(e,t):U(e,t)}function q(e,t){let r=e[0]+t[0],n=e[1]+t[1];if(n>=1e9){const e=n%1e9;r+=(n-e)/1e9,n=e}return[r,n]}async function*F(e,t){const r=t[Symbol.asyncIterator]();let i=[0,0];for(;;){const t=n.hrtime(),{value:o,done:s}=await r.next(),a=n.hrtime(t);if(i=q(i,a),e.progress&&e.progress(a,i),s)return e.total&&e.total(i),o;yield o}}function*z(e,t){const r=t[Symbol.iterator]();let i=[0,0];for(;;){const t=n.hrtime(),{value:o,done:s}=r.next(),a=n.hrtime(t);if(i=q(i,a),e.progress&&e.progress(a,i),s)return e.total&&e.total(i),o;yield o}}function V(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return void 0===t?t=>V(e,t):void 0!==t[Symbol.asyncIterator]?F(e,t):z(e,t)}function H(e,t,r){const n=o(r),i=[],a=[];let u=!1,c=!1,h=0,l=null;function f(){for(;a.length>0&&i.length>0;){const{resolve:e}=a.shift();e({done:!1,value:i.shift()})}for(;a.length>0&&0===h&&u;){const{resolve:e,reject:t}=a.shift();l?(t(l),l=null):e({done:!0,value:void 0})}}async function d(){if(u)f();else if(!c&&!(h+i.length>=e)){c=!0,h++;try{const{done:e,value:t}=await n.next();e?(u=!0,h--,f()):p(t)}catch(t){u=!0,h--,l=t,f()}c=!1,d()}}async function p(e){try{const r=await t(e);i.push(r)}catch(r){u=!0,l=r}h--,f(),d()}async function y(){if(0===i.length){const e=s();return a.push(e),d(),e.promise}const e=i.shift();return d(),{done:!1,value:e}}const g={next:y,[Symbol.asyncIterator]:()=>g};return g}function G(e,t,r){return void 0===t?(t,r)=>r?G(e,t,r):G(e,t):void 0===r?r=>G(e,t,r):H(e,t,r)}async function W(e,t){let r=null,n=null,i=null;const o=e=>{r=e,n&&n(e)},s=()=>{i&&i()},a=()=>{e.removeListener("error",o),e.removeListener("drain",s)};e.once("error",o);const u=()=>new Promise(((t,o)=>{if(r)return o(r);e.once("drain",s),i=t,n=o}));for await(const c of t)if(!1===e.write(c)&&await u(),r)break;if(a(),r)throw r}function Y(e,t){return void 0===t?t=>W(e,t):W(e,t)}e.batch=i,e.buffer=c,e.collect=l,e.concat=p,e.consume=g,e.filter=b,e.flatMap=E,e.flatTransform=M,e.flatten=v,e.fromStream=k,e.getIterator=o,e.map=_,e.merge=T,e.parallelFlatMap=O,e.parallelMap=C,e.parallelMerge=x,e.pipeline=R,e.reduce=D,e.take=K,e.tap=j,e.time=V,e.transform=G,e.writeToStream=Y,Object.defineProperty(e,"__esModule",{value:!0})}(t)},79516:(e,t,r)=>{"use strict";const{EventEmitter:n}=r(2331),{Multiaddr:i}=r(57604),o=r(96732);e.exports=class extends n{constructor(e){let{listen:t=[],announce:r=[]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.peerId=e,this.listen=new Set(t.map((e=>e.toString()))),this.announce=new Set(r.map((e=>e.toString()))),this.observed=new Set}getListenAddrs(){return Array.from(this.listen).map((e=>new i(e)))}getAnnounceAddrs(){return Array.from(this.announce).map((e=>new i(e)))}getObservedAddrs(){return Array.from(this.observed).map((e=>new i(e)))}addObservedAddr(e){let t=new i(e);const r=t.getPeerId();if(r){o.createFromB58String(r).equals(this.peerId)&&(t=t.decapsulate(new i("/p2p/".concat(this.peerId))))}const n=t.toString();this.observed.has(n)||(this.observed.add(n),this.emit("change:addresses"))}}},22978:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:auto-relay"),{error:n("libp2p:auto-relay:err")}),{fromString:o}=r(98897),{toString:s}=r(60709),{Multiaddr:a}=r(57604),u=r(96732),{relay:c}=r(54122),{canHop:h}=r(25466),{namespaceToCid:l}=r(9208),{CIRCUIT_PROTO_CODE:f,HOP_METADATA_KEY:d,HOP_METADATA_VALUE:p,RELAY_RENDEZVOUS_NS:y}=r(85169);e.exports=class{constructor(e){let{libp2p:t,maxListeners:r=1,onError:n}=e;this._libp2p=t,this._peerId=t.peerId,this._peerStore=t.peerStore,this._connectionManager=t.connectionManager,this._transportManager=t.transportManager,this._addressSorter=t.dialer.addressSorter,this.maxListeners=r,this._listenRelays=new Set,this._onProtocolChange=this._onProtocolChange.bind(this),this._onPeerDisconnected=this._onPeerDisconnected.bind(this),this._peerStore.on("change:protocols",this._onProtocolChange),this._connectionManager.on("peer:disconnect",this._onPeerDisconnected),this._onError=(e,t)=>{i.error(t||e),n&&n(e,t)}}async _onProtocolChange(e){let{peerId:t,protocols:r}=e;const n=t.toB58String(),s=r.find((e=>e===c));if(s||!this._listenRelays.has(n)){if(s&&!this._listenRelays.has(n))try{const e=this._connectionManager.get(t);if(!e)return;if(e.remoteAddr.protoCodes().includes(f))return void i("relayed connection to ".concat(n," will not be used to hop on"));await h({connection:e})&&(this._peerStore.metadataBook.set(t,d,o(p)),await this._addListenRelay(e,n))}catch(a){this._onError(a)}}else this._removeListenRelay(n)}_onPeerDisconnected(e){const t=e.remotePeer.toB58String();this._listenRelays.has(t)&&this._removeListenRelay(t)}async _addListenRelay(e,t){if(this._listenRelays.size>=this.maxListeners)return;const r=this._peerStore.addressBook.getMultiaddrsForPeer(e.remotePeer,this._addressSorter);if(!r||!r.length)return;const n="".concat(r[0].toString(),"/p2p-circuit");this._listenRelays.add(t);try{await this._transportManager.listen([new a(n)])}catch(i){this._onError(i),this._listenRelays.delete(t)}}_removeListenRelay(e){this._listenRelays.delete(e)&&this._listenOnAvailableHopRelays([e])}async _listenOnAvailableHopRelays(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this._listenRelays.size>=this.maxListeners)return;const t=[];for(const[n,i]of this._peerStore.metadataBook.data.entries()){if(this._listenRelays.has(n)||e.includes(n))continue;const r=i.get(d);if(!r||s(r)!==p)continue;const o=u.createFromB58String(n),a=this._connectionManager.get(o);if(a){if(await this._addListenRelay(a,n),this._listenRelays.size>=this.maxListeners)return}else t.push(o)}for(const n of t)if(await this._tryToListenOnRelay(n),this._listenRelays.size>=this.maxListeners)return;try{const e=await l(y);for await(const t of this._libp2p.contentRouting.findProviders(e)){if(!t.multiaddrs.length)continue;const e=t.id;if(this._peerStore.addressBook.add(e,t.multiaddrs),await this._tryToListenOnRelay(e),this._listenRelays.size>=this.maxListeners)return}}catch(r){this._onError(r)}}async _tryToListenOnRelay(e){try{const t=await this._libp2p.dial(e);await this._addListenRelay(t,e.toB58String())}catch(t){this._onError(t,"could not connect and listen on known hop relay ".concat(e.toB58String()))}}}},25466:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:circuit:hop"),{error:n("libp2p:circuit:hop:err")}),o=r(61446),s=r(96732),{validateAddrs:a}=r(7977),u=r(94393),{CircuitRelay:c}=r(16044),{pipe:h}=r(91522),{codes:l}=r(16422),{stop:f}=r(1967),d=r(54122);e.exports={handleHop:async function(e){let{connection:t,request:r,streamHandler:n,circuit:o}=e;if(!o._options.hop.enabled)return i("HOP request received but we are not acting as a relay"),n.end({type:c.Type.STATUS,code:c.Status.HOP_CANT_SPEAK_RELAY});try{a(r,n)}catch(g){return i.error("invalid hop request via peer %s",t.remotePeer.toB58String(),g)}if(!r.dstPeer)return void i("HOP request received but we do not receive a dstPeer");const u=new s(r.dstPeer.id),l=o._connectionManager.get(u);if(!l&&!o._options.hop.active)return i("HOP request received but we are not connected to the destination peer"),n.end({type:c.Type.STATUS,code:c.Status.HOP_NO_CONN_TO_DST});if(!l)return;const d={type:c.Type.STOP,dstPeer:r.dstPeer,srcPeer:r.srcPeer};let p;try{p=await f({connection:l,request:d})}catch(g){return i.error(g)}i("hop request from %s is valid",t.remotePeer.toB58String()),n.write({type:c.Type.STATUS,code:c.Status.SUCCESS});const y=n.rest();return h(y,p,y)},hop:async function(e){let{connection:t,request:r}=e;const{stream:n}=await t.newStream([d.relay]),s=new u({stream:n});s.write(r);const a=await s.read();if(!a)throw o(new Error("HOP request had no response"),l.ERR_HOP_REQUEST_FAILED);if(a.code===c.Status.SUCCESS)return i("hop request was successful"),s.rest();throw i("hop request failed with code %d, closing stream",a.code),s.close(),o(new Error("HOP request failed with code ".concat(a.code)),l.ERR_HOP_REQUEST_FAILED)},canHop:async function(e){let{connection:t}=e;const{stream:r}=await t.newStream([d.relay]),n=new u({stream:r});n.write({type:c.Type.CAN_HOP});const i=await n.read();return await n.close(),!(!i||i.code!==c.Status.SUCCESS)},handleCanHop:function(e){let{connection:t,streamHandler:r,circuit:n}=e;const o=n._options.hop.enabled;i("can hop (%s) request from %s",o,t.remotePeer.toB58String()),r.end({type:c.Type.STATUS,code:o?c.Status.SUCCESS:c.Status.HOP_CANT_SPEAK_RELAY})}}},1967:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:circuit:stop"),{error:n("libp2p:circuit:stop:err")}),{CircuitRelay:o}=r(16044),s=r(54122),a=r(94393),{validateAddrs:u}=r(7977);e.exports.handleStop=function(e){let{connection:t,request:r,streamHandler:n}=e;try{u(r,n)}catch(s){return i.error("invalid stop request via peer %s",t.remotePeer.toB58String(),s)}return i("stop request is valid"),n.write({type:o.Type.STATUS,code:o.Status.SUCCESS}),n.rest()},e.exports.stop=async function(e){let{connection:t,request:r}=e;const{stream:n}=await t.newStream([s.relay]);i("starting stop request to %s",t.remotePeer.toB58String());const u=new a({stream:n});u.write(r);const c=await u.read();return c?c.code===o.Status.SUCCESS?(i("stop request to %s was successful",t.remotePeer.toB58String()),u.rest()):(i("stop request failed with code %d",c.code),void u.close()):u.close()}},94393:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:circuit:stream-handler"),{error:n("libp2p:circuit:stream-handler:err")}),o=r(4666),s=r(16389),{CircuitRelay:a}=r(16044);e.exports=class{constructor(e){let{stream:t,maxLength:r=4096}=e;this.stream=t,this.shake=s(this.stream),this.decoder=o.decode.fromReader(this.shake.reader,{maxDataLength:r})}async read(){const e=await this.decoder.next();if(e.value){const t=a.decode(e.value.slice());return i("read message type",t.type),t}i("read received no value, closing stream"),this.close()}write(e){i("write message type %s",e.type),this.shake.write(o.encode.single(a.encode(e).finish()))}rest(){return this.shake.rest(),this.shake.stream}end(e){this.write(e),this.close()}close(){i("closing the stream"),this.rest().sink([])}}},7977:(e,t,r)=>{"use strict";const{Multiaddr:n}=r(57604),{CircuitRelay:i}=r(16044);function o(e,t){e.write({type:i.Type.STATUS,code:t})}e.exports={validateAddrs:function(e,t){try{e.dstPeer&&e.dstPeer.addrs&&e.dstPeer.addrs.forEach((e=>new n(e)))}catch(r){throw o(t,e.type===i.Type.HOP?i.Status.HOP_DST_MULTIADDR_INVALID:i.Status.STOP_DST_MULTIADDR_INVALID),r}try{e.srcPeer&&e.srcPeer.addrs&&e.srcPeer.addrs.forEach((e=>new n(e)))}catch(r){throw o(t,e.type===i.Type.HOP?i.Status.HOP_SRC_MULTIADDR_INVALID:i.Status.STOP_SRC_MULTIADDR_INVALID),r}}}},85169:e=>{"use strict";e.exports={ADVERTISE_BOOT_DELAY:9e5,ADVERTISE_TTL:18e5,CIRCUIT_PROTO_CODE:290,HOP_METADATA_KEY:"hop_relay",HOP_METADATA_VALUE:"true",RELAY_RENDEZVOUS_NS:"/libp2p/relay"}},21877:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:relay"),{error:n("libp2p:relay:err")}),{setDelayedInterval:o,clearDelayedInterval:s}=r(22798),a=r(22978),{namespaceToCid:u}=r(9208),{RELAY_RENDEZVOUS_NS:c}=r(85169);e.exports=class{constructor(e){this._libp2p=e,this._options={...e._config.relay},this._autoRelay=this._options.autoRelay.enabled&&new a({libp2p:e,...this._options.autoRelay}),this._advertiseService=this._advertiseService.bind(this)}start(){this._options.hop.enabled&&this._options.advertise.enabled&&(this._timeout=o(this._advertiseService,this._options.advertise.ttl,this._options.advertise.bootDelay))}stop(){s(this._timeout)}async _advertiseService(){try{const e=await u(c);await this._libp2p.contentRouting.provide(e)}catch(e){"NO_ROUTERS_AVAILABLE"===e.code?(i.error("a content router, such as a DHT, must be provided in order to advertise the relay service",e),this.stop()):i.error(e)}}}},76481:(e,t,r)=>{"use strict";const{EventEmitter:n}=r(2331),{Multiaddr:i}=r(57604);e.exports=e=>{const t=new Map;const r=Object.assign(new n,{close:()=>Promise.resolve(),listen:async function(n){const o=String(n).split("/p2p-circuit").find((e=>""!==e)),s=await e.dial(new i(o)),a=s.remoteAddr.encapsulate("/p2p-circuit");t.set(s.remotePeer.toB58String(),a),r.emit("listening")},getAddrs:function(){const e=[];for(const r of t.values())e.push(r);return e}});return e.connectionManager.on("peer:disconnect",(e=>{t.delete(e.remotePeer.toB58String())&&r.emit("close")})),r}},54122:e=>{"use strict";e.exports={relay:"/libp2p/circuit/relay/0.1.0"}},16044:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-circuit"]||(n.roots["libp2p-circuit"]={});a.CircuitRelay=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.type=1,e.prototype.srcPeer=null,e.prototype.dstPeer=null,e.prototype.code=100,e.encode=function(e,t){return t||(t=o.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).int32(e.type),null!=e.srcPeer&&Object.hasOwnProperty.call(e,"srcPeer")&&a.CircuitRelay.Peer.encode(e.srcPeer,t.uint32(18).fork()).ldelim(),null!=e.dstPeer&&Object.hasOwnProperty.call(e,"dstPeer")&&a.CircuitRelay.Peer.encode(e.dstPeer,t.uint32(26).fork()).ldelim(),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(32).int32(e.code),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.CircuitRelay;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.type=e.int32();break;case 2:n.srcPeer=a.CircuitRelay.Peer.decode(e,e.uint32());break;case 3:n.dstPeer=a.CircuitRelay.Peer.decode(e,e.uint32());break;case 4:n.code=e.int32();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.CircuitRelay)return e;var t=new a.CircuitRelay;switch(e.type){case"HOP":case 1:t.type=1;break;case"STOP":case 2:t.type=2;break;case"STATUS":case 3:t.type=3;break;case"CAN_HOP":case 4:t.type=4}if(null!=e.srcPeer){if("object"!==typeof e.srcPeer)throw TypeError(".CircuitRelay.srcPeer: object expected");t.srcPeer=a.CircuitRelay.Peer.fromObject(e.srcPeer)}if(null!=e.dstPeer){if("object"!==typeof e.dstPeer)throw TypeError(".CircuitRelay.dstPeer: object expected");t.dstPeer=a.CircuitRelay.Peer.fromObject(e.dstPeer)}switch(e.code){case"SUCCESS":case 100:t.code=100;break;case"HOP_SRC_ADDR_TOO_LONG":case 220:t.code=220;break;case"HOP_DST_ADDR_TOO_LONG":case 221:t.code=221;break;case"HOP_SRC_MULTIADDR_INVALID":case 250:t.code=250;break;case"HOP_DST_MULTIADDR_INVALID":case 251:t.code=251;break;case"HOP_NO_CONN_TO_DST":case 260:t.code=260;break;case"HOP_CANT_DIAL_DST":case 261:t.code=261;break;case"HOP_CANT_OPEN_DST_STREAM":case 262:t.code=262;break;case"HOP_CANT_SPEAK_RELAY":case 270:t.code=270;break;case"HOP_CANT_RELAY_TO_SELF":case 280:t.code=280;break;case"STOP_SRC_ADDR_TOO_LONG":case 320:t.code=320;break;case"STOP_DST_ADDR_TOO_LONG":case 321:t.code=321;break;case"STOP_SRC_MULTIADDR_INVALID":case 350:t.code=350;break;case"STOP_DST_MULTIADDR_INVALID":case 351:t.code=351;break;case"STOP_RELAY_REFUSED":case 390:t.code=390;break;case"MALFORMED_MESSAGE":case 400:t.code=400}return t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type=t.enums===String?"HOP":1,r.srcPeer=null,r.dstPeer=null,r.code=t.enums===String?"SUCCESS":100),null!=e.type&&e.hasOwnProperty("type")&&(r.type=t.enums===String?a.CircuitRelay.Type[e.type]:e.type),null!=e.srcPeer&&e.hasOwnProperty("srcPeer")&&(r.srcPeer=a.CircuitRelay.Peer.toObject(e.srcPeer,t)),null!=e.dstPeer&&e.hasOwnProperty("dstPeer")&&(r.dstPeer=a.CircuitRelay.Peer.toObject(e.dstPeer,t)),null!=e.code&&e.hasOwnProperty("code")&&(r.code=t.enums===String?a.CircuitRelay.Status[e.code]:e.code),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.Status=function(){var e={},t=Object.create(e);return t[e[100]="SUCCESS"]=100,t[e[220]="HOP_SRC_ADDR_TOO_LONG"]=220,t[e[221]="HOP_DST_ADDR_TOO_LONG"]=221,t[e[250]="HOP_SRC_MULTIADDR_INVALID"]=250,t[e[251]="HOP_DST_MULTIADDR_INVALID"]=251,t[e[260]="HOP_NO_CONN_TO_DST"]=260,t[e[261]="HOP_CANT_DIAL_DST"]=261,t[e[262]="HOP_CANT_OPEN_DST_STREAM"]=262,t[e[270]="HOP_CANT_SPEAK_RELAY"]=270,t[e[280]="HOP_CANT_RELAY_TO_SELF"]=280,t[e[320]="STOP_SRC_ADDR_TOO_LONG"]=320,t[e[321]="STOP_DST_ADDR_TOO_LONG"]=321,t[e[350]="STOP_SRC_MULTIADDR_INVALID"]=350,t[e[351]="STOP_DST_MULTIADDR_INVALID"]=351,t[e[390]="STOP_RELAY_REFUSED"]=390,t[e[400]="MALFORMED_MESSAGE"]=400,t}(),e.Type=function(){var e={},t=Object.create(e);return t[e[1]="HOP"]=1,t[e[2]="STOP"]=2,t[e[3]="STATUS"]=3,t[e[4]="CAN_HOP"]=4,t}(),e.Peer=function(){function e(e){if(this.addrs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.id=s.newBuffer([]),e.prototype.addrs=s.emptyArray,e.encode=function(e,t){if(t||(t=o.create()),t.uint32(10).bytes(e.id),null!=e.addrs&&e.addrs.length)for(var r=0;r<e.addrs.length;++r)t.uint32(18).bytes(e.addrs[r]);return t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.CircuitRelay.Peer;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.addrs&&n.addrs.length||(n.addrs=[]),n.addrs.push(e.bytes());break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("id"))throw s.ProtocolError("missing required 'id'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.CircuitRelay.Peer)return e;var t=new a.CircuitRelay.Peer;if(null!=e.id&&("string"===typeof e.id?s.base64.decode(e.id,t.id=s.newBuffer(s.base64.length(e.id)),0):e.id.length&&(t.id=e.id)),e.addrs){if(!Array.isArray(e.addrs))throw TypeError(".CircuitRelay.Peer.addrs: array expected");t.addrs=[];for(var r=0;r<e.addrs.length;++r)"string"===typeof e.addrs[r]?s.base64.decode(e.addrs[r],t.addrs[r]=s.newBuffer(s.base64.length(e.addrs[r])),0):e.addrs[r].length&&(t.addrs[r]=e.addrs[r])}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.addrs=[]),t.defaults&&(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=s.newBuffer(r.id)))),null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?s.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),e.addrs&&e.addrs.length){r.addrs=[];for(var n=0;n<e.addrs.length;++n)r.addrs[n]=t.bytes===String?s.base64.encode(e.addrs[n],0,e.addrs[n].length):t.bytes===Array?Array.prototype.slice.call(e.addrs[n]):e.addrs[n]}return r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e.exports=a},50789:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:circuit"),{error:n("libp2p:circuit:err")}),o=r(61446),s=r(27862),{Multiaddr:a}=r(57604),u=r(96732),{CircuitRelay:c}=r(16044),{codes:h}=r(16422),l=r(51972),{relay:f}=r(54122),d=r(76481),{handleCanHop:p,handleHop:y,hop:g}=r(25466),{handleStop:m}=r(1967),b=r(94393),v=Symbol.for("@libp2p/js-libp2p-circuit/circuit");class w{constructor(e){let{libp2p:t,upgrader:r}=e;this._dialer=t.dialer,this._registrar=t.registrar,this._connectionManager=t.connectionManager,this._upgrader=r,this._options=t._config.relay,this._libp2p=t,this.peerId=t.peerId,this._registrar.handle(f,this._onProtocol.bind(this))}async _onProtocol(e){let{connection:t,stream:r}=e;const n=new b({stream:r}),o=await n.read();if(!o)return;const s=this;let u;switch(o.type){case c.Type.CAN_HOP:i("received CAN_HOP request from %s",t.remotePeer.toB58String()),await p({circuit:s,connection:t,streamHandler:n});break;case c.Type.HOP:i("received HOP request from %s",t.remotePeer.toB58String()),u=await y({connection:t,request:o,streamHandler:n,circuit:s});break;case c.Type.STOP:i("received STOP request from %s",t.remotePeer.toB58String()),u=await m({connection:t,request:o,streamHandler:n});break;default:i("Request of type %s not supported",o.type)}if(u){const e=new a(o.dstPeer.addrs[0]),t=new a(o.srcPeer.addrs[0]),r=l({stream:u,remoteAddr:e,localAddr:t}),n=o.type===c.Type.HOP?"relay":"inbound";i("new %s connection %s",n,r.remoteAddr);const s=await this._upgrader.upgradeInbound(r);i("%s connection %s upgraded",n,r.remoteAddr),this.handler&&this.handler(s)}}async dial(e,t){const r=e.toString().split("/p2p-circuit"),n=new a(r[0]),s=new a(r[r.length-1]),f=n.getPeerId(),d=s.getPeerId();if(!f||!d){const e="Circuit relay dial failed as addresses did not have peer id";throw i.error(e),o(new Error(e),h.ERR_RELAYED_DIAL)}const p=u.createFromB58String(f),y=u.createFromB58String(d);let m=!1,b=this._connectionManager.get(p);b||(b=await this._dialer.connectToPeer(n,t),m=!0);try{const t=await g({connection:b,request:{type:c.Type.HOP,srcPeer:{id:this.peerId.toBytes(),addrs:this._libp2p.multiaddrs.map((e=>e.bytes))},dstPeer:{id:y.toBytes(),addrs:[new a(s).bytes]}}}),r=n.encapsulate("/p2p-circuit/p2p/".concat(this.peerId.toB58String())),o=l({stream:t,remoteAddr:e,localAddr:r});return i("new outbound connection %s",o.remoteAddr),this._upgrader.upgradeOutbound(o)}catch(v){throw i.error("Circuit relay dial failed",v),m&&await b.close(),v}}createListener(e,t){return"function"===typeof e&&(t=e,e={}),this.handler=t,d(this._libp2p)}filter(e){return(e=Array.isArray(e)?e:[e]).filter((e=>s.Circuit.matches(e)))}get[Symbol.toStringTag](){return"Circuit"}static isTransport(e){return Boolean(e&&e[v])}}e.exports=w},9208:(e,t,r)=>{"use strict";const{CID:n}=r(91759),{sha256:i}=r(27678);e.exports.namespaceToCid=async e=>{const t=(new TextEncoder).encode(e),r=await i.digest(t);return n.createV0(r)}},92243:(e,t,r)=>{"use strict";const n=r(54582),{dnsaddrResolver:i}=r(56776),o=r(91330),{AGENT_VERSION:s}=r(10430),a=r(85169),{publicAddressesFirst:u}=r(92646),{FaultTolerance:c}=r(48610),h={addresses:{listen:[],announce:[],noAnnounce:[],announceFilter:e=>e},connectionManager:{minConnections:25},transportManager:{faultTolerance:c.FATAL_ALL},dialer:{maxParallelDials:o.MAX_PARALLEL_DIALS,maxDialsPerPeer:o.MAX_PER_PEER_DIALS,dialTimeout:o.DIAL_TIMEOUT,resolvers:{dnsaddr:i},addressSorter:u},host:{agentVersion:s},metrics:{enabled:!1},peerStore:{persistence:!1,threshold:5},peerRouting:{refreshManager:{enabled:!0,interval:6e5,bootDelay:1e4}},config:{protocolPrefix:"ipfs",dht:{enabled:!1,kBucketSize:20,randomWalk:{enabled:!1,queriesPerPeriod:1,interval:3e5,timeout:1e4}},nat:{enabled:!0,ttl:7200,keepAlive:!0,gateway:null,externalIp:null,pmp:{enabled:!1}},peerDiscovery:{autoDial:!0},pubsub:{enabled:!0},relay:{enabled:!0,advertise:{bootDelay:a.ADVERTISE_BOOT_DELAY,enabled:!1,ttl:a.ADVERTISE_TTL},hop:{enabled:!1,active:!1},autoRelay:{enabled:!1,maxListeners:2}},transport:{}}};e.exports.validate=e=>{const t=n(h,e);if(t.modules.transport.length<1)throw new Error("'options.modules.transport' must contain at least 1 transport");return t}},7139:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:connection-manager"),{error:n("libp2p:connection-manager:err")}),o=r(61446),s=r(54582),a=r(12136),u=r(79881),{EventEmitter:c}=r(2331),h=r(96732),{codes:{ERR_INVALID_PARAMETERS:l}}=r(16422),f={maxConnections:1/0,minConnections:0,maxData:1/0,maxSentData:1/0,maxReceivedData:1/0,maxEventLoopDelay:1/0,pollInterval:2e3,autoDialInterval:1e4,movingAverageInterval:6e4,defaultPeerValue:1};e.exports=class extends c{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this._libp2p=e,this._peerId=e.peerId.toB58String(),this._options=s.call({ignoreUndefined:!0},f,t),this._options.maxConnections<this._options.minConnections)throw o(new Error("Connection Manager maxConnections must be greater than minConnections"),l);i("options: %j",this._options),this._peerValues=new Map,this.connections=new Map,this._started=!1,this._timer=null,this._autoDialTimeout=null,this._checkMetrics=this._checkMetrics.bind(this),this._autoDial=this._autoDial.bind(this),this._latencyMonitor=new a({latencyCheckIntervalMs:this._options.pollInterval,dataEmitIntervalMs:this._options.pollInterval})}get size(){return Array.from(this.connections.values()).reduce(((e,t)=>e+t.length),0)}start(){this._libp2p.metrics&&(this._timer=this._timer||u(this._checkMetrics,this._options.pollInterval)),this._latencyMonitor.start(),this._onLatencyMeasure=this._onLatencyMeasure.bind(this),this._latencyMonitor.on("data",this._onLatencyMeasure),this._started=!0,i("started"),this._options.autoDial&&this._autoDial()}async stop(){this._autoDialTimeout&&this._autoDialTimeout.clear(),this._timer&&this._timer.clear(),this._latencyMonitor.removeListener("data",this._onLatencyMeasure),this._latencyMonitor.stop(),this._started=!1,await this._close(),i("stopped")}async _close(){const e=[];for(const t of this.connections.values())for(const r of t)e.push(r.close());await Promise.all(e),this.connections.clear()}setPeerValue(e,t){if(t<0||t>1)throw new Error("value should be a number between 0 and 1");this._peerValues.set(e.toB58String(),t)}_checkMetrics(){if(this._libp2p.metrics){const e=this._libp2p.metrics.global.movingAverages,t=e.dataReceived[this._options.movingAverageInterval].movingAverage();this._checkMaxLimit("maxReceivedData",t);const r=e.dataSent[this._options.movingAverageInterval].movingAverage();this._checkMaxLimit("maxSentData",r);const n=t+r;this._checkMaxLimit("maxData",n),i("metrics update",n),this._timer=u(this._checkMetrics,this._options.pollInterval)}}onConnect(e){const t=e.remotePeer,r=t.toB58String(),n=this.connections.get(r);this.emit("peer:connect",e),n?n.push(e):this.connections.set(r,[e]),this._libp2p.peerStore.keyBook.set(t,t.pubKey),this._peerValues.has(r)||this._peerValues.set(r,this._options.defaultPeerValue),this._checkMaxLimit("maxConnections",this.size)}onDisconnect(e){const t=e.remotePeer.toB58String();let r=this.connections.get(t);r&&r.length>1?(r=r.filter((t=>t.id!==e.id)),this.connections.set(t,r)):r&&(this.connections.delete(t),this._peerValues.delete(e.remotePeer.toB58String()),this.emit("peer:disconnect",e))}get(e){const t=this.getAll(e);return t.length?t[0]:null}getAll(e){if(!h.isPeerId(e))throw o(new Error("peerId must be an instance of peer-id"),l);const t=e.toB58String(),r=this.connections.get(t);return r?r.filter((e=>"open"===e.stat.status)):[]}_onLatencyMeasure(e){this._checkMaxLimit("maxEventLoopDelay",e.avgMs)}_checkMaxLimit(e,t){const r=this._options[e];i("checking limit of %s. current value: %d of %d",e,t,r),t>r&&(i("%s: limit exceeded: %s, %d",this._peerId,e,t),this._maybeDisconnectOne())}async _autoDial(){const e=this._options.minConnections;if(this.size>=e)return void(this._autoDialTimeout=u(this._autoDial,this._options.autoDialInterval));const t=Array.from(this._libp2p.peerStore.peers.values()).sort(((e,t)=>!t.protocols||!t.protocols.length||e.protocols&&e.protocols.length?t.id.pubKey&&!e.id.pubKey?1:-1:1));for(let n=0;n<t.length&&this.size<e;n++)if(!this.get(t[n].id)){i("connecting to a peerStore stored peer %s",t[n].id.toB58String());try{if(await this._libp2p.dialer.connectToPeer(t[n].id),!this._started)return}catch(r){i.error("could not connect to peerStore stored peer",r)}}this._autoDialTimeout=u(this._autoDial,this._options.autoDialInterval)}_maybeDisconnectOne(){if(this._options.minConnections<this.connections.size){const e=Array.from(new Map([...this._peerValues.entries()].sort(((e,t)=>e[1]-t[1]))));i("%s: sorted peer values: %j",this._peerId,e);const t=e[0];if(t){const e=t[0];i("%s: lowest value peer is %s",this._peerId,e),i("%s: closing a connection to %j",this._peerId,e);for(const t of this.connections.values())if(t[0].remotePeer.toB58String()===e){t[0].close();break}}}}}},12136:(e,t,r)=>{"use strict";const{EventEmitter:n}=r(2331),i=r(83275),o=r(39287)("latency-monitor:LatencyMonitor");e.exports=class extends n{constructor(){let{latencyCheckIntervalMs:e,dataEmitIntervalMs:t,asyncTestFn:r,latencyRandomPercentage:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();const i=this;i.latencyCheckIntervalMs=e||500,i.latencyRandomPercentage=n||10,i._latecyCheckMultiply=i.latencyRandomPercentage/100*2*i.latencyCheckIntervalMs,i._latecyCheckSubtract=i._latecyCheckMultiply/2,i.dataEmitIntervalMs=null===t||0===t?void 0:t||5e3,o("latencyCheckIntervalMs: %s dataEmitIntervalMs: %s",i.latencyCheckIntervalMs,i.dataEmitIntervalMs),i.dataEmitIntervalMs?o("Expecting ~%s events per summary",i.latencyCheckIntervalMs/i.dataEmitIntervalMs):o("Not emitting summaries"),i.asyncTestFn=r}start(){globalThis.process&&globalThis.process.hrtime?(o("Using process.hrtime for timing"),this.now=globalThis.process.hrtime,this.getDeltaMS=e=>{const t=this.now(e);return 1e3*t[0]+t[1]/1e6}):"undefined"!==typeof window&&window.performance&&window.performance.now?(o("Using performance.now for timing"),this.now=window.performance.now.bind(window.performance),this.getDeltaMS=e=>Math.round(this.now()-e)):(o("Using Date.now for timing"),this.now=Date.now,this.getDeltaMS=e=>this.now()-e),this._latencyData=this._initLatencyData(),"undefined"!==typeof window&&(this._visibilityChangeEmitter=new i,this._visibilityChangeEmitter.on("visibilityChange",(e=>{e?this._startTimers():(this._emitSummary(),this._stopTimers())}))),this._visibilityChangeEmitter&&!this._visibilityChangeEmitter.isVisible()||this._startTimers()}stop(){this._stopTimers()}_startTimers(){this._checkLatencyID||(this._checkLatency(),this.dataEmitIntervalMs&&(this._emitIntervalID=setInterval((()=>this._emitSummary()),this.dataEmitIntervalMs),"function"===typeof this._emitIntervalID.unref&&this._emitIntervalID.unref()))}_stopTimers(){this._checkLatencyID&&(clearTimeout(this._checkLatencyID),this._checkLatencyID=void 0),this._emitIntervalID&&(clearInterval(this._emitIntervalID),this._emitIntervalID=void 0)}_emitSummary(){const e=this.getSummary();e.events>0&&this.emit("data",e)}getSummary(){const e={events:this._latencyData.events,minMs:this._latencyData.minMs,maxMs:this._latencyData.maxMs,avgMs:this._latencyData.events?this._latencyData.totalMs/this._latencyData.events:Number.POSITIVE_INFINITY,lengthMs:this.getDeltaMS(this._latencyData.startTime)};return this._latencyData=this._initLatencyData(),o("Summary: %O",e),e}_checkLatency(){const e=this,t=Math.random()*e._latecyCheckMultiply-e._latecyCheckSubtract,r={deltaOffset:Math.ceil(e.latencyCheckIntervalMs+t),startTime:e.now()},n=()=>{if(!this._checkLatencyID)return;const t=e.getDeltaMS(r.startTime)-r.deltaOffset;e._checkLatency(),e._latencyData.events++,e._latencyData.minMs=Math.min(e._latencyData.minMs,t),e._latencyData.maxMs=Math.max(e._latencyData.maxMs,t),e._latencyData.totalMs+=t,o("MS: %s Data: %O",t,e._latencyData)};o("localData: %O",r),this._checkLatencyID=setTimeout((()=>{e.asyncTestFn?(r.deltaOffset=0,r.startTime=e.now(),e.asyncTestFn(n)):(r.deltaOffset-=1,n())}),r.deltaOffset),"function"===typeof this._checkLatencyID.unref&&this._checkLatencyID.unref()}_initLatencyData(){return{startTime:this.now(),minMs:Number.POSITIVE_INFINITY,maxMs:Number.NEGATIVE_INFINITY,events:0,totalMs:0}}}},83275:(e,t,r)=>{"use strict";const{EventEmitter:n}=r(2331),i=r(39287)("latency-monitor:VisibilityChangeEmitter");e.exports=class extends n{constructor(){super(),"undefined"!==typeof document?(this._initializeVisibilityVarNames(),this._addVisibilityChangeListener()):i('This is not a browser, no "document" found. Stopping.')}_initializeVisibilityVarNames(){let e,t;"undefined"!==typeof document.hidden?(e="hidden",t="visibilitychange"):"undefined"!==typeof document.mozHidden?(e="mozHidden",t="mozvisibilitychange"):"undefined"!==typeof document.msHidden?(e="msHidden",t="msvisibilitychange"):"undefined"!==typeof document.webkitHidden&&(e="webkitHidden",t="webkitvisibilitychange"),this._hidden=e,this._visibilityChange=t}_addVisibilityChangeListener(){"undefined"===typeof document.addEventListener||"undefined"===typeof document[this._hidden]?i("Checking page visibility requires a browser that supports the Page Visibility API."):document.addEventListener(this._visibilityChange,this._handleVisibilityChange.bind(this),!1)}isVisible(){if(void 0!==this._hidden&&void 0!==document[this._hidden])return!document[this._hidden]}_handleVisibilityChange(){const e=!document[this._hidden];i(e?"Page Visible":"Page Hidden"),this.emit("visibilityChange",e)}}},91330:e=>{"use strict";e.exports={DIAL_TIMEOUT:3e4,MAX_PARALLEL_DIALS:100,MAX_PER_PEER_DIALS:4,MAX_ADDRS_TO_DIAL:25,METRICS:{computeThrottleMaxQueueSize:1e3,computeThrottleTimeout:2e3,movingAverageIntervals:[6e4,3e5,9e5],maxOldPeersRetention:50}}},18741:(e,t,r)=>{"use strict";const n=r(61446),{messages:i,codes:o}=r(16422),{storeAddresses:s,uniquePeers:a,requirePeers:u,maybeLimitSource:c}=r(99418),h=r(61960),{pipe:l}=r(91522);e.exports=class{constructor(e){this.libp2p=e,this.routers=e._modules.contentRouting||[],this.dht=e._dht,this.dht&&e._config.dht.enabled&&this.routers.push(this.dht)}async*findProviders(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.routers.length)throw n(new Error("No content this.routers available"),"NO_ROUTERS_AVAILABLE");yield*l(h(...this.routers.map((r=>r.findProviders(e,t)))),(e=>s(e,this.libp2p.peerStore)),(e=>a(e)),(e=>c(e,t.maxNumProviders)),(e=>u(e)))}async provide(e){if(!this.routers.length)throw n(new Error("No content routers available"),"NO_ROUTERS_AVAILABLE");await Promise.all(this.routers.map((t=>t.provide(e))))}put(e,t,r){if(!this.libp2p.isStarted()||!this.dht.isStarted)throw n(new Error(i.NOT_STARTED_YET),o.DHT_NOT_STARTED);return this.dht.put(e,t,r)}get(e,t){if(!this.libp2p.isStarted()||!this.dht.isStarted)throw n(new Error(i.NOT_STARTED_YET),o.DHT_NOT_STARTED);return this.dht.get(e,t)}async getMany(e,t,r){if(!this.libp2p.isStarted()||!this.dht.isStarted)throw n(new Error(i.NOT_STARTED_YET),o.DHT_NOT_STARTED);return this.dht.getMany(e,t,r)}}},99418:(e,t,r)=>{"use strict";const n=r(61446),i=r(60721),o=r(1869),s=r(24264);e.exports={storeAddresses:function(e,t){return o(e,(e=>(t.addressBook.add(e.id,e.multiaddrs),e)))},uniquePeers:function(e){const t=new Set;return i(e,(e=>!t.has(e.id.toString())&&(t.add(e.id.toString()),!0)))},requirePeers:async function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=0;for await(const n of e)r++,yield n;if(r<t)throw n(new Error("not found"),"NOT_FOUND")},maybeLimitSource:function(e,t){return t?s(e,t):e}}},37486:(e,t,r)=>{"use strict";const n=r(61446),i=r(90834).default,{anySignal:o}=r(93958),s=r(57863),a=r(27450);e.exports=class{constructor(e){let{addrs:t,dialAction:r,dialer:n}=e;this.addrs=t,this.dialer=n,this.dialAction=r}async run(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.dialer.getTokens(this.addrs.length);if(t.length<1)throw n(new Error("No dial tokens available"),"ERR_NO_DIAL_TOKENS");const r=new s;t.forEach((e=>r.push(e)));const u=this.addrs.map((()=>new i));let c=0;try{return await a(this.addrs.map((async(n,i)=>{const s=await r.shift();let a;try{const h=u[i].signal;a=await this.dialAction(n,{...e,signal:e.signal?o([h,e.signal]):h}),u.splice(i,1)}finally{c++,this.addrs.length-c>=t.length?r.push(s):this.dialer.releaseToken(t.splice(t.indexOf(s),1)[0])}return a})))}finally{u.map((e=>e.abort())),t.forEach((e=>this.dialer.releaseToken(e)))}}}},15274:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:dialer"),{error:n("libp2p:dialer:err")}),o=r(61446),{Multiaddr:s}=r(57604),a=r(80702),{AbortError:u}=r(1315),{anySignal:c}=r(93958),h=r(37486),{publicAddressesFirst:l}=r(92646),f=r(99925),{codes:d}=r(16422),{DIAL_TIMEOUT:p,MAX_PARALLEL_DIALS:y,MAX_PER_PEER_DIALS:g,MAX_ADDRS_TO_DIAL:m}=r(91330);e.exports=class{constructor(e){let{transportManager:t,peerStore:r,addressSorter:n=l,maxParallelDials:i=y,maxAddrsToDial:o=m,dialTimeout:a=p,maxDialsPerPeer:u=g,resolvers:c={}}=e;this.transportManager=t,this.peerStore=r,this.addressSorter=n,this.maxParallelDials=i,this.maxAddrsToDial=o,this.timeout=a,this.maxDialsPerPeer=u,this.tokens=[...new Array(i)].map(((e,t)=>t)),this._pendingDials=new Map,this._pendingDialTargets=new Map;for(const[h,l]of Object.entries(c))s.resolvers.set(h,l)}destroy(){for(const t of this._pendingDials.values())try{t.controller.abort()}catch(e){i.error(e)}this._pendingDials.clear();for(const t of this._pendingDialTargets.values())t.reject(new u("Dialer was destroyed"));this._pendingDialTargets.clear()}async connectToPeer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=await this._createCancellableDialTarget(e);if(!r.addrs.length)throw o(new Error("The dial request has no valid addresses"),d.ERR_NO_VALID_ADDRESSES);const n=this._pendingDials.get(r.id)||this._createPendingDial(r,t);try{const e=await n.promise;return i("dial succeeded to %s",r.id),e}catch(s){throw n.controller.signal.aborted&&(s.code=d.ERR_TIMEOUT),i.error(s),s}finally{n.destroy()}}async _createCancellableDialTarget(e){const t="".concat(parseInt(String(1e9*Math.random()),10).toString()+Date.now()),r=new Promise(((e,r)=>{this._pendingDialTargets.set(t,{resolve:e,reject:r})})),n=await Promise.race([this._createDialTarget(e),r]);return this._pendingDialTargets.delete(t),n}async _createDialTarget(e){const{id:t,multiaddrs:r}=f(e);r&&this.peerStore.addressBook.add(t,r);let n=this.peerStore.addressBook.getMultiaddrsForPeer(t,this.addressSorter)||[];s.isMultiaddr(e)&&(n=n.filter((t=>!e.equals(t))),n.unshift(e));const i=[];for(const o of n){(await this._resolve(o)).forEach((e=>i.push(e)))}const a=i.filter((e=>this.transportManager.transportForMultiaddr(e)));if(a.length>this.maxAddrsToDial)throw this.peerStore.delete(t),o(new Error("dial with more addresses than allowed"),d.ERR_TOO_MANY_ADDRESSES);return{id:t.toB58String(),addrs:a}}_createPendingDial(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=new h({addrs:e.addrs,dialAction:(e,t)=>{if(t.signal.aborted)throw o(new Error("already aborted"),d.ERR_ALREADY_ABORTED);return this.transportManager.dial(e,t)},dialer:this}),n=new a(this.timeout),i=[n.signal];t.signal&&i.push(t.signal);const s=c(i),u={dialRequest:r,controller:n,promise:r.run({...t,signal:s}),destroy:()=>{n.clear(),this._pendingDials.delete(e.id)}};return this._pendingDials.set(e.id,u),u}getTokens(e){const t=Math.min(e,this.maxDialsPerPeer,this.tokens.length),r=this.tokens.splice(0,t);return i("%d tokens request, returning %d, %d remaining",e,t,this.tokens.length),r}releaseToken(e){this.tokens.indexOf(e)>-1||(i("token %d released",e),this.tokens.push(e))}async _resolve(e){if(!e.protoNames().includes("dnsaddr"))return[e];const t=await this._resolveRecord(e);return(await Promise.all(t.map((e=>this._resolve(e))))).flat().reduce(((e,t)=>(e.find((e=>e.equals(t)))||e.push(t),e)),[])}async _resolveRecord(e){try{e=new s(e.toString());return await e.resolve()}catch(t){return i.error("multiaddr ".concat(e," could not be resolved")),[]}}}},16422:(e,t)=>{"use strict";t.messages={NOT_STARTED_YET:"The libp2p node is not started yet",DHT_DISABLED:"DHT is not available",CONN_ENCRYPTION_REQUIRED:"At least one connection encryption module is required"},t.codes={DHT_DISABLED:"ERR_DHT_DISABLED",PUBSUB_NOT_STARTED:"ERR_PUBSUB_NOT_STARTED",DHT_NOT_STARTED:"ERR_DHT_NOT_STARTED",CONN_ENCRYPTION_REQUIRED:"ERR_CONN_ENCRYPTION_REQUIRED",ERR_INVALID_PROTOCOLS_FOR_STREAM:"ERR_INVALID_PROTOCOLS_FOR_STREAM",ERR_CONNECTION_ENDED:"ERR_CONNECTION_ENDED",ERR_CONNECTION_FAILED:"ERR_CONNECTION_FAILED",ERR_NODE_NOT_STARTED:"ERR_NODE_NOT_STARTED",ERR_ALREADY_ABORTED:"ERR_ALREADY_ABORTED",ERR_TOO_MANY_ADDRESSES:"ERR_TOO_MANY_ADDRESSES",ERR_NO_VALID_ADDRESSES:"ERR_NO_VALID_ADDRESSES",ERR_RELAYED_DIAL:"ERR_RELAYED_DIAL",ERR_DIALED_SELF:"ERR_DIALED_SELF",ERR_DISCOVERED_SELF:"ERR_DISCOVERED_SELF",ERR_DUPLICATE_TRANSPORT:"ERR_DUPLICATE_TRANSPORT",ERR_ENCRYPTION_FAILED:"ERR_ENCRYPTION_FAILED",ERR_HOP_REQUEST_FAILED:"ERR_HOP_REQUEST_FAILED",ERR_INVALID_KEY:"ERR_INVALID_KEY",ERR_INVALID_MESSAGE:"ERR_INVALID_MESSAGE",ERR_INVALID_PARAMETERS:"ERR_INVALID_PARAMETERS",ERR_INVALID_PEER:"ERR_INVALID_PEER",ERR_MUXER_UNAVAILABLE:"ERR_MUXER_UNAVAILABLE",ERR_TIMEOUT:"ERR_TIMEOUT",ERR_TRANSPORT_UNAVAILABLE:"ERR_TRANSPORT_UNAVAILABLE",ERR_TRANSPORT_DIAL_FAILED:"ERR_TRANSPORT_DIAL_FAILED",ERR_UNSUPPORTED_PROTOCOL:"ERR_UNSUPPORTED_PROTOCOL",ERR_INVALID_MULTIADDR:"ERR_INVALID_MULTIADDR",ERR_SIGNATURE_NOT_VALID:"ERR_SIGNATURE_NOT_VALID"}},99925:(e,t,r)=>{"use strict";const n=r(96732),{Multiaddr:i}=r(57604),o=r(61446),{codes:s}=r(16422);e.exports=function(e){let t;if("string"===typeof e&&(e=new i(e)),i.isMultiaddr(e)){t=e;const i=e.getPeerId();if(!i)throw o(new Error("".concat(e," does not have a valid peer type")),s.ERR_INVALID_MULTIADDR);try{e=n.createFromB58String(i)}catch(r){throw o(new Error("".concat(e," is not a valid peer type")),s.ERR_INVALID_MULTIADDR)}}return{id:e,multiaddrs:t?[t]:void 0}}},10430:(e,t,r)=>{"use strict";const n=r(5398).version;e.exports.PROTOCOL_VERSION="ipfs/0.1.0",e.exports.AGENT_VERSION="js-libp2p/".concat(n),e.exports.MULTICODEC_IDENTIFY="/ipfs/id/1.0.0",e.exports.MULTICODEC_IDENTIFY_PUSH="/ipfs/id/push/1.0.0",e.exports.IDENTIFY_PROTOCOL_VERSION="0.1.0",e.exports.MULTICODEC_IDENTIFY_PROTOCOL_NAME="id",e.exports.MULTICODEC_IDENTIFY_PUSH_PROTOCOL_NAME="id/push",e.exports.MULTICODEC_IDENTIFY_PROTOCOL_VERSION="1.0.0",e.exports.MULTICODEC_IDENTIFY_PUSH_PROTOCOL_VERSION="1.0.0"},17575:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:identify"),{error:n("libp2p:identify:err")}),o=r(61446),s=r(4666),{pipe:a}=r(91522),{collect:u,take:c,consume:h}=r(61594),{fromString:l}=r(98897),f=r(96732),{Multiaddr:d}=r(57604),{toBuffer:p}=r(46881),y=r(83818),g=r(5503),m=r(73197),{MULTICODEC_IDENTIFY:b,MULTICODEC_IDENTIFY_PUSH:v,IDENTIFY_PROTOCOL_VERSION:w,MULTICODEC_IDENTIFY_PROTOCOL_NAME:_,MULTICODEC_IDENTIFY_PUSH_PROTOCOL_NAME:E,MULTICODEC_IDENTIFY_PROTOCOL_VERSION:S,MULTICODEC_IDENTIFY_PUSH_PROTOCOL_VERSION:M}=r(10430),{codes:A}=r(16422);class I{static getProtocolStr(e){return{identifyProtocolStr:"/".concat(e._config.protocolPrefix,"/").concat(_,"/").concat(S),identifyPushProtocolStr:"/".concat(e._config.protocolPrefix,"/").concat(E,"/").concat(M)}}constructor(e){let{libp2p:t}=e;this._libp2p=t,this.peerStore=t.peerStore,this.addressManager=t.addressManager,this.connectionManager=t.connectionManager,this.peerId=t.peerId,this.handleMessage=this.handleMessage.bind(this);const r=I.getProtocolStr(t);this.identifyProtocolStr=r.identifyProtocolStr,this.identifyPushProtocolStr=r.identifyPushProtocolStr,this._host={protocolVersion:"".concat(t._config.protocolPrefix,"/").concat(w),...t._options.host},this.peerStore.metadataBook.set(this.peerId,"AgentVersion",l(this._host.agentVersion)),this.peerStore.metadataBook.set(this.peerId,"ProtocolVersion",l(this._host.protocolVersion)),this.connectionManager.on("peer:connect",(e=>{this.identify(e).catch(i.error)})),this.peerStore.on("change:multiaddrs",(e=>{let{peerId:t}=e;t.toString()===this.peerId.toString()&&this.pushToPeerStore()})),this.peerStore.on("change:protocols",(e=>{let{peerId:t}=e;t.toString()===this.peerId.toString()&&this.pushToPeerStore()}))}async push(e){const t=await this.peerStore.addressBook.getRawEnvelope(this.peerId),r=this._libp2p.multiaddrs.map((e=>e.bytes)),n=this.peerStore.protoBook.get(this.peerId)||[],o=e.map((async e=>{try{const{stream:i}=await e.newStream(this.identifyPushProtocolStr);await a([y.Identify.encode({listenAddrs:r,signedPeerRecord:t,protocols:n}).finish()],s.encode(),i,h)}catch(o){i.error("could not push identify update to peer",o)}}));return Promise.all(o)}pushToPeerStore(){if(!this._libp2p.isStarted())return;const e=[];let t;for(const r of this.peerStore.peers.values())r.protocols.includes(this.identifyPushProtocolStr)&&(t=this.connectionManager.get(r.id))&&e.push(t);this.push(e)}async identify(e){const{stream:t}=await e.newStream(this.identifyProtocolStr),[r]=await a([],t,s.decode(),c(1),p,u);if(!r)throw o(new Error("No data could be retrieved"),A.ERR_CONNECTION_ENDED);let n;try{n=y.Identify.decode(r)}catch(M){throw o(M,A.ERR_INVALID_MESSAGE)}const{publicKey:h,listenAddrs:b,protocols:v,observedAddr:w,signedPeerRecord:_}=n,E=await f.createFromPubKey(h);if(e.remotePeer.toB58String()!==E.toB58String())throw o(new Error("identified peer does not match the expected peer"),A.ERR_INVALID_PEER);const S=I.getCleanMultiaddr(w);try{const e=await g.openAndCertify(_,m.DOMAIN);if(this.peerStore.addressBook.consumePeerRecord(e))return this.peerStore.protoBook.set(E,v),this.peerStore.metadataBook.set(E,"AgentVersion",l(n.agentVersion)),void this.peerStore.metadataBook.set(E,"ProtocolVersion",l(n.protocolVersion))}catch(M){i("received invalid envelope, discard it and fallback to listenAddrs is available",M)}try{this.peerStore.addressBook.set(E,b.map((e=>new d(e))))}catch(M){i.error("received invalid addrs",M)}this.peerStore.protoBook.set(E,v),this.peerStore.metadataBook.set(E,"AgentVersion",l(n.agentVersion)),this.peerStore.metadataBook.set(E,"ProtocolVersion",l(n.protocolVersion)),i("received observed address of %s",S)}handleMessage(e){let{connection:t,stream:r,protocol:n}=e;switch(n){case this.identifyProtocolStr:return this._handleIdentify({connection:t,stream:r});case this.identifyPushProtocolStr:return this._handlePush({connection:t,stream:r});default:i.error("cannot handle unknown protocol %s",n)}}async _handleIdentify(e){let{connection:t,stream:r}=e,n=new Uint8Array(0);this.peerId.pubKey&&(n=this.peerId.pubKey.bytes);const o=await this.peerStore.addressBook.getRawEnvelope(this.peerId),u=this.peerStore.protoBook.get(this.peerId)||[],c=y.Identify.encode({protocolVersion:this._host.protocolVersion,agentVersion:this._host.agentVersion,publicKey:n,listenAddrs:this._libp2p.multiaddrs.map((e=>e.bytes)),signedPeerRecord:o,observedAddr:t.remoteAddr.bytes,protocols:u}).finish();try{await a([c],s.encode(),r,h)}catch(l){i.error("could not respond to identify request",l)}}async _handlePush(e){let t,{connection:r,stream:n}=e;try{const[e]=await a([],n,s.decode(),c(1),p,u);t=y.Identify.decode(e)}catch(h){return i.error("received invalid message",h)}const o=r.remotePeer;try{const e=await g.openAndCertify(t.signedPeerRecord,m.DOMAIN);if(this.peerStore.addressBook.consumePeerRecord(e))return void this.peerStore.protoBook.set(o,t.protocols)}catch(h){i("received invalid envelope, discard it and fallback to listenAddrs is available",h)}try{this.peerStore.addressBook.set(o,t.listenAddrs.map((e=>new d(e))))}catch(h){i.error("received invalid addrs",h)}this.peerStore.protoBook.set(o,t.protocols)}static getCleanMultiaddr(e){if(e&&e.length>0)try{return new d(e)}catch(t){return null}return null}}const k={IDENTIFY:b,IDENTIFY_PUSH:v};I.multicodecs=k,I.Messsage=y,e.exports=I},83818:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-identify"]||(n.roots["libp2p-identify"]={});a.Identify=function(){function e(e){if(this.listenAddrs=[],this.protocols=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.protocolVersion="",e.prototype.agentVersion="",e.prototype.publicKey=s.newBuffer([]),e.prototype.listenAddrs=s.emptyArray,e.prototype.observedAddr=s.newBuffer([]),e.prototype.protocols=s.emptyArray,e.prototype.signedPeerRecord=s.newBuffer([]),e.encode=function(e,t){if(t||(t=o.create()),null!=e.publicKey&&Object.hasOwnProperty.call(e,"publicKey")&&t.uint32(10).bytes(e.publicKey),null!=e.listenAddrs&&e.listenAddrs.length)for(var r=0;r<e.listenAddrs.length;++r)t.uint32(18).bytes(e.listenAddrs[r]);if(null!=e.protocols&&e.protocols.length)for(r=0;r<e.protocols.length;++r)t.uint32(26).string(e.protocols[r]);return null!=e.observedAddr&&Object.hasOwnProperty.call(e,"observedAddr")&&t.uint32(34).bytes(e.observedAddr),null!=e.protocolVersion&&Object.hasOwnProperty.call(e,"protocolVersion")&&t.uint32(42).string(e.protocolVersion),null!=e.agentVersion&&Object.hasOwnProperty.call(e,"agentVersion")&&t.uint32(50).string(e.agentVersion),null!=e.signedPeerRecord&&Object.hasOwnProperty.call(e,"signedPeerRecord")&&t.uint32(66).bytes(e.signedPeerRecord),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.Identify;e.pos<r;){var o=e.uint32();switch(o>>>3){case 5:n.protocolVersion=e.string();break;case 6:n.agentVersion=e.string();break;case 1:n.publicKey=e.bytes();break;case 2:n.listenAddrs&&n.listenAddrs.length||(n.listenAddrs=[]),n.listenAddrs.push(e.bytes());break;case 4:n.observedAddr=e.bytes();break;case 3:n.protocols&&n.protocols.length||(n.protocols=[]),n.protocols.push(e.string());break;case 8:n.signedPeerRecord=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.Identify)return e;var t=new a.Identify;if(null!=e.protocolVersion&&(t.protocolVersion=String(e.protocolVersion)),null!=e.agentVersion&&(t.agentVersion=String(e.agentVersion)),null!=e.publicKey&&("string"===typeof e.publicKey?s.base64.decode(e.publicKey,t.publicKey=s.newBuffer(s.base64.length(e.publicKey)),0):e.publicKey.length&&(t.publicKey=e.publicKey)),e.listenAddrs){if(!Array.isArray(e.listenAddrs))throw TypeError(".Identify.listenAddrs: array expected");t.listenAddrs=[];for(var r=0;r<e.listenAddrs.length;++r)"string"===typeof e.listenAddrs[r]?s.base64.decode(e.listenAddrs[r],t.listenAddrs[r]=s.newBuffer(s.base64.length(e.listenAddrs[r])),0):e.listenAddrs[r].length&&(t.listenAddrs[r]=e.listenAddrs[r])}if(null!=e.observedAddr&&("string"===typeof e.observedAddr?s.base64.decode(e.observedAddr,t.observedAddr=s.newBuffer(s.base64.length(e.observedAddr)),0):e.observedAddr.length&&(t.observedAddr=e.observedAddr)),e.protocols){if(!Array.isArray(e.protocols))throw TypeError(".Identify.protocols: array expected");t.protocols=[];for(r=0;r<e.protocols.length;++r)t.protocols[r]=String(e.protocols[r])}return null!=e.signedPeerRecord&&("string"===typeof e.signedPeerRecord?s.base64.decode(e.signedPeerRecord,t.signedPeerRecord=s.newBuffer(s.base64.length(e.signedPeerRecord)),0):e.signedPeerRecord.length&&(t.signedPeerRecord=e.signedPeerRecord)),t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.listenAddrs=[],r.protocols=[]),t.defaults&&(t.bytes===String?r.publicKey="":(r.publicKey=[],t.bytes!==Array&&(r.publicKey=s.newBuffer(r.publicKey))),t.bytes===String?r.observedAddr="":(r.observedAddr=[],t.bytes!==Array&&(r.observedAddr=s.newBuffer(r.observedAddr))),r.protocolVersion="",r.agentVersion="",t.bytes===String?r.signedPeerRecord="":(r.signedPeerRecord=[],t.bytes!==Array&&(r.signedPeerRecord=s.newBuffer(r.signedPeerRecord)))),null!=e.publicKey&&e.hasOwnProperty("publicKey")&&(r.publicKey=t.bytes===String?s.base64.encode(e.publicKey,0,e.publicKey.length):t.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey),e.listenAddrs&&e.listenAddrs.length){r.listenAddrs=[];for(var n=0;n<e.listenAddrs.length;++n)r.listenAddrs[n]=t.bytes===String?s.base64.encode(e.listenAddrs[n],0,e.listenAddrs[n].length):t.bytes===Array?Array.prototype.slice.call(e.listenAddrs[n]):e.listenAddrs[n]}if(e.protocols&&e.protocols.length){r.protocols=[];for(n=0;n<e.protocols.length;++n)r.protocols[n]=e.protocols[n]}return null!=e.observedAddr&&e.hasOwnProperty("observedAddr")&&(r.observedAddr=t.bytes===String?s.base64.encode(e.observedAddr,0,e.observedAddr.length):t.bytes===Array?Array.prototype.slice.call(e.observedAddr):e.observedAddr),null!=e.protocolVersion&&e.hasOwnProperty("protocolVersion")&&(r.protocolVersion=e.protocolVersion),null!=e.agentVersion&&e.hasOwnProperty("agentVersion")&&(r.agentVersion=e.agentVersion),null!=e.signedPeerRecord&&e.hasOwnProperty("signedPeerRecord")&&(r.signedPeerRecord=t.bytes===String?s.base64.encode(e.signedPeerRecord,0,e.signedPeerRecord.length):t.bytes===Array?Array.prototype.slice.call(e.signedPeerRecord):e.signedPeerRecord),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},30717:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p"),{error:n("libp2p:err")}),{EventEmitter:o}=r(2331),s=r(61446),a=r(96732),{Multiaddr:u}=r(57604),c=r(22589),h=r(18741),l=r(99925),{validate:f}=r(92243),{codes:d,messages:p}=r(16422),y=r(79516),g=r(7139),m=r(50789),b=r(21877),v=r(15274),w=r(31649),_=r(48662),E=r(48610),S=r(84205),M=r(59953),A=r(30375),I=r(41649),k=r(28410),T=r(32084),R=r(17575),P=r(70052),{updateSelfPeerRecord:C}=r(80362);class O extends o{static async create(e){if(e.peerId)return new O(e);const t=await a.create();return e.peerId=t,new O(e)}constructor(e){if(super(),this._options=f(e),this.peerId=this._options.peerId,this.datastore=this._options.datastore,this.peerStore=this.datastore&&this._options.peerStore.persistence?new I({peerId:this.peerId,datastore:this.datastore,...this._options.peerStore}):new M({peerId:this.peerId}),this.addresses=this._options.addresses,this.addressManager=new y(this.peerId,this._options.addresses),this.addressManager.on("change:addresses",(()=>{C(this).catch((e=>{i.error("Error updating self peer record",e)}))})),this._modules=this._options.modules,this._config=this._options.config,this._transport=[],this._discovery=new Map,this.connectionManager=new g(this,{autoDial:this._config.peerDiscovery.autoDial,...this._options.connectionManager}),this._options.metrics.enabled&&(this.metrics=new _({...this._options.metrics,connectionManager:this.connectionManager})),this._options.keychain&&this._options.keychain.datastore){i("creating keychain");const e=w.generateOptions();this.keychain=new w(this._options.keychain.datastore,{...e,...this._options.keychain}),i("keychain constructed")}if(this.upgrader=new S({localPeer:this.peerId,metrics:this.metrics,onConnection:e=>this.connectionManager.onConnect(e),onConnectionEnd:e=>this.connectionManager.onDisconnect(e)}),this.transportManager=new E({libp2p:this,upgrader:this.upgrader,faultTolerance:this._options.transportManager.faultTolerance}),this.natManager=new P({peerId:this.peerId,addressManager:this.addressManager,transportManager:this.transportManager,...this._options.config.nat}),this.registrar=new k({peerStore:this.peerStore,connectionManager:this.connectionManager}),this.handle=this.handle.bind(this),this.registrar.handle=this.handle,!this._modules.connEncryption||!this._modules.connEncryption.length)throw s(new Error(p.CONN_ENCRYPTION_REQUIRED),d.CONN_ENCRYPTION_REQUIRED);if(this._modules.connEncryption.forEach((e=>{this.upgrader.cryptos.set(e.protocol,e)})),this.dialer=new v({transportManager:this.transportManager,peerStore:this.peerStore,...this._options.dialer}),this._modules.transport.forEach((e=>{const t=e.prototype[Symbol.toStringTag],r=this._config.transport[t];this.transportManager.add(t,e,r)})),this._config.relay.enabled&&(this.transportManager.add(m.prototype[Symbol.toStringTag],m),this.relay=new b(this)),this._modules.streamMuxer){this._modules.streamMuxer.forEach((e=>{this.upgrader.muxers.set(e.multicodec,e)})),this.identifyService=new R({libp2p:this}),this.handle(Object.values(R.getProtocolStr(this)),this.identifyService.handleMessage)}if(this._modules.connProtector)this.upgrader.protector=this._modules.connProtector;else if(void 0!==globalThis.process&&globalThis.process.env&&globalThis.process.env.LIBP2P_FORCE_PNET)throw new Error("Private network is enforced, but no protector was provided");if(this._modules.dht){const e=this._modules.dht;this._dht=new e({libp2p:this,dialer:this.dialer,peerId:this.peerId,peerStore:this.peerStore,registrar:this.registrar,datastore:this.datastore,...this._config.dht})}if(this._modules.pubsub){const e=this._modules.pubsub;this.pubsub=A(e,this,this._config.pubsub)}this.peerRouting=new c(this),this.contentRouting=new h(this),T.mount(this),this._onDiscoveryPeer=this._onDiscoveryPeer.bind(this)}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return"error"!==e||this._events.error?super.emit(e,...r):(i.error(r),!1)}async start(){i("libp2p is starting");try{await this._onStarting(),await this._onDidStart(),i("libp2p has started")}catch(e){throw this.emit("error",e),i.error("An error occurred starting libp2p",e),await this.stop(),e}}async stop(){i("libp2p is stopping");try{this._isStarted=!1,this.relay&&this.relay.stop(),this.peerRouting.stop();for(const e of this._discovery.values())e.removeListener("peer",this._onDiscoveryPeer);await Promise.all(Array.from(this._discovery.values(),(e=>e.stop()))),this._discovery=new Map,await this.peerStore.stop(),await this.connectionManager.stop(),await Promise.all([this.pubsub&&this.pubsub.stop(),this._dht&&this._dht.stop(),this.metrics&&this.metrics.stop()]),await this.natManager.stop(),await this.transportManager.close(),T.unmount(this),this.dialer.destroy()}catch(e){e&&(i.error(e),this.emit("error",e))}i("libp2p has stopped")}async loadKeychain(){if(this.keychain)try{await this.keychain.findKeyByName("self")}catch(e){await this.keychain.importPeer("self",this.peerId)}}isStarted(){return this._isStarted}get connections(){return this.connectionManager.connections}dial(e,t){return this._dial(e,t)}async dialProtocol(e,t,r){if(!t||!t.length)throw s(new Error("no protocols were provided to open a stream"),d.ERR_INVALID_PROTOCOLS_FOR_STREAM);return(await this._dial(e,r)).newStream(t)}async _dial(e,t){const{id:r,multiaddrs:n}=l(e);if(r.equals(this.peerId))throw s(new Error("Cannot dial self"),d.ERR_DIALED_SELF);let i=this.connectionManager.get(r);return i?n&&this.peerStore.addressBook.add(r,n):i=await this.dialer.connectToPeer(e,t),i}get multiaddrs(){let e=this.addressManager.getAnnounceAddrs().map((e=>e.toString()));e.length||(e=this.transportManager.getAddrs().map((e=>e.toString()))),e=e.concat(this.addressManager.getObservedAddrs().map((e=>e.toString())));const t=this._options.addresses.announceFilter,r=new Set(e);return t(Array.from(r).map((e=>new u(e))))}async hangUp(e){const{id:t}=l(e),r=this.connectionManager.connections.get(t.toB58String());r&&await Promise.all(r.map((e=>e.close())))}ping(e){const{id:t,multiaddrs:r}=l(e);return T(this,r?r[0]:t)}handle(e,t){(e=Array.isArray(e)?e:[e]).forEach((e=>{this.upgrader.protocols.set(e,t)})),this.peerStore.protoBook.add(this.peerId,e)}unhandle(e){(e=Array.isArray(e)?e:[e]).forEach((e=>{this.upgrader.protocols.delete(e)})),this.peerStore.protoBook.remove(this.peerId,e)}async _onStarting(){const e=this.addressManager.getListenAddrs();await this.transportManager.listen(e),this.natManager.start(),await this.peerStore.start(),this._config.pubsub.enabled&&this.pubsub&&this.pubsub.start(),this._config.dht.enabled&&(this._dht&&this._dht.start(),this._dht.on("peer",this._onDiscoveryPeer)),this.metrics&&this.metrics.start()}async _onDidStart(){this._isStarted=!0,this.peerStore.on("peer",(e=>{this.emit("peer:discovery",e),this._maybeConnect(e)}));for(const e of this.peerStore.peers.values())this.emit("peer:discovery",e.id);this.connectionManager.start(),await this._setupPeerDiscovery(),this.relay&&this.relay.start(),this.peerRouting.start()}_onDiscoveryPeer(e){e.id.toB58String()!==this.peerId.toB58String()?(e.multiaddrs&&this.peerStore.addressBook.add(e.id,e.multiaddrs),e.protocols&&this.peerStore.protoBook.set(e.id,e.protocols)):i.error(new Error(d.ERR_DISCOVERED_SELF))}async _maybeConnect(e){if(!0===this._config.peerDiscovery.autoDial&&!this.connectionManager.get(e)){if((this._options.connectionManager.minConnections||0)>this.connectionManager.size){i("connecting to discovered peer %s",e.toB58String());try{await this.dialer.connectToPeer(e)}catch(t){i.error("could not connect to discovered peer ".concat(e.toB58String()," with ").concat(t))}}}}async _setupPeerDiscovery(){const e=e=>{let t={enabled:!0};if(e.tag&&this._config.peerDiscovery&&this._config.peerDiscovery[e.tag]&&(t={...t,...this._config.peerDiscovery[e.tag]}),t.enabled&&!this._discovery.has(e.tag)){let r;r="function"===typeof e?new e(Object.assign({},t,{peerId:this.peerId,libp2p:this})):e,r.on("peer",this._onDiscoveryPeer),this._discovery.set(e.tag,r)}};for(const t of this._modules.peerDiscovery||[])e(t);for(const t of this.transportManager.getTransports())t.discovery&&e(t.discovery);await Promise.all(Array.from(this._discovery.values(),(e=>e.start())))}}e.exports=O},99637:(e,t,r)=>{"use strict";r(71270),r(79850);const n=r(5525),{certificateForKey:i,findAsync:o}=r(92554),s=r(61446),{fromString:a}=r(98897),{toString:u}=r(60709),c=new WeakMap;e.exports=class{constructor(e,t){if(!e)throw s(new Error("keychain is required"),"ERR_KEYCHAIN_REQUIRED");this.keychain=e,c.set(this,{dek:t})}async encrypt(e,t){if(!(t instanceof Uint8Array))throw s(new Error("Plain data must be a Uint8Array"),"ERR_INVALID_PARAMS");const r=await this.keychain.findKeyByName(e),o=await this.keychain._getPrivateKey(e),u=c.get(this).dek,h=n.pki.decryptRsaPrivateKey(o,u),l=await i(r,h),f=n.pkcs7.createEnvelopedData();f.addRecipient(l),f.content=n.util.createBuffer(t),f.encrypt();const d=n.asn1.toDer(f.toAsn1()).getBytes();return a(d,"ascii")}async decrypt(e){if(!(e instanceof Uint8Array))throw s(new Error("CMS data is required"),"ERR_INVALID_PARAMS");let t;try{const r=n.util.createBuffer(u(e,"ascii")),i=n.asn1.fromDer(r);t=n.pkcs7.messageFromAsn1(i)}catch(p){throw s(new Error("Invalid CMS: "+p.message),"ERR_INVALID_CMS")}const r=t.recipients.filter((e=>e.issuer.find((e=>"O"===e.shortName&&"ipfs"===e.value)))).filter((e=>e.issuer.find((e=>"CN"===e.shortName)))).map((e=>({recipient:e,keyId:e.issuer.find((e=>"CN"===e.shortName)).value}))),i=await o(r,(async e=>{try{if(await this.keychain.findKeyById(e.keyId))return!0}catch(p){return!1}return!1}));if(!i){const e=r.map((e=>e.keyId));throw s(new Error("Decryption needs one of the key(s): "+e.join(", ")),"ERR_MISSING_KEYS",{missingKeys:e})}const h=await this.keychain.findKeyById(i.keyId);if(!h)throw s(new Error("No key available to decrypto"),"ERR_NO_KEY");const l=await this.keychain._getPrivateKey(h.name),f=c.get(this).dek,d=n.pki.decryptRsaPrivateKey(l,f);return t.decrypt(i.recipient,d),a(t.content.getBytes(),"ascii")}}},31649:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:keychain"),{error:n("libp2p:keychain:err")}),o=r(13858),s=r(54582),a=r(25137),{Key:u}=r(83198),c=r(99637),h=r(61446),{toString:l}=r(60709),{fromString:f}=r(98897);r(16654);const d="/info/",p=new WeakMap,y=14,g=16,m=1e3,b={dek:{keyLength:64,iterationCount:1e4,salt:"you should override this value with a crypto secure random number",hash:"sha2-512"}};function v(e){return!!e&&("string"===typeof e&&e===o(e.trim()))}async function w(e){const t=800*Math.random()+200;throw await new Promise((e=>setTimeout(e,t))),e}function _(e){return new u("/pkcs8/"+e)}function E(e){return new u(d+e)}e.exports=class{constructor(e,t){if(!e)throw new Error("store is required");if(this.store=e,this.opts=s(b,t),this.opts.pass&&this.opts.pass.length<20)throw new Error("pass must be least 20 characters");if(this.opts.dek.keyLength<y)throw new Error("dek.keyLength must be least ".concat(y," bytes"));if(this.opts.dek.salt.length<g)throw new Error("dek.saltLength must be least ".concat(g," bytes"));if(this.opts.dek.iterationCount<m)throw new Error("dek.iterationCount must be least ".concat(m));const r=this.opts.pass?a.pbkdf2(this.opts.pass,this.opts.dek.salt,this.opts.dek.iterationCount,this.opts.dek.keyLength,this.opts.dek.hash):"";p.set(this,{dek:r})}get cms(){return new c(this,p.get(this).dek)}static generateOptions(){const e=Object.assign({},b),t=3*Math.ceil(g/3);return e.dek.salt=l(a.randomBytes(t),"base64"),e}static get options(){return b}async createKey(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2048;const n=this;if(!v(e)||"self"===e)return w(h(new Error("Invalid key name '".concat(e,"'")),"ERR_INVALID_KEY_NAME"));if("string"!==typeof t)return w(h(new Error("Invalid key type '".concat(t,"'")),"ERR_INVALID_KEY_TYPE"));const i=_(e);if(await n.store.has(i))return w(h(new Error("Key '".concat(e,"' already exists")),"ERR_KEY_ALREADY_EXISTS"));if("rsa"===t.toLowerCase())if(!Number.isSafeInteger(r)||r<2048)return w(h(new Error("Invalid RSA key size ".concat(r)),"ERR_INVALID_KEY_SIZE"));let o;try{const s=await a.keys.generateKeyPair(t,r),u=await s.id(),c=p.get(this).dek,h=await s.export(c);o={name:e,id:u};const l=n.store.batch();l.put(i,f(h)),l.put(E(e),f(JSON.stringify(o))),await l.commit()}catch(s){return w(s)}return o}async listKeys(){const e=this,t={prefix:d},r=[];for await(const n of e.store.query(t))r.push(JSON.parse(l(n.value)));return r}async findKeyById(e){try{return(await this.listKeys()).find((t=>t.id===e))}catch(t){return w(t)}}async findKeyByName(e){if(!v(e))return w(h(new Error("Invalid key name '".concat(e,"'")),"ERR_INVALID_KEY_NAME"));const t=E(e);try{const e=await this.store.get(t);return JSON.parse(l(e))}catch(r){return w(h(new Error("Key '".concat(e,"' does not exist. ").concat(r.message)),"ERR_KEY_NOT_FOUND"))}}async removeKey(e){if(!v(e)||"self"===e)return w(h(new Error("Invalid key name '".concat(e,"'")),"ERR_INVALID_KEY_NAME"));const t=_(e),r=await this.findKeyByName(e),n=this.store.batch();return n.delete(t),n.delete(E(e)),await n.commit(),r}async renameKey(e,t){const r=this;if(!v(e)||"self"===e)return w(h(new Error("Invalid old key name '".concat(e,"'")),"ERR_OLD_KEY_NAME_INVALID"));if(!v(t)||"self"===t)return w(h(new Error("Invalid new key name '".concat(t,"'")),"ERR_NEW_KEY_NAME_INVALID"));const n=_(e),i=_(t),o=E(e),s=E(t);if(await r.store.has(i))return w(h(new Error("Key '".concat(t,"' already exists")),"ERR_KEY_ALREADY_EXISTS"));try{const e=await r.store.get(n),a=await r.store.get(o),u=JSON.parse(l(a));u.name=t;const c=r.store.batch();return c.put(i,e),c.put(s,f(JSON.stringify(u))),c.delete(n),c.delete(o),await c.commit(),u}catch(a){return w(a)}}async exportKey(e,t){if(!v(e))return w(h(new Error("Invalid key name '".concat(e,"'")),"ERR_INVALID_KEY_NAME"));if(!t)return w(h(new Error("Password is required"),"ERR_PASSWORD_REQUIRED"));const r=_(e);try{const e=await this.store.get(r),n=l(e),i=p.get(this).dek;return(await a.keys.import(n,i)).export(t)}catch(n){return w(n)}}async importKey(e,t,r){if(!v(e)||"self"===e)return w(h(new Error("Invalid key name '".concat(e,"'")),"ERR_INVALID_KEY_NAME"));if(!t)return w(h(new Error("PEM encoded key is required"),"ERR_PEM_REQUIRED"));const n=_(e);if(await this.store.has(n))return w(h(new Error("Key '".concat(e,"' already exists")),"ERR_KEY_ALREADY_EXISTS"));let i,o;try{i=await a.keys.import(t,r)}catch(c){return w(h(new Error("Cannot read the key, most likely the password is wrong"),"ERR_CANNOT_READ_KEY"))}try{o=await i.id();const e=p.get(this).dek;t=await i.export(e)}catch(c){return w(c)}const s={name:e,id:o},u=this.store.batch();return u.put(n,f(t)),u.put(E(e),f(JSON.stringify(s))),await u.commit(),s}async importPeer(e,t){const r=this;if(!v(e))return w(h(new Error("Invalid key name '".concat(e,"'")),"ERR_INVALID_KEY_NAME"));if(!t||!t.privKey)return w(h(new Error("Peer.privKey is required"),"ERR_MISSING_PRIVATE_KEY"));const n=t.privKey,i=_(e);if(await r.store.has(i))return w(h(new Error("Key '".concat(e,"' already exists")),"ERR_KEY_ALREADY_EXISTS"));try{const t=await n.id(),o=p.get(this).dek,s=await n.export(o),a={name:e,id:t},u=r.store.batch();return u.put(i,f(s)),u.put(E(e),f(JSON.stringify(a))),await u.commit(),a}catch(o){return w(o)}}async _getPrivateKey(e){if(!v(e))return w(h(new Error("Invalid key name '".concat(e,"'")),"ERR_INVALID_KEY_NAME"));try{const t=_(e),r=await this.store.get(t);return l(r)}catch(t){return w(h(new Error("Key '".concat(e,"' does not exist. ").concat(t.message)),"ERR_KEY_NOT_FOUND"))}}async rotateKeychainPass(e,t){if("string"!==typeof e)return w(h(new Error("Invalid old pass type '".concat(typeof e,"'")),"ERR_INVALID_OLD_PASS_TYPE"));if("string"!==typeof t)return w(h(new Error("Invalid new pass type '".concat(typeof t,"'")),"ERR_INVALID_NEW_PASS_TYPE"));if(t.length<20)return w(h(new Error("Invalid pass length ".concat(t.length)),"ERR_INVALID_PASS_LENGTH"));i("recreating keychain");const r=p.get(this).dek;this.opts.pass=t;const n=t?a.pbkdf2(t,this.opts.dek.salt,this.opts.dek.iterationCount,this.opts.dek.keyLength,this.opts.dek.hash):"";p.set(this,{dek:n});const o=await this.listKeys();for(const i of o){const e=await this.store.get(_(i.name)),t=l(e),o=await a.keys.import(t,r),s=n.toString(),u=await o.export(s),c=this.store.batch(),h={name:i.name,id:i.id};c.put(_(i.name),f(u)),c.put(E(i.name),f(JSON.stringify(h))),await c.commit()}i("keychain reconstructed")}}},92554:(e,t,r)=>{"use strict";r(49781);const n=r(5525).pki;e.exports={certificateForKey:(e,t)=>{const r=n.setRsaPublicKey(t.n,t.e),i=n.createCertificate();i.publicKey=r,i.serialNumber="01",i.validity.notBefore=new Date,i.validity.notAfter=new Date,i.validity.notAfter.setFullYear(i.validity.notBefore.getFullYear()+10);const o=[{name:"organizationName",value:"ipfs"},{shortName:"OU",value:"keystore"},{name:"commonName",value:e.id}];return i.setSubject(o),i.setIssuer(o),i.setExtensions([{name:"basicConstraints",cA:!0},{name:"keyUsage",keyCertSign:!0,digitalSignature:!0,nonRepudiation:!0,keyEncipherment:!0,dataEncipherment:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0,codeSigning:!0,emailProtection:!0,timeStamping:!0},{name:"nsCertType",client:!0,server:!0,email:!0,objsign:!0,sslCA:!0,emailCA:!0,objCA:!0}]),i.sign(t),i},findAsync:async function(e,t){const r=e.map(t);return e[(await Promise.all(r)).findIndex((e=>e))]}}},48662:(e,t,r)=>{"use strict";const n=r(54582),{pipe:i}=r(91522),{tap:o}=r(61594),s=r(47740),{METRICS:a}=r(91330),u=r(45942),c=["dataReceived","dataSent"],h={in:"dataReceived",out:"dataSent"};class l{constructor(e){this._options=n(a,e),this._globalStats=new u(c,this._options),this._peerStats=new Map,this._protocolStats=new Map,this._oldPeers=s(this._options.maxOldPeersRetention),this._running=!1,this._onMessage=this._onMessage.bind(this),this._connectionManager=e.connectionManager,this._connectionManager.on("peer:disconnect",(e=>{this.onPeerDisconnected(e.remotePeer)}))}start(){this._running=!0}stop(){this._running=!1,this._globalStats.stop();for(const e of this._peerStats.values())e.stop();for(const e of this._protocolStats.values())e.stop()}get global(){return this._globalStats}get peers(){return Array.from(this._peerStats.keys())}forPeer(e){const t=e.toB58String();return this._peerStats.get(t)||this._oldPeers.get(t)}get protocols(){return Array.from(this._protocolStats.keys())}forProtocol(e){return this._protocolStats.get(e)}onPeerDisconnected(e){const t=e.toB58String(),r=this._peerStats.get(t);r&&(r.stop(),this._peerStats.delete(t),this._oldPeers.set(t,r))}_onMessage(e){let{remotePeer:t,protocol:r,direction:n,dataLength:i}=e;if(!this._running)return;const o=h[n];let s=this.forPeer(t);if(s||(s=new u(c,this._options),this._peerStats.set(t.toB58String(),s)),s.push(o,i),this._globalStats.push(o,i),r){let e=this.forProtocol(r);e||(e=new u(c,this._options),this._protocolStats.set(r,e)),e.push(o,i)}}updatePlaceholder(e,t){if(!this._running)return;const r=this.forPeer(e),n=t.toB58String(),i=this.forPeer(t);let o=r;i&&(o=l.mergeStats(i,o),this._oldPeers.delete(n)),this._peerStats.delete(e.toB58String()),this._peerStats.set(n,o),o.start()}trackStream(e){let{stream:t,remotePeer:r,protocol:n}=e;const s=this,a=t.source;t.source=o((e=>s._onMessage({remotePeer:r,protocol:n,direction:"in",dataLength:e.length})))(a);const u=t.sink;return t.sink=e=>i(e,o((e=>s._onMessage({remotePeer:r,protocol:n,direction:"out",dataLength:e.length}))),u),t}static mergeStats(e,t){return e.stop(),t.stop(),e._queue=[...e._queue,...t._queue],e}}e.exports=l},47740:(e,t,r)=>{"use strict";const n=r(28831);e.exports=e=>{const t=n(e);return t.delete=t.remove,t}},45942:(e,t,r)=>{"use strict";const{EventEmitter:n}=r(2331),{BigNumber:i}=r(35438),o=r(24014),s=r(79881);e.exports=class extends n{constructor(e,t){super(),this._options=t,this._queue=[],this._stats={dataReceived:i(0),dataSent:i(0)},this._frequencyLastTime=Date.now(),this._frequencyAccumulators={},this._movingAverages={},this._update=this._update.bind(this);const r=this._options.movingAverageIntervals;for(let n=0;n<e.length;n++){const t=e[n];this._stats[t]=i(0),this._movingAverages[t]={};for(let e=0;e<r.length;e++){const n=r[e];(this._movingAverages[t][n]=o(n)).push(this._frequencyLastTime,0)}}}start(){this._queue.length&&this._resetComputeTimeout()}stop(){this._timeout&&(this._timeout.clear(),this._timeout=null)}get snapshot(){return Object.assign({},this._stats)}get movingAverages(){return Object.assign({},this._movingAverages)}toJSON(){const e=this.snapshot,t=this.movingAverages,r={dataReceived:e.dataReceived.toString(),dataSent:e.dataSent.toString(),movingAverages:{}},n=Object.keys(t);for(const i of n){r.movingAverages[i]={};for(const e of Object.keys(t[i]))r.movingAverages[i][e]=t[i][e].movingAverage()}return r}push(e,t){this._queue.push([e,t,Date.now()]),this._resetComputeTimeout()}_resetComputeTimeout(){this._timeout=s(this._update,this._nextTimeout())}_nextTimeout(){const e=this._queue.length/this._options.computeThrottleMaxQueueSize;return Math.max(this._options.computeThrottleTimeout*(1-e),0)}_update(){if(this._timeout=null,this._queue.length){let e;for(e of this._queue)this._applyOp(e);this._queue=[],this._updateFrequency(e[2]),this.emit("update",this._stats)}}_updateFrequency(e){const t=e-this._frequencyLastTime;Object.keys(this._stats).forEach((r=>{this._updateFrequencyFor(r,t,e)})),this._frequencyLastTime=e}_updateFrequencyFor(e,t,r){const n=this._frequencyAccumulators[e]||0;this._frequencyAccumulators[e]=0;const i=n/(t||1)*1e3;let s=this._movingAverages[e];s||(s=this._movingAverages[e]={});const a=this._options.movingAverageIntervals;for(let u=0;u<a.length;u++){const e=a[u];let t=s[e];t||(t=s[e]=o(e)),t.push(r,i)}}_applyOp(e){const t=e[0],r=e[1];if("number"!==typeof r)throw new Error("invalid increment number: ".concat(r));let n;n=Object.prototype.hasOwnProperty.call(this._stats,t)?this._stats[t]:this._stats[t]=i(0),this._stats[t]=n.plus(r),this._frequencyAccumulators[t]||(this._frequencyAccumulators[t]=0),this._frequencyAccumulators[t]+=r}}},70052:(e,t,r)=>{"use strict";const n=r(65437),i=r(39287),{promisify:o}=r(5844),{Multiaddr:s}=r(57604),a=Object.assign(i("libp2p:nat"),{error:i("libp2p:nat:err")}),{isBrowser:u}=r(15551),c=r(5621),h=r(98072),l=r(5398),f=r(61446),{codes:{ERR_INVALID_PARAMETERS:d}}=r(16422),p=r(86627),y=7200;function g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:65535;return Math.floor(Math.random()*(t-e+1)+e)}e.exports=class{constructor(e){let{peerId:t,addressManager:r,transportManager:n,...i}=e;if(this._peerId=t,this._addressManager=r,this._transportManager=n,this._enabled=i.enabled,this._externalIp=i.externalIp,this._options={description:i.description||"".concat(l.name,"@").concat(l.version," ").concat(this._peerId),ttl:i.ttl||y,autoUpdate:i.keepAlive||!0,gateway:i.gateway,enablePMP:Boolean(i.pmp&&i.pmp.enabled)},this._options.ttl<y)throw f(new Error("NatManager ttl should be at least ".concat(y," seconds")),d)}start(){!u&&this._enabled&&this._start().catch((e=>{a.error(e)}))}async _start(){const e=this._transportManager.getAddrs();for(const t of e){const{family:e,host:r,port:n,transport:i}=t.toOptions();if(!t.isThinWaistAddress()||"tcp"!==i)continue;if(p(t))continue;if(4!==e)continue;const o=this._getClient(),u=this._externalIp||await o.externalIp();if(h(u))throw new Error("".concat(u," is private - please set config.nat.externalIp to an externally routable IP or ensure you are not behind a double NAT"));const c=g();a("opening uPnP connection from ".concat(u,":").concat(c," to ").concat(r,":").concat(n)),await o.map({publicPort:c,privatePort:n,protocol:i.toUpperCase()}),this._addressManager.addObservedAddr(s.fromNodeAddress({family:4,address:u,port:c},i))}}_getClient(){if(this._client)return this._client;const e=new n(this._options),t=o(e.map.bind(e)),r=o(e.destroy.bind(e)),i=o(e.externalIp.bind(e));return this._client={map:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return c((()=>t(...r)),{onFailedAttempt:a.error,unref:!0})},destroy:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c((()=>r(...t)),{onFailedAttempt:a.error,unref:!0})},externalIp:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return c((()=>i(...t)),{onFailedAttempt:a.error,unref:!0})}},this._client}async stop(){if(!u&&this._client)try{await this._client.destroy(),this._client=null}catch(e){a.error(e)}}}},22589:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:peer-routing"),{error:n("libp2p:peer-routing:err")}),o=r(61446),{storeAddresses:s,uniquePeers:a,requirePeers:u}=r(99418),c=r(61960),{pipe:h}=r(91522),l=r(11903),f=r(98559),d=r(60721),{setDelayedInterval:p,clearDelayedInterval:y}=r(22798);e.exports=class{constructor(e){this._peerId=e.peerId,this._peerStore=e.peerStore,this._routers=e._modules.peerRouting||[],e._dht&&e._config.dht.enabled&&this._routers.push(e._dht),this._refreshManagerOptions=e._options.peerRouting.refreshManager,this._findClosestPeersTask=this._findClosestPeersTask.bind(this)}start(){this._routers.length&&!this._timeoutId&&this._refreshManagerOptions.enabled&&(this._timeoutId=p(this._findClosestPeersTask,this._refreshManagerOptions.interval,this._refreshManagerOptions.bootDelay))}async _findClosestPeersTask(){try{await f(this.getClosestPeers(this._peerId.id))}catch(e){i.error(e)}}stop(){y(this._timeoutId)}async findPeer(e,t){if(!this._routers.length)throw o(new Error("No peer routers available"),"NO_ROUTERS_AVAILABLE");if(e.toB58String()===this._peerId.toB58String())throw o(new Error("Should not try to find self"),"ERR_FIND_SELF");const r=await h(c(...this._routers.map((r=>[r.findPeer(e,t)]))),(e=>d(e,Boolean)),(e=>s(e,this._peerStore)),(e=>l(e)));if(r)return r;throw o(new Error("not found"),"NOT_FOUND")}async*getClosestPeers(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:3e4};if(!this._routers.length)throw o(new Error("No peer routers available"),"NO_ROUTERS_AVAILABLE");yield*h(c(...this._routers.map((r=>r.getClosestPeers(e,t)))),(e=>s(e,this._peerStore)),(e=>a(e)),(e=>u(e)))}}},87327:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:peer-store:address-book"),{error:n("libp2p:peer-store:address-book:err")}),o=r(61446),{Multiaddr:s}=r(57604),a=r(96732),u=r(73653),c=r(73197),{codes:{ERR_INVALID_PARAMETERS:h}}=r(16422),l=r(5503);e.exports=class extends u{constructor(e){super({peerStore:e,eventName:"change:multiaddrs",eventProperty:"multiaddrs",eventTransformer:e=>e.addresses?e.addresses.map((e=>e.multiaddr)):[]}),this.data=new Map}consumePeerRecord(e){let t;try{t=c.createFromProtobuf(e.payload)}catch(a){return i.error("invalid peer record received"),!1}if(!t.peerId.equals(e.peerId))return i("signing key does not match PeerId in the PeerRecord"),!1;if(!t.multiaddrs||!t.multiaddrs.length)return!1;const r=t.peerId,n=r.toB58String(),o=(this.data.get(n)||{record:void 0}).record;if(o&&o.seqNumber>=t.seqNumber)return!1;const s=this._toAddresses(t.multiaddrs,!0);return this._setData(r,{addresses:s,record:{raw:e.marshal(),seqNumber:t.seqNumber}}),i("stored provided peer record for ".concat(n)),!0}getRawEnvelope(e){const t=this.data.get(e.toB58String());if(t&&t.record&&t.record.raw)return t.record.raw}getPeerRecord(e){const t=this.getRawEnvelope(e);if(t)return l.createFromProtobuf(t)}set(e,t){if(!a.isPeerId(e))throw i.error("peerId must be an instance of peer-id to store data"),o(new Error("peerId must be an instance of peer-id"),h);const r=this._toAddresses(t);if(!r.length)return this;const n=e.toB58String(),s=this.data.get(n);if(s&&s.addresses&&s.addresses.length===r.length){if(s.addresses.filter((e=>r.some((t=>e.multiaddr.equals(t.multiaddr))))).length===s.addresses.length)return i("the addresses provided to store are equal to the already stored for ".concat(n)),this}return this._setData(e,{addresses:r,record:s&&s.record}),i("stored provided multiaddrs for ".concat(n)),s||this._ps.emit("peer",e),this}add(e,t){if(!a.isPeerId(e))throw i.error("peerId must be an instance of peer-id to store data"),o(new Error("peerId must be an instance of peer-id"),h);const r=this._toAddresses(t),n=e.toB58String();if(!r.length)return this;const s=this.data.get(n);return s&&s.addresses&&(s.addresses.forEach((e=>{r.find((t=>t.multiaddr.equals(e.multiaddr)))||r.push(e)})),s.addresses.length===r.length)?(i("the addresses provided to store are already stored for ".concat(n)),this):(this._setData(e,{addresses:r,record:s&&s.record}),i("added provided multiaddrs for ".concat(n)),s&&s.addresses||this._ps.emit("peer",e),this)}get(e){if(!a.isPeerId(e))throw o(new Error("peerId must be an instance of peer-id"),h);const t=this.data.get(e.toB58String());return t&&t.addresses?[...t.addresses]:void 0}_toAddresses(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)throw i.error("multiaddrs must be provided to store data"),o(new Error("multiaddrs must be provided"),h);const r=[];return e.forEach((e=>{if(!s.isMultiaddr(e))throw i.error("multiaddr ".concat(e," must be an instance of multiaddr")),o(new Error("multiaddr ".concat(e," must be an instance of multiaddr")),h);r.find((t=>t.multiaddr.equals(e)))||r.push({multiaddr:e,isCertified:t})})),r}getMultiaddrsForPeer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;if(!a.isPeerId(e))throw o(new Error("peerId must be an instance of peer-id"),h);const r=this.data.get(e.toB58String());if(r&&r.addresses)return t(r.addresses||[]).map((t=>{const r=t.multiaddr,n=r.getPeerId();return n&&n===e.toB58String()?r:r.encapsulate("/p2p/".concat(e.toB58String()))}))}}},73653:(e,t,r)=>{"use strict";const n=r(61446),i=r(96732),{codes:{ERR_INVALID_PARAMETERS:o}}=r(16422),s=e=>e;e.exports=class{constructor(e){let{peerStore:t,eventName:r,eventProperty:n,eventTransformer:i=s}=e;this._ps=t,this.eventName=r,this.eventProperty=n,this.eventTransformer=i,this.data=new Map}set(e,t){throw n(new Error("set must be implemented by the subclass"),"ERR_NOT_IMPLEMENTED")}_setData(e,t){let{emit:r=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=e.toB58String();this.data.set(n,t),r&&this._emit(e,t)}_emit(e,t){this._ps.emit(this.eventName,{peerId:e,[this.eventProperty]:this.eventTransformer(t)})}get(e){if(!i.isPeerId(e))throw n(new Error("peerId must be an instance of peer-id"),o);const t=this.data.get(e.toB58String());return t?[...t]:void 0}delete(e){if(!i.isPeerId(e))throw n(new Error("peerId must be an instance of peer-id"),o);return!!this.data.delete(e.toB58String())&&(this._emit(e,[]),!0)}}},59953:(e,t,r)=>{"use strict";const n=r(61446),{EventEmitter:i}=r(2331),o=r(96732),s=r(87327),a=r(21277),u=r(64299),c=r(15027),{codes:{ERR_INVALID_PARAMETERS:h}}=r(16422);e.exports=class extends i{constructor(e){let{peerId:t}=e;super(),this._peerId=t,this.addressBook=new s(this),this.keyBook=new a(this),this.metadataBook=new u(this),this.protoBook=new c(this)}start(){}stop(){}get peers(){const e=new Set([...this.addressBook.data.keys(),...this.keyBook.data.keys(),...this.protoBook.data.keys(),...this.metadataBook.data.keys()]);this._peerId&&e.delete(this._peerId.toB58String());const t=new Map;return e.forEach((e=>{t.set(e,this.get(o.createFromB58String(e)))})),t}delete(e){const t=this.addressBook.delete(e),r=this.keyBook.delete(e),n=this.protoBook.delete(e),i=this.metadataBook.delete(e);return t||r||n||i}get(e){if(!o.isPeerId(e))throw n(new Error("peerId must be an instance of peer-id"),h);const t=this.keyBook.data.get(e.toB58String()),r=this.addressBook.get(e),i=this.metadataBook.get(e),s=this.protoBook.get(e);if(t||r||i||s)return{id:t||e,addresses:r||[],protocols:s||[],metadata:i}}}},21277:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:peer-store:key-book"),{error:n("libp2p:peer-store:key-book:err")}),o=r(61446),s=r(96732),a=r(73653),{codes:{ERR_INVALID_PARAMETERS:u}}=r(16422);e.exports=class extends a{constructor(e){super({peerStore:e,eventName:"change:pubkey",eventProperty:"pubkey",eventTransformer:e=>e.pubKey}),this.data=new Map}set(e,t){if(!s.isPeerId(e))throw i.error("peerId must be an instance of peer-id to store data"),o(new Error("peerId must be an instance of peer-id"),u);const r=e.toB58String();return!this.data.get(r)&&t&&(e.pubKey=t,this._setData(e,e),i("stored provided public key for ".concat(r))),this}get(e){if(!s.isPeerId(e))throw o(new Error("peerId must be an instance of peer-id"),u);const t=this.data.get(e.toB58String());return t?t.pubKey:void 0}}},64299:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:peer-store:proto-book"),{error:n("libp2p:peer-store:proto-book:err")}),o=r(61446),{equals:s}=r(56213),a=r(96732),u=r(73653),{codes:{ERR_INVALID_PARAMETERS:c}}=r(16422);e.exports=class extends u{constructor(e){super({peerStore:e,eventName:"change:metadata",eventProperty:"metadata"}),this.data=new Map}set(e,t,r){if(!a.isPeerId(e))throw i.error("peerId must be an instance of peer-id to store data"),o(new Error("peerId must be an instance of peer-id"),c);if("string"!==typeof t||!(r instanceof Uint8Array))throw i.error("valid key and value must be provided to store data"),o(new Error("valid key and value must be provided"),c);return this._setValue(e,t,r),this}_setValue(e,t,r){let{emit:n=!0}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=e.toB58String(),a=this.data.get(o)||new Map,u=a.get(t);u&&s(r,u)?i("the metadata provided to store is equal to the already stored for ".concat(o," on ").concat(t)):(a.set(t,r),this.data.set(o,a),n&&this._emit(e,t))}get(e){if(!a.isPeerId(e))throw o(new Error("peerId must be an instance of peer-id"),c);return this.data.get(e.toB58String())}getValue(e,t){if(!a.isPeerId(e))throw o(new Error("peerId must be an instance of peer-id"),c);const r=this.data.get(e.toB58String());return r&&r.get(t)}delete(e){if(!a.isPeerId(e))throw o(new Error("peerId must be an instance of peer-id"),c);return!!this.data.delete(e.toB58String())&&(this._emit(e),!0)}deleteValue(e,t){if(!a.isPeerId(e))throw o(new Error("peerId must be an instance of peer-id"),c);const r=this.data.get(e.toB58String());return!(!r||!r.delete(t))&&(this._emit(e,t),!0)}}},66851:e=>{"use strict";e.exports.NAMESPACE_COMMON="/peers/",e.exports.NAMESPACE_ADDRESS="/peers/addrs/",e.exports.NAMESPACE_KEYS="/peers/keys/",e.exports.NAMESPACE_METADATA="/peers/metadata/",e.exports.NAMESPACE_PROTOCOL="/peers/protos/"},41649:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:persistent-peer-store"),{error:n("libp2p:persistent-peer-store:err")}),{Key:o}=r(83198),{Multiaddr:s}=r(57604),a=r(96732),{base32:u}=r(36206),c=r(59953),{NAMESPACE_ADDRESS:h,NAMESPACE_COMMON:l,NAMESPACE_KEYS:f,NAMESPACE_METADATA:d,NAMESPACE_PROTOCOL:p}=r(66851),{Addresses:y}=r(78902),{Protocols:g}=r(34179);e.exports=class extends c{constructor(e){let{peerId:t,datastore:r,threshold:n=5}=e;super({peerId:t}),this._datastore=r,this._dirtyPeers=new Set,this._dirtyMetadata=new Map,this.threshold=n,this._addDirtyPeer=this._addDirtyPeer.bind(this)}async start(){i("PeerStore is starting"),this.on("change:protocols",this._addDirtyPeer),this.on("change:multiaddrs",this._addDirtyPeer),this.on("change:pubkey",this._addDirtyPeerKey),this.on("change:metadata",this._addDirtyPeerMetadata);for await(const e of this._datastore.query({prefix:l}))await this._processDatastoreEntry(e);i("PeerStore started")}async stop(){i("PeerStore is stopping"),this.removeAllListeners(),await this._commitData(),i("PeerStore stopped")}_addDirtyPeer(e){let{peerId:t}=e;const r=t.toB58String();i("add dirty peer",r),this._dirtyPeers.add(r),this._dirtyPeers.size>=this.threshold&&this._commitData().catch((e=>{i.error("error committing data",e)}))}_addDirtyPeerKey(e){let{peerId:t}=e;if(t.hasInlinePublicKey())return;const r=t.toB58String();i("add dirty peer key",r),this._dirtyPeers.add(r),this._dirtyPeers.size>=this.threshold&&this._commitData().catch((e=>{i.error("error committing data",e)}))}_addDirtyPeerMetadata(e){let{peerId:t,metadata:r}=e;const n=t.toB58String();i("add dirty metadata peer",n),this._dirtyPeers.add(n);const o=this._dirtyMetadata.get(n)||new Set;o.add(r),this._dirtyMetadata.set(n,o),this._dirtyPeers.size>=this.threshold&&this._commitData().catch((e=>{i.error("error committing data",e)}))}async _commitData(){const e=Array.from(this._dirtyPeers);if(!e.length)return;this._dirtyPeers.clear(),i("create batch commit");const t=this._datastore.batch();for(const r of e){const e=this.keyBook.data.get(r)||a.createFromB58String(r);this._batchAddressBook(e,t),!e.hasInlinePublicKey()&&this._batchKeyBook(e,t),this._batchMetadataBook(e,t),this._batchProtoBook(e,t)}await t.commit(),i("batch committed")}_batchAddressBook(e,t){const r=e.toString(),n=new o("".concat(h).concat(r)),s=this.addressBook.data.get(e.toB58String());try{if(!s)return void t.delete(n);const e=y.encode({addrs:s.addresses.map((e=>({multiaddr:e.multiaddr.bytes,isCertified:e.isCertified}))),certifiedRecord:s.record?{seq:s.record.seqNumber,raw:s.record.raw}:void 0}).finish();t.put(n,e)}catch(a){i.error(a)}}_batchKeyBook(e,t){const r=e.toString(),n=new o("".concat(f).concat(r));try{if(!e.pubKey)return void t.delete(n);const r=e.marshalPubKey();t.put(n,r)}catch(s){i.error(s)}}_batchMetadataBook(e,t){const r=e.toString(),n=this._dirtyMetadata.get(e.toB58String())||[];try{n.forEach((n=>{const i=new o("".concat(d).concat(r,"/").concat(n)),s=this.metadataBook.getValue(e,n);s?t.put(i,s):t.delete(i)}))}catch(s){i.error(s)}}_batchProtoBook(e,t){const r=e.toString(),n=new o("".concat(p).concat(r)),s=this.protoBook.get(e);try{if(!s)return void t.delete(n);const e=g.encode({protocols:s}).finish();t.put(n,e)}catch(a){i.error(a)}}async _processDatastoreEntry(e){let{key:t,value:r}=e;try{const e=t.toString().split("/"),n=a.createFromBytes(u.decode(e[3]));let o;switch(e[2]){case"addrs":o=y.decode(r),this.addressBook._setData(n,{addresses:o.addrs.map((e=>({multiaddr:new s(e.multiaddr),isCertified:Boolean(e.isCertified)}))),record:o.certifiedRecord?{raw:o.certifiedRecord.raw,seqNumber:o.certifiedRecord.seq}:void 0},{emit:!1});break;case"keys":o=await a.createFromPubKey(r),this.keyBook._setData(o,o,{emit:!1});break;case"metadata":this.metadataBook._setValue(n,e[4],r,{emit:!1});break;case"protos":o=g.decode(r),this.protoBook._setData(n,new Set(o.protocols),{emit:!1});break;default:i("invalid data persisted for: ",t.toString())}}catch(n){i.error(n)}}}},78902:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-address-book"]||(n.roots["libp2p-address-book"]={});a.Addresses=function(){function e(e){if(this.addrs=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.addrs=s.emptyArray,e.prototype.certifiedRecord=null,e.encode=function(e,t){if(t||(t=o.create()),null!=e.addrs&&e.addrs.length)for(var r=0;r<e.addrs.length;++r)a.Addresses.Address.encode(e.addrs[r],t.uint32(10).fork()).ldelim();return null!=e.certifiedRecord&&Object.hasOwnProperty.call(e,"certifiedRecord")&&a.Addresses.CertifiedRecord.encode(e.certifiedRecord,t.uint32(18).fork()).ldelim(),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.Addresses;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.addrs&&n.addrs.length||(n.addrs=[]),n.addrs.push(a.Addresses.Address.decode(e,e.uint32()));break;case 2:n.certifiedRecord=a.Addresses.CertifiedRecord.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.Addresses)return e;var t=new a.Addresses;if(e.addrs){if(!Array.isArray(e.addrs))throw TypeError(".Addresses.addrs: array expected");t.addrs=[];for(var r=0;r<e.addrs.length;++r){if("object"!==typeof e.addrs[r])throw TypeError(".Addresses.addrs: object expected");t.addrs[r]=a.Addresses.Address.fromObject(e.addrs[r])}}if(null!=e.certifiedRecord){if("object"!==typeof e.certifiedRecord)throw TypeError(".Addresses.certifiedRecord: object expected");t.certifiedRecord=a.Addresses.CertifiedRecord.fromObject(e.certifiedRecord)}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.addrs=[]),t.defaults&&(r.certifiedRecord=null),e.addrs&&e.addrs.length){r.addrs=[];for(var n=0;n<e.addrs.length;++n)r.addrs[n]=a.Addresses.Address.toObject(e.addrs[n],t)}return null!=e.certifiedRecord&&e.hasOwnProperty("certifiedRecord")&&(r.certifiedRecord=a.Addresses.CertifiedRecord.toObject(e.certifiedRecord,t)),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.Address=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.multiaddr=s.newBuffer([]),e.prototype.isCertified=!1,e.encode=function(e,t){return t||(t=o.create()),null!=e.multiaddr&&Object.hasOwnProperty.call(e,"multiaddr")&&t.uint32(10).bytes(e.multiaddr),null!=e.isCertified&&Object.hasOwnProperty.call(e,"isCertified")&&t.uint32(16).bool(e.isCertified),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.Addresses.Address;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.multiaddr=e.bytes();break;case 2:n.isCertified=e.bool();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.Addresses.Address)return e;var t=new a.Addresses.Address;return null!=e.multiaddr&&("string"===typeof e.multiaddr?s.base64.decode(e.multiaddr,t.multiaddr=s.newBuffer(s.base64.length(e.multiaddr)),0):e.multiaddr.length&&(t.multiaddr=e.multiaddr)),null!=e.isCertified&&(t.isCertified=Boolean(e.isCertified)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.multiaddr="":(r.multiaddr=[],t.bytes!==Array&&(r.multiaddr=s.newBuffer(r.multiaddr))),r.isCertified=!1),null!=e.multiaddr&&e.hasOwnProperty("multiaddr")&&(r.multiaddr=t.bytes===String?s.base64.encode(e.multiaddr,0,e.multiaddr.length):t.bytes===Array?Array.prototype.slice.call(e.multiaddr):e.multiaddr),null!=e.isCertified&&e.hasOwnProperty("isCertified")&&(r.isCertified=e.isCertified),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.CertifiedRecord=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.seq=s.Long?s.Long.fromBits(0,0,!0):0,e.prototype.raw=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.raw&&Object.hasOwnProperty.call(e,"raw")&&t.uint32(18).bytes(e.raw),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.Addresses.CertifiedRecord;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.seq=e.uint64();break;case 2:n.raw=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.Addresses.CertifiedRecord)return e;var t=new a.Addresses.CertifiedRecord;return null!=e.seq&&(s.Long?(t.seq=s.Long.fromValue(e.seq)).unsigned=!0:"string"===typeof e.seq?t.seq=parseInt(e.seq,10):"number"===typeof e.seq?t.seq=e.seq:"object"===typeof e.seq&&(t.seq=new s.LongBits(e.seq.low>>>0,e.seq.high>>>0).toNumber(!0))),null!=e.raw&&("string"===typeof e.raw?s.base64.decode(e.raw,t.raw=s.newBuffer(s.base64.length(e.raw)),0):e.raw.length&&(t.raw=e.raw)),t},e.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(s.Long){var n=new s.Long(0,0,!0);r.seq=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.seq=t.longs===String?"0":0;t.bytes===String?r.raw="":(r.raw=[],t.bytes!==Array&&(r.raw=s.newBuffer(r.raw)))}return null!=e.seq&&e.hasOwnProperty("seq")&&("number"===typeof e.seq?r.seq=t.longs===String?String(e.seq):e.seq:r.seq=t.longs===String?s.Long.prototype.toString.call(e.seq):t.longs===Number?new s.LongBits(e.seq.low>>>0,e.seq.high>>>0).toNumber(!0):e.seq),null!=e.raw&&e.hasOwnProperty("raw")&&(r.raw=t.bytes===String?s.base64.encode(e.raw,0,e.raw.length):t.bytes===Array?Array.prototype.slice.call(e.raw):e.raw),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e.exports=a},34179:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-proto-book"]||(n.roots["libp2p-proto-book"]={});a.Protocols=function(){function e(e){if(this.protocols=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.protocols=s.emptyArray,e.encode=function(e,t){if(t||(t=o.create()),null!=e.protocols&&e.protocols.length)for(var r=0;r<e.protocols.length;++r)t.uint32(10).string(e.protocols[r]);return t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.Protocols;e.pos<r;){var o=e.uint32();if(o>>>3===1)n.protocols&&n.protocols.length||(n.protocols=[]),n.protocols.push(e.string());else e.skipType(7&o)}return n},e.fromObject=function(e){if(e instanceof a.Protocols)return e;var t=new a.Protocols;if(e.protocols){if(!Array.isArray(e.protocols))throw TypeError(".Protocols.protocols: array expected");t.protocols=[];for(var r=0;r<e.protocols.length;++r)t.protocols[r]=String(e.protocols[r])}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.protocols=[]),e.protocols&&e.protocols.length){r.protocols=[];for(var n=0;n<e.protocols.length;++n)r.protocols[n]=e.protocols[n]}return r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},15027:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:peer-store:proto-book"),{error:n("libp2p:peer-store:proto-book:err")}),o=r(61446),s=r(96732),a=r(73653),{codes:{ERR_INVALID_PARAMETERS:u}}=r(16422);e.exports=class extends a{constructor(e){super({peerStore:e,eventName:"change:protocols",eventProperty:"protocols",eventTransformer:e=>Array.from(e)}),this.data=new Map}set(e,t){if(!s.isPeerId(e))throw i.error("peerId must be an instance of peer-id to store data"),o(new Error("peerId must be an instance of peer-id"),u);if(!t)throw i.error("protocols must be provided to store data"),o(new Error("protocols must be provided"),u);const r=e.toB58String(),n=this.data.get(r),a=new Set(t);return n&&(h=a,(c=n).size===h.size&&[...c].every((e=>h.has(e))))?(i("the protocols provided to store are equal to the already stored for ".concat(r)),this):(this._setData(e,a),i("stored provided protocols for ".concat(r)),this);var c,h}add(e,t){if(!s.isPeerId(e))throw i.error("peerId must be an instance of peer-id to store data"),o(new Error("peerId must be an instance of peer-id"),u);if(!t)throw i.error("protocols must be provided to store data"),o(new Error("protocols must be provided"),u);const r=e.toB58String(),n=this.data.get(r)||new Set,a=new Set([...n,...t]);return n.size===a.size?(i("the protocols provided to store are already stored for ".concat(r)),this):(this._setData(e,a),i("added provided protocols for ".concat(r)),this)}remove(e,t){if(!s.isPeerId(e))throw i.error("peerId must be an instance of peer-id to store data"),o(new Error("peerId must be an instance of peer-id"),u);if(!t)throw i.error("protocols must be provided to store data"),o(new Error("protocols must be provided"),u);const r=e.toB58String(),n=this.data.get(r);if(n){const o=new Set([...n].filter((e=>!t.includes(e))));if(n.size===o.size)return this;this._setData(e,o),i("removed provided protocols for ".concat(r))}return this}}},45386:e=>{"use strict";e.exports={PROTOCOL:"/ipfs/ping/1.0.0",PING_LENGTH:32,PROTOCOL_VERSION:"1.0.0",PROTOCOL_NAME:"ping"}},32084:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:ping"),{error:n("libp2p:ping:err")}),o=r(61446),s=r(25137),{pipe:a}=r(91522),{toBuffer:u}=r(46881),{collect:c,take:h}=r(61594),{equals:l}=r(56213),{PROTOCOL_NAME:f,PING_LENGTH:d,PROTOCOL_VERSION:p}=r(45386);(t=e.exports=async function(e,t){const r="/".concat(e._config.protocolPrefix,"/").concat(f,"/").concat(p);i("dialing %s to %s",r,t.toB58String?t.toB58String():t);const n=await e.dial(t),{stream:y}=await n.newStream(r),g=Date.now(),m=s.randomBytes(d),[b]=await a([m],y,(e=>h(1,e)),u,c),v=Date.now();if(!l(m,b))throw o(new Error("Received wrong ping ack"),"ERR_WRONG_PING_ACK");return v-g}).mount=function(e){e.handle("/".concat(e._config.protocolPrefix,"/").concat(f,"/").concat(p),(e=>{let{stream:t}=e;return a(t,t)}))},t.unmount=function(e){e.unhandle("/".concat(e._config.protocolPrefix,"/").concat(f,"/").concat(p))}},30375:e=>{"use strict";e.exports=function(e,t,r){const n=new e(t,r);return n._subscribeAdapter=n.subscribe,n._unsubscribeAdapter=n.unsubscribe,n.subscribe=function(e,t){t&&n.on(e,t),n._subscribeAdapter(e)},n.unsubscribe=function(e,t){t?n.removeListener(e,t):n.removeAllListeners(e),0===n.listenerCount(e)&&n._unsubscribeAdapter(e)},n}},71438:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-envelope"]||(n.roots["libp2p-envelope"]={});a.Envelope=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.publicKey=s.newBuffer([]),e.prototype.payloadType=s.newBuffer([]),e.prototype.payload=s.newBuffer([]),e.prototype.signature=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),null!=e.publicKey&&Object.hasOwnProperty.call(e,"publicKey")&&t.uint32(10).bytes(e.publicKey),null!=e.payloadType&&Object.hasOwnProperty.call(e,"payloadType")&&t.uint32(18).bytes(e.payloadType),null!=e.payload&&Object.hasOwnProperty.call(e,"payload")&&t.uint32(26).bytes(e.payload),null!=e.signature&&Object.hasOwnProperty.call(e,"signature")&&t.uint32(42).bytes(e.signature),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.Envelope;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.publicKey=e.bytes();break;case 2:n.payloadType=e.bytes();break;case 3:n.payload=e.bytes();break;case 5:n.signature=e.bytes();break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.Envelope)return e;var t=new a.Envelope;return null!=e.publicKey&&("string"===typeof e.publicKey?s.base64.decode(e.publicKey,t.publicKey=s.newBuffer(s.base64.length(e.publicKey)),0):e.publicKey.length&&(t.publicKey=e.publicKey)),null!=e.payloadType&&("string"===typeof e.payloadType?s.base64.decode(e.payloadType,t.payloadType=s.newBuffer(s.base64.length(e.payloadType)),0):e.payloadType.length&&(t.payloadType=e.payloadType)),null!=e.payload&&("string"===typeof e.payload?s.base64.decode(e.payload,t.payload=s.newBuffer(s.base64.length(e.payload)),0):e.payload.length&&(t.payload=e.payload)),null!=e.signature&&("string"===typeof e.signature?s.base64.decode(e.signature,t.signature=s.newBuffer(s.base64.length(e.signature)),0):e.signature.length&&(t.signature=e.signature)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.publicKey="":(r.publicKey=[],t.bytes!==Array&&(r.publicKey=s.newBuffer(r.publicKey))),t.bytes===String?r.payloadType="":(r.payloadType=[],t.bytes!==Array&&(r.payloadType=s.newBuffer(r.payloadType))),t.bytes===String?r.payload="":(r.payload=[],t.bytes!==Array&&(r.payload=s.newBuffer(r.payload))),t.bytes===String?r.signature="":(r.signature=[],t.bytes!==Array&&(r.signature=s.newBuffer(r.signature)))),null!=e.publicKey&&e.hasOwnProperty("publicKey")&&(r.publicKey=t.bytes===String?s.base64.encode(e.publicKey,0,e.publicKey.length):t.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey),null!=e.payloadType&&e.hasOwnProperty("payloadType")&&(r.payloadType=t.bytes===String?s.base64.encode(e.payloadType,0,e.payloadType.length):t.bytes===Array?Array.prototype.slice.call(e.payloadType):e.payloadType),null!=e.payload&&e.hasOwnProperty("payload")&&(r.payload=t.bytes===String?s.base64.encode(e.payload,0,e.payload.length):t.bytes===Array?Array.prototype.slice.call(e.payload):e.payload),null!=e.signature&&e.hasOwnProperty("signature")&&(r.signature=t.bytes===String?s.base64.encode(e.signature,0,e.signature.length):t.bytes===Array?Array.prototype.slice.call(e.signature):e.signature),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},5503:(e,t,r)=>{"use strict";const n=r(61446),{concat:i}=r(83122),{fromString:o}=r(98897),s=r(13328),a=r(96732),u=r(16980),{equals:c}=r(56213),{codes:h}=r(16422),{Envelope:l}=r(71438);class f{constructor(e){let{peerId:t,payloadType:r,payload:n,signature:i}=e;this.peerId=t,this.payloadType=r,this.payload=n,this.signature=i,this._marshal=void 0}marshal(){if(this._marshal)return this._marshal;const e=s.marshalPublicKey(this.peerId.pubKey);return this._marshal=l.encode({publicKey:e,payloadType:this.payloadType,payload:this.payload,signature:this.signature}).finish(),this._marshal}equals(e){return c(this.peerId.pubKey.bytes,e.peerId.pubKey.bytes)&&c(this.payloadType,e.payloadType)&&c(this.payload,e.payload)&&c(this.signature,e.signature)}validate(e){const t=d(e,this.payloadType,this.payload);return this.peerId.pubKey.verify(t,this.signature)}}const d=(e,t,r)=>{const n=o(e),s=u.encode(n.byteLength),a=u.encode(t.length),c=u.encode(r.length);return i([new Uint8Array(s),n,new Uint8Array(a),t,new Uint8Array(c),r])};f.createFromProtobuf=async e=>{const t=l.decode(e),r=await a.createFromPubKey(t.publicKey);return new f({peerId:r,payloadType:t.payloadType,payload:t.payload,signature:t.signature})},f.seal=async(e,t)=>{const r=e.domain,n=e.codec,i=e.marshal(),o=d(r,n,i),s=await t.privKey.sign(o);return new f({peerId:t,payloadType:n,payload:i,signature:s})},f.openAndCertify=async(e,t)=>{const r=await f.createFromProtobuf(e);if(!await r.validate(t))throw n(new Error("envelope signature is not valid for the given domain"),h.ERR_SIGNATURE_NOT_VALID);return r},e.exports=f},62497:e=>{"use strict";const t=Uint8Array.from([3,1]);e.exports={ENVELOPE_DOMAIN_PEER_RECORD:"libp2p-peer-record",ENVELOPE_PAYLOAD_TYPE_PEER_RECORD:t}},73197:(e,t,r)=>{"use strict";const{Multiaddr:n}=r(57604),i=r(96732),o=r(83805),{PeerRecord:s}=r(67964),{ENVELOPE_DOMAIN_PEER_RECORD:a,ENVELOPE_PAYLOAD_TYPE_PEER_RECORD:u}=r(62497);class c{constructor(e){let{peerId:t,multiaddrs:r=[],seqNumber:n=Date.now()}=e;this.domain=a,this.codec=u,this.peerId=t,this.multiaddrs=r,this.seqNumber=n,this._marshal=void 0}marshal(){return this._marshal||(this._marshal=s.encode({peerId:this.peerId.toBytes(),seq:this.seqNumber,addresses:this.multiaddrs.map((e=>({multiaddr:e.bytes})))}).finish()),this._marshal}equals(e){return e instanceof c&&(!!this.peerId.equals(e.peerId)&&(this.seqNumber===e.seqNumber&&!!o(this.multiaddrs,e.multiaddrs)))}}c.createFromProtobuf=e=>{const t=s.decode(e),r=i.createFromBytes(t.peerId),o=(t.addresses||[]).map((e=>new n(e.multiaddr))),a=Number(t.seq);return new c({peerId:r,multiaddrs:o,seqNumber:a})},c.DOMAIN=a,e.exports=c},67964:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-peer-record"]||(n.roots["libp2p-peer-record"]={});a.PeerRecord=function(){function e(e){if(this.addresses=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.peerId=s.newBuffer([]),e.prototype.seq=s.Long?s.Long.fromBits(0,0,!0):0,e.prototype.addresses=s.emptyArray,e.encode=function(e,t){if(t||(t=o.create()),null!=e.peerId&&Object.hasOwnProperty.call(e,"peerId")&&t.uint32(10).bytes(e.peerId),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(16).uint64(e.seq),null!=e.addresses&&e.addresses.length)for(var r=0;r<e.addresses.length;++r)a.PeerRecord.AddressInfo.encode(e.addresses[r],t.uint32(26).fork()).ldelim();return t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PeerRecord;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.peerId=e.bytes();break;case 2:n.seq=e.uint64();break;case 3:n.addresses&&n.addresses.length||(n.addresses=[]),n.addresses.push(a.PeerRecord.AddressInfo.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.fromObject=function(e){if(e instanceof a.PeerRecord)return e;var t=new a.PeerRecord;if(null!=e.peerId&&("string"===typeof e.peerId?s.base64.decode(e.peerId,t.peerId=s.newBuffer(s.base64.length(e.peerId)),0):e.peerId.length&&(t.peerId=e.peerId)),null!=e.seq&&(s.Long?(t.seq=s.Long.fromValue(e.seq)).unsigned=!0:"string"===typeof e.seq?t.seq=parseInt(e.seq,10):"number"===typeof e.seq?t.seq=e.seq:"object"===typeof e.seq&&(t.seq=new s.LongBits(e.seq.low>>>0,e.seq.high>>>0).toNumber(!0))),e.addresses){if(!Array.isArray(e.addresses))throw TypeError(".PeerRecord.addresses: array expected");t.addresses=[];for(var r=0;r<e.addresses.length;++r){if("object"!==typeof e.addresses[r])throw TypeError(".PeerRecord.addresses: object expected");t.addresses[r]=a.PeerRecord.AddressInfo.fromObject(e.addresses[r])}}return t},e.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.addresses=[]),t.defaults)if(t.bytes===String?r.peerId="":(r.peerId=[],t.bytes!==Array&&(r.peerId=s.newBuffer(r.peerId))),s.Long){var n=new s.Long(0,0,!0);r.seq=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.seq=t.longs===String?"0":0;if(null!=e.peerId&&e.hasOwnProperty("peerId")&&(r.peerId=t.bytes===String?s.base64.encode(e.peerId,0,e.peerId.length):t.bytes===Array?Array.prototype.slice.call(e.peerId):e.peerId),null!=e.seq&&e.hasOwnProperty("seq")&&("number"===typeof e.seq?r.seq=t.longs===String?String(e.seq):e.seq:r.seq=t.longs===String?s.Long.prototype.toString.call(e.seq):t.longs===Number?new s.LongBits(e.seq.low>>>0,e.seq.high>>>0).toNumber(!0):e.seq),e.addresses&&e.addresses.length){r.addresses=[];for(var i=0;i<e.addresses.length;++i)r.addresses[i]=a.PeerRecord.AddressInfo.toObject(e.addresses[i],t)}return r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.AddressInfo=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.multiaddr=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),null!=e.multiaddr&&Object.hasOwnProperty.call(e,"multiaddr")&&t.uint32(10).bytes(e.multiaddr),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PeerRecord.AddressInfo;e.pos<r;){var o=e.uint32();if(o>>>3===1)n.multiaddr=e.bytes();else e.skipType(7&o)}return n},e.fromObject=function(e){if(e instanceof a.PeerRecord.AddressInfo)return e;var t=new a.PeerRecord.AddressInfo;return null!=e.multiaddr&&("string"===typeof e.multiaddr?s.base64.decode(e.multiaddr,t.multiaddr=s.newBuffer(s.base64.length(e.multiaddr)),0):e.multiaddr.length&&(t.multiaddr=e.multiaddr)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.multiaddr="":(r.multiaddr=[],t.bytes!==Array&&(r.multiaddr=s.newBuffer(r.multiaddr)))),null!=e.multiaddr&&e.hasOwnProperty("multiaddr")&&(r.multiaddr=t.bytes===String?s.base64.encode(e.multiaddr,0,e.multiaddr.length):t.bytes===Array?Array.prototype.slice.call(e.multiaddr):e.multiaddr),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e}(),e.exports=a},80362:(e,t,r)=>{"use strict";const n=r(5503),i=r(73197);e.exports.updateSelfPeerRecord=async function(e){const t=new i({peerId:e.peerId,multiaddrs:e.multiaddrs}),r=await n.seal(t,e.peerId);e.peerStore.addressBook.consumePeerRecord(r)}},28410:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:registrar"),{error:n("libp2p:registrar:err")}),o=r(61446),{codes:{ERR_INVALID_PARAMETERS:s}}=r(16422),a=r(82714);e.exports=class{constructor(e){let{peerStore:t,connectionManager:r}=e;this.peerStore=t,this.connectionManager=r,this.topologies=new Map,this._handle=void 0,this._onDisconnect=this._onDisconnect.bind(this),this.connectionManager.on("peer:disconnect",this._onDisconnect)}get handle(){return this._handle}set handle(e){this._handle=e}getConnection(e){return this.connectionManager.get(e)}register(e){if(!a.isTopology(e))throw i.error("topology must be an instance of interfaces/topology"),o(new Error("topology must be an instance of interfaces/topology"),s);const t=(1e9*Math.random()).toString(36)+Date.now();return this.topologies.set(t,e),e.registrar=this,t}unregister(e){return this.topologies.delete(e)}_onDisconnect(e){for(const[,t]of this.topologies)t.disconnect(e.remotePeer)}}},48610:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:transports"),{error:n("libp2p:transports:err")}),o=r(43982),{codes:s}=r(16422),a=r(61446),{updateSelfPeerRecord:u}=r(80362);class c{constructor(e){let{libp2p:t,upgrader:r,faultTolerance:n=h.FATAL_ALL}=e;this.libp2p=t,this.upgrader=r,this._transports=new Map,this._listeners=new Map,this._listenerOptions=new Map,this.faultTolerance=n}add(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(i("adding %s",e),!e)throw a(new Error("Transport must have a valid key, was given '".concat(e,"'")),s.ERR_INVALID_KEY);if(this._transports.has(e))throw a(new Error("There is already a transport with this key"),s.ERR_DUPLICATE_TRANSPORT);const n=new t({...r,libp2p:this.libp2p,upgrader:this.upgrader});this._transports.set(e,n),this._listenerOptions.set(e,r.listenerOptions||{}),this._listeners.has(e)||this._listeners.set(e,[])}async close(){const e=[];for(const[t,r]of this._listeners)for(i("closing listeners for %s",t);r.length;){const t=r.pop();t.removeAllListeners("listening"),t.removeAllListeners("close"),e.push(t.close())}await Promise.all(e),i("all listeners closed");for(const t of this._listeners.keys())this._listeners.set(t,[])}async dial(e,t){const r=this.transportForMultiaddr(e);if(!r)throw a(new Error("No transport available for address ".concat(String(e))),s.ERR_TRANSPORT_UNAVAILABLE);try{return await r.dial(e,t)}catch(n){throw n.code||(n.code=s.ERR_TRANSPORT_DIAL_FAILED),n}}getAddrs(){let e=[];for(const t of this._listeners.values())for(const r of t)e=[...e,...r.getAddrs()];return e}getTransports(){return this._transports.values()}transportForMultiaddr(e){for(const t of this._transports.values()){if(t.filter([e]).length)return t}return null}async listen(e){if(!e||0===e.length)return void i("no addresses were provided for listening, this node is dial only");const t=[];for(const[r,n]of this._transports.entries()){const c=n.filter(e),l=[];for(const e of c){i("creating listener for %s on %s",r,e);const t=n.createListener(this._listenerOptions.get(r));this._listeners.get(r).push(t),t.on("listening",(()=>u(this.libp2p))),t.on("close",(()=>u(this.libp2p))),l.push(t.listen(e))}if(0===l.length){t.push(r);continue}if(!(await o(l)).find((e=>!0===e.isFulfilled))&&this.faultTolerance!==h.NO_FATAL)throw a(new Error("Transport (".concat(r,") could not listen on any available address")),s.ERR_NO_VALID_ADDRESSES)}if(t.length===this._transports.size){const e="no valid addresses were provided for transports [".concat(t,"]");if(this.faultTolerance===h.FATAL_ALL)throw a(new Error(e),s.ERR_NO_VALID_ADDRESSES);i("libp2p in dial mode only: ".concat(e))}}async remove(e){if(i("removing %s",e),this._listeners.has(e))for(const t of this._listeners.get(e))t.removeAllListeners("listening"),t.removeAllListeners("close"),await t.close();this._transports.delete(e),this._listeners.delete(e)}async removeAll(){const e=[];for(const t of this._transports.keys())e.push(this.remove(t));await Promise.all(e)}}const h={FATAL_ALL:0,NO_FATAL:1};c.FaultTolerance=h,e.exports=c},84205:(e,t,r)=>{"use strict";const n=r(39287),i=Object.assign(n("libp2p:upgrader"),{error:n("libp2p:upgrader:err")}),o=r(61446),s=r(50560),{Connection:a}=r(27653),u=r(96732),{pipe:c}=r(91522),h=r(21197),{codes:l}=r(16422);e.exports=class{constructor(e){let{localPeer:t,metrics:r,cryptos:n=new Map,muxers:i=new Map,onConnectionEnd:o=(()=>{}),onConnection:s=(()=>{})}=e;this.localPeer=t,this.metrics=r,this.cryptos=n,this.muxers=i,this.protector=null,this.protocols=new Map,this.onConnection=s,this.onConnectionEnd=o}async upgradeInbound(e){let t,r,n,o,s,a,u;if(this.metrics){({setTarget:a,proxy:u}=h());const t=(1e9*Math.random()).toString(36)+Date.now();a({toB58String:()=>t}),e=this.metrics.trackStream({stream:e,remotePeer:u})}i("Starting the inbound connection upgrade");let c=e;this.protector&&(c=await this.protector.protect(e));try{({conn:t,remotePeer:r,protocol:s}=await this._encryptInbound(this.localPeer,c,this.cryptos)),this.muxers.size?({stream:n,Muxer:o}=await this._multiplexInbound(t,this.muxers)):n=t}catch(l){throw i.error("Failed to upgrade inbound connection",l),await e.close(l),l}return this.metrics&&(this.metrics.updatePlaceholder(u,r),a(r)),i("Successfully upgraded inbound connection"),this._createConnection({cryptoProtocol:s,direction:"inbound",maConn:e,upgradedConn:n,Muxer:o,remotePeer:r})}async upgradeOutbound(e){const t=e.remoteAddr.getPeerId();if(!t)throw o(new Error("outbound connection must have a peer id"),l.ERR_INVALID_MULTIADDR);const r=u.createFromB58String(t);let n,s,a,c,f,d,p;if(this.metrics){({setTarget:d,proxy:p}=h());const t=(1e9*Math.random()).toString(36)+Date.now();d({toB58String:()=>t}),e=this.metrics.trackStream({stream:e,remotePeer:p})}i("Starting the outbound connection upgrade");let y=e;this.protector&&(y=await this.protector.protect(e));try{({conn:n,remotePeer:s,protocol:c}=await this._encryptOutbound(this.localPeer,y,r,this.cryptos)),this.muxers.size?({stream:a,Muxer:f}=await this._multiplexOutbound(n,this.muxers)):a=n}catch(g){throw i.error("Failed to upgrade outbound connection",g),await e.close(g),g}return this.metrics&&(this.metrics.updatePlaceholder(p,s),d(s)),i("Successfully upgraded outbound connection"),this._createConnection({cryptoProtocol:c,direction:"outbound",maConn:e,upgradedConn:a,Muxer:f,remotePeer:s})}_createConnection(e){var t=this;let r,n,u,{cryptoProtocol:h,direction:f,maConn:d,upgradedConn:p,Muxer:y,remotePeer:g}=e;y&&(r=new y({onStream:async e=>{if(!u)return;const t=new s.Listener(e);try{const{stream:r,protocol:n}=await t.handle(Array.from(this.protocols.keys()));i("%s: incoming stream opened on %s",f,n),this.metrics&&this.metrics.trackStream({stream:r,remotePeer:g,protocol:n}),u.addStream(e,{protocol:n}),this._onStream({connection:u,stream:{...e,...r},protocol:n})}catch(r){i.error(r)}},onStreamEnd:e=>{u.removeStream(e.id)}}),n=async e=>{i("%s: starting new stream on %s",f,e);const t=r.newStream(),n=new s.Dialer(t);try{const{stream:r,protocol:i}=await n.select(e);return this.metrics&&this.metrics.trackStream({stream:r,remotePeer:g,protocol:i}),{stream:{...t,...r},protocol:i}}catch(a){throw i.error("could not create new stream",a),o(a,l.ERR_UNSUPPORTED_PROTOCOL)}},c(p,r,p).catch(i.error));const m=d.timeline;d.timeline=new Proxy(m,{set:function(){return u&&"close"===(arguments.length<=1?void 0:arguments[1])&&(arguments.length<=2?void 0:arguments[2])&&!m.close&&(async()=>{try{"open"===u.stat.status&&await u.close()}catch(e){i.error(e)}finally{t.onConnectionEnd(u)}})(),Reflect.set(...arguments)}}),d.timeline.upgraded=Date.now();const b=()=>{throw o(new Error("connection is not multiplexed"),"ERR_CONNECTION_NOT_MULTIPLEXED")};return u=new a({localAddr:d.localAddr,remoteAddr:d.remoteAddr,localPeer:this.localPeer,remotePeer:g,stat:{direction:f,timeline:d.timeline,multiplexer:y&&y.multicodec,encryption:h},newStream:n||b,getStreams:()=>r?r.streams:b(),close:async()=>{await d.close(),r&&r.streams.map((e=>e.abort()))}}),this.onConnection(u),u}_onStream(e){let{connection:t,stream:r,protocol:n}=e;this.protocols.get(n)({connection:t,stream:r,protocol:n})}async _encryptInbound(e,t,r){const n=new s.Listener(t),a=Array.from(r.keys());i("handling inbound crypto protocol selection",a);try{const{stream:t,protocol:o}=await n.handle(a),s=r.get(o);if(i("encrypting inbound connection..."),!s)throw new Error("no crypto module found for ".concat(o));return{...await s.secureInbound(e,t),protocol:o}}catch(u){throw o(u,l.ERR_ENCRYPTION_FAILED)}}async _encryptOutbound(e,t,r,n){const a=new s.Dialer(t),u=Array.from(n.keys());i("selecting outbound crypto protocol",u);try{const{stream:t,protocol:o}=await a.select(u),s=n.get(o);if(i("encrypting outbound connection to %j",r),!s)throw new Error("no crypto module found for ".concat(o));return{...await s.secureOutbound(e,t,r),protocol:o}}catch(c){throw o(c,l.ERR_ENCRYPTION_FAILED)}}async _multiplexOutbound(e,t){const r=new s.Dialer(e),n=Array.from(t.keys());i("outbound selecting muxer %s",n);try{const{stream:e,protocol:o}=await r.select(n);i("%s selected as muxer protocol",o);return{stream:e,Muxer:t.get(o)}}catch(a){throw o(a,l.ERR_MUXER_UNAVAILABLE)}}async _multiplexInbound(e,t){const r=new s.Listener(e),n=Array.from(t.keys());i("inbound handling muxers %s",n);try{const{stream:e,protocol:i}=await r.handle(n);return{stream:e,Muxer:t.get(i)}}catch(a){throw o(a,l.ERR_MUXER_UNAVAILABLE)}}}},46787:(e,t,r)=>{var n="Expected a function",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,u=parseInt,c="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,h="object"==typeof self&&self&&self.Object===Object&&self,l=c||h||Function("return this")(),f=Object.prototype.toString,d=Math.max,p=Math.min,y=function(){return l.Date.now()};function g(e,t,r){var i,o,s,a,u,c,h=0,l=!1,f=!1,g=!0;if("function"!=typeof e)throw new TypeError(n);function v(t){var r=i,n=o;return i=o=void 0,h=t,a=e.apply(n,r)}function w(e){return h=e,u=setTimeout(E,t),l?v(e):a}function _(e){var r=e-c;return void 0===c||r>=t||r<0||f&&e-h>=s}function E(){var e=y();if(_(e))return S(e);u=setTimeout(E,function(e){var r=t-(e-c);return f?p(r,s-(e-h)):r}(e))}function S(e){return u=void 0,g&&i?v(e):(i=o=void 0,a)}function M(){var e=y(),r=_(e);if(i=arguments,o=this,c=e,r){if(void 0===u)return w(c);if(f)return u=setTimeout(E,t),v(c)}return void 0===u&&(u=setTimeout(E,t)),a}return t=b(t)||0,m(r)&&(l=!!r.leading,s=(f="maxWait"in r)?d(b(r.maxWait)||0,t):s,g="trailing"in r?!!r.trailing:g),M.cancel=function(){void 0!==u&&clearTimeout(u),h=0,i=c=o=u=void 0},M.flush=function(){return void 0===u?a:S(y())},M}function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==f.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var r=s.test(e);return r||a.test(e)?u(e.slice(2),r?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError(n);return m(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),g(e,t,{leading:i,maxWait:t,trailing:o})}},74395:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(A){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},o={};function s(e,t){var r,n,s;return t?(s=0<=(e>>>=0)&&e<256)&&(n=o[e])?n:(r=u(e,(0|e)<0?-1:0,!0),s&&(o[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(n=i[e])?n:(r=u(e,e<0?-1:0,!1),s&&(i[e]=r),r)}function a(e,t){if(isNaN(e))return t?m:g;if(t){if(e<0)return m;if(e>=d)return E}else{if(e<=-p)return S;if(e+1>=p)return _}return e<0?a(-e,t).neg():u(e%f|0,e/f|0,t)}function u(e,t,n){return new r(e,t,n)}r.fromInt=s,r.fromNumber=a,r.fromBits=u;var c=Math.pow;function h(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"===typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return h(e.substring(1),t,r).neg();for(var i=a(c(r,8)),o=g,s=0;s<e.length;s+=8){var u=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+u),r);if(u<8){var f=a(c(r,u));o=o.mul(f).add(a(l))}else o=(o=o.mul(i)).add(a(l))}return o.unsigned=t,o}function l(e,t){return"number"===typeof e?a(e,t):"string"===typeof e?h(e,t):u(e.low,e.high,"boolean"===typeof t?t:e.unsigned)}r.fromString=h,r.fromValue=l;var f=4294967296,d=f*f,p=d/2,y=s(1<<24),g=s(0);r.ZERO=g;var m=s(0,!0);r.UZERO=m;var b=s(1);r.ONE=b;var v=s(1,!0);r.UONE=v;var w=s(-1);r.NEG_ONE=w;var _=u(-1,2147483647,!1);r.MAX_VALUE=_;var E=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=E;var S=u(0,-2147483648,!1);r.MIN_VALUE=S;var M=r.prototype;M.toInt=function(){return this.unsigned?this.low>>>0:this.low},M.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},M.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var t=a(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(c(e,6),this.unsigned),o=this,s="";;){var u=o.div(i),h=(o.sub(u.mul(i)).toInt()>>>0).toString(e);if((o=u).isZero())return h+s;for(;h.length<6;)h="0"+h;s=""+h+s}},M.getHighBits=function(){return this.high},M.getHighBitsUnsigned=function(){return this.high>>>0},M.getLowBits=function(){return this.low},M.getLowBitsUnsigned=function(){return this.low>>>0},M.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},M.isZero=function(){return 0===this.high&&0===this.low},M.eqz=M.isZero,M.isNegative=function(){return!this.unsigned&&this.high<0},M.isPositive=function(){return this.unsigned||this.high>=0},M.isOdd=function(){return 1===(1&this.low)},M.isEven=function(){return 0===(1&this.low)},M.equals=function(e){return n(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!==1||e.high>>>31!==1)&&(this.high===e.high&&this.low===e.low)},M.eq=M.equals,M.notEquals=function(e){return!this.eq(e)},M.neq=M.notEquals,M.ne=M.notEquals,M.lessThan=function(e){return this.comp(e)<0},M.lt=M.lessThan,M.lessThanOrEqual=function(e){return this.comp(e)<=0},M.lte=M.lessThanOrEqual,M.le=M.lessThanOrEqual,M.greaterThan=function(e){return this.comp(e)>0},M.gt=M.greaterThan,M.greaterThanOrEqual=function(e){return this.comp(e)>=0},M.gte=M.greaterThanOrEqual,M.ge=M.greaterThanOrEqual,M.compare=function(e){if(n(e)||(e=l(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},M.comp=M.compare,M.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(b)},M.neg=M.negate,M.add=function(e){n(e)||(e=l(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,a=65535&e.high,c=e.low>>>16,h=0,f=0,d=0,p=0;return d+=(p+=o+(65535&e.low))>>>16,f+=(d+=i+c)>>>16,h+=(f+=r+a)>>>16,h+=t+s,u((d&=65535)<<16|(p&=65535),(h&=65535)<<16|(f&=65535),this.unsigned)},M.subtract=function(e){return n(e)||(e=l(e)),this.add(e.neg())},M.sub=M.subtract,M.multiply=function(e){if(this.isZero())return g;if(n(e)||(e=l(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(S))return e.isOdd()?S:g;if(e.eq(S))return this.isOdd()?S:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,o=this.low>>>16,s=65535&this.low,c=e.high>>>16,h=65535&e.high,f=e.low>>>16,d=65535&e.low,p=0,m=0,b=0,v=0;return b+=(v+=s*d)>>>16,m+=(b+=o*d)>>>16,b&=65535,m+=(b+=s*f)>>>16,p+=(m+=i*d)>>>16,m&=65535,p+=(m+=o*f)>>>16,m&=65535,p+=(m+=s*h)>>>16,p+=r*d+i*f+o*h+s*c,u((b&=65535)<<16|(v&=65535),(p&=65535)<<16|(m&=65535),this.unsigned)},M.mul=M.multiply,M.divide=function(e){if(n(e)||(e=l(e)),e.isZero())throw Error("division by zero");var r,i,o;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return v;o=m}else{if(this.eq(S))return e.eq(b)||e.eq(w)?S:e.eq(S)?b:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:w:(i=this.sub(e.mul(r)),o=r.add(i.div(e)));if(e.eq(S))return this.unsigned?m:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=g}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),h=s<=48?1:c(2,s-48),f=a(r),d=f.mul(e);d.isNegative()||d.gt(i);)d=(f=a(r-=h,this.unsigned)).mul(e);f.isZero()&&(f=b),o=o.add(f),i=i.sub(d)}return o},M.div=M.divide,M.modulo=function(e){return n(e)||(e=l(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},M.mod=M.modulo,M.rem=M.modulo,M.not=function(){return u(~this.low,~this.high,this.unsigned)},M.and=function(e){return n(e)||(e=l(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},M.or=function(e){return n(e)||(e=l(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},M.xor=function(e){return n(e)||(e=l(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},M.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},M.shl=M.shiftLeft,M.shiftRight=function(e){return n(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},M.shr=M.shiftRight,M.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},M.shru=M.shiftRightUnsigned,M.shr_u=M.shiftRightUnsigned,M.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},M.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},M.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},M.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},M.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},27862:(e,t,r)=>{"use strict";const{Multiaddr:n}=r(57604),i=P("dns4"),o=P("dns6"),s=P("dnsaddr"),a=R(P("dns"),s,i,o),u=R(P("ip4"),P("ip6")),c=R(T(u,P("tcp")),T(a,P("tcp"))),h=T(u,P("udp")),l=T(h,P("utp")),f=T(h,P("quic")),d=R(T(c,P("ws")),T(a,P("ws"))),p=R(T(c,P("wss")),T(a,P("wss"))),y=R(T(c,P("http")),T(u,P("http")),T(a,P("http"))),g=R(T(c,P("https")),T(u,P("https")),T(a,P("https"))),m=R(T(d,P("p2p-webrtc-star"),P("p2p")),T(p,P("p2p-webrtc-star"),P("p2p")),T(d,P("p2p-webrtc-star")),T(p,P("p2p-webrtc-star"))),b=R(T(d,P("p2p-websocket-star"),P("p2p")),T(p,P("p2p-websocket-star"),P("p2p")),T(d,P("p2p-websocket-star")),T(p,P("p2p-websocket-star"))),v=R(T(y,P("p2p-webrtc-direct"),P("p2p")),T(g,P("p2p-webrtc-direct"),P("p2p")),T(y,P("p2p-webrtc-direct")),T(g,P("p2p-webrtc-direct"))),w=R(d,p,y,g,m,v,c,l,f,a),_=R(T(w,P("p2p-stardust"),P("p2p")),T(w,P("p2p-stardust"))),E=R(T(w,P("p2p")),m,v,P("p2p")),S=R(T(E,P("p2p-circuit"),E),T(E,P("p2p-circuit")),T(P("p2p-circuit"),E),T(w,P("p2p-circuit")),T(P("p2p-circuit"),w),P("p2p-circuit")),M=()=>R(T(S,M),S),A=M(),I=R(T(A,E,A),T(E,A),T(A,E),A,E);function k(e){return function(t){if(!n.isMultiaddr(t))try{t=new n(t)}catch(i){return!1}const r=e(t.protoNames());return null!==r&&(!0===r||!1===r?r:0===r.length)}}function T(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];function n(e){if(e.length<t.length)return null;let r=e;return t.some((t=>(r="function"===typeof t?t().partialMatch(e):t.partialMatch(e),Array.isArray(r)&&(e=r),null===r))),r}return{toString:function(){return"{ "+t.join(" ")+" }"},input:t,matches:k(n),partialMatch:n}}function R(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];function n(e){let r=null;return t.some((t=>{const n="function"===typeof t?t().partialMatch(e):t.partialMatch(e);return!!n&&(r=n,!0)})),r}const i={toString:function(){return"{ "+t.join(" ")+" }"},input:t,matches:k(n),partialMatch:n};return i}function P(e){const t=e;return{toString:function(){return t},matches:function(e){let r;if("string"===typeof e||e instanceof Uint8Array)try{r=new n(e)}catch(o){return!1}else r=e;const i=r.protoNames();return 1===i.length&&i[0]===t},partialMatch:function(e){return 0===e.length?null:e[0]===t?e.slice(1):null}}}e.exports={DNS:a,DNS4:i,DNS6:o,DNSADDR:s,IP:u,TCP:c,UDP:h,QUIC:f,UTP:l,HTTP:y,HTTPS:g,WebSockets:d,WebSocketsSecure:p,WebSocketStar:b,WebRTCStar:m,WebRTCDirect:v,Reliable:w,Stardust:_,Circuit:A,P2P:I,IPFS:I}},54582:function(e,t,r){"use strict";const n=r(89359),{hasOwnProperty:i}=Object.prototype,{propertyIsEnumerable:o}=Object,s=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}),a=this,u={concatArrays:!1,ignoreUndefined:!1},c=e=>{const t=[];for(const r in e)i.call(e,r)&&t.push(r);if(Object.getOwnPropertySymbols){const r=Object.getOwnPropertySymbols(e);for(const n of r)o.call(e,n)&&t.push(n)}return t};function h(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return c(e).forEach((r=>{s(t,r,h(e[r]))})),t}(e):n(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return c(e).forEach((r=>{s(t,r,h(e[r]))})),t}(e):e}const l=(e,t,r,n)=>(r.forEach((r=>{"undefined"===typeof t[r]&&n.ignoreUndefined||(r in e&&e[r]!==Object.getPrototypeOf(e)?s(e,r,f(e[r],t[r],n)):s(e,r,h(t[r])))})),e);function f(e,t,r){return r.concatArrays&&Array.isArray(e)&&Array.isArray(t)?((e,t,r)=>{let n=e.slice(0,0),o=0;return[e,t].forEach((t=>{const a=[];for(let r=0;r<t.length;r++)i.call(t,r)&&(a.push(String(r)),s(n,o++,t===e?t[r]:h(t[r])));n=l(n,t,c(t).filter((e=>!a.includes(e))),r)})),n})(e,t,r):n(t)&&n(e)?l(e,t,c(t),r):h(t)}e.exports=function(){const e=f(h(u),this!==a&&this||{},u);let t={_:{}};for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];for(const s of i)if(void 0!==s){if(!n(s))throw new TypeError("`"+s+"` is not an Option Object");t=f(t,{_:s},e)}return t._}},36247:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},90670:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!==typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},18173:e=>{var t=1e3,r=60*t,n=60*r,i=24*n,o=7*i,s=365.25*i;function a(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,u){u=u||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(e);if("number"===c&&isFinite(e))return u.long?function(e){var o=Math.abs(e);if(o>=i)return a(e,o,i,"day");if(o>=n)return a(e,o,n,"hour");if(o>=r)return a(e,o,r,"minute");if(o>=t)return a(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=i)return Math.round(e/i)+"d";if(o>=n)return Math.round(e/n)+"h";if(o>=r)return Math.round(e/r)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},23911:(e,t,r)=>{const{Multiaddr:n}=r(57604),i=(e,t)=>t,o={ip4:i,ip6:(e,t,r,n)=>1===n.length&&"ip6"===n[0].protocol?t:"[".concat(t,"]"),tcp:(e,t,r,n,i)=>n.some((e=>["http","https","ws","wss"].includes(e.protocol)))?"".concat(e,":").concat(t):((e,t,r,n)=>{if(n&&!1===n.assumeHttp)return"tcp://".concat(e,":").concat(t);let i="tcp",o=":".concat(t);return"tcp"===r[r.length-1].protocol&&(i="443"===t?"https":"http",o="443"===t||"80"===t?"":o),"".concat(i,"://").concat(e).concat(o)})(e,t,n,i),udp:(e,t)=>"udp://".concat(e,":").concat(t),dnsaddr:i,dns4:i,dns6:i,ipfs:(e,t)=>"".concat(e,"/ipfs/").concat(t),p2p:(e,t)=>"".concat(e,"/p2p/").concat(t),http:e=>"http://".concat(e),https:e=>"https://".concat(e),ws:e=>"ws://".concat(e),wss:e=>"wss://".concat(e),"p2p-websocket-star":e=>"".concat(e,"/p2p-websocket-star"),"p2p-webrtc-star":e=>"".concat(e,"/p2p-webrtc-star"),"p2p-webrtc-direct":e=>"".concat(e,"/p2p-webrtc-direct")};e.exports=(e,t)=>{const r=new n(e),i=e.toString().split("/").slice(1);return r.tuples().map((e=>({protocol:i.shift(),content:e[1]?i.shift():null}))).reduce(((e,r,n,i)=>{const s=o[r.protocol];if(!s)throw new Error("Unsupported protocol ".concat(r.protocol));return s(e,r.content,n,i,t)}),"")}},54483:(e,t,r)=>{"use strict";const n=r(52442),i=r(68792),o=r(16980),{concat:s}=r(62734),{toString:a}=r(27578);function u(e){const t=[],r=e.split("/").slice(1);if(1===r.length&&""===r[0])return[];for(let n=0;n<r.length;n++){const o=r[n],s=i(o);if(0!==s.size){if(n++,n>=r.length)throw v("invalid address: "+e);if(s.path){t.push([o,b(r.slice(n).join("/"))]);break}t.push([o,r[n]])}else t.push([o])}return t}function c(e){const t=[];return e.map((e=>{const r=w(e);return t.push(r.name),e.length>1&&t.push(e[1]),null})),b(t.join("/"))}function h(e){return e.map((e=>{Array.isArray(e)||(e=[e]);const t=w(e);return e.length>1?[t.code,n.toBytes(t.code,e[1])]:[t.code]}))}function l(e){return e.map((e=>{const t=w(e);return e[1]?[t.code,n.toString(t.code,e[1])]:[t.code]}))}function f(e){return g(s(e.map((e=>{const t=w(e);let r=Uint8Array.from(o.encode(t.code));return e.length>1&&(r=s([r,e[1]])),r}))))}function d(e,t){if(e.size>0)return e.size/8;if(0===e.size)return 0;return o.decode(t)+o.decode.bytes}function p(e){const t=[];let r=0;for(;r<e.length;){const n=o.decode(e,r),s=o.decode.bytes,u=d(i(n),e.slice(r+s));if(0===u){t.push([n]),r+=s;continue}const c=e.slice(r+s,r+s+u);if(r+=u+s,r>e.length)throw v("Invalid address Uint8Array: "+a(e,"base16"));t.push([n,c])}return t}function y(e){return f(h(u(e=b(e))))}function g(e){const t=m(e);if(t)throw t;return Uint8Array.from(e)}function m(e){try{p(e)}catch(t){return t}}function b(e){return"/"+e.trim().split("/").filter((e=>e)).join("/")}function v(e){return new Error("Error parsing address: "+e)}function w(e){return i(e[0])}e.exports={stringToStringTuples:u,stringTuplesToString:c,tuplesToStringTuples:l,stringTuplesToTuples:h,bytesToTuples:p,tuplesToBytes:f,bytesToString:function(e){const t=p(e);return c(l(t))},stringToBytes:y,fromString:function(e){return y(e)},fromBytes:g,validateBytes:m,isValidBytes:function(e){return void 0===m(e)},cleanPath:b,ParseError:v,protoFromTuple:w,sizeForAddr:d}},52442:(e,t,r)=>{"use strict";const n=r(55743),i=r(68792),{CID:o}=r(91759),{base32:s}=r(36206),{base58btc:a}=r(59376),u=r(27893),c=r(16980),{toString:h}=r(27578),{fromString:l}=r(49667),{concat:f}=r(62734);function d(e,t){return t instanceof Uint8Array?d.toString(e,t):d.toBytes(e,t)}function p(e){if(!n.isIP(e))throw new Error("invalid ip address");return n.toBytes(e)}function y(e){const t=new ArrayBuffer(2);return new DataView(t).setUint16(0,e),new Uint8Array(t)}function g(e){return new DataView(e.buffer).getUint16(e.byteOffset)}function m(e){const t=e.slice(0,e.length-2),r=e.slice(e.length-2);return h(t,"base32")+":"+g(r)}e.exports=d,d.toString=function(e,t){switch(i(e).code){case 4:case 41:return function(e){const t=n.toString(e);if(!t||!n.isIP(t))throw new Error("invalid ip address");return t}(t);case 6:case 273:case 33:case 132:return g(t).toString();case 53:case 54:case 55:case 56:case 400:case 777:return function(e){const t=c.decode(e);if((e=e.slice(c.decode.bytes)).length!==t)throw new Error("inconsistent lengths");return h(e)}(t);case 421:return function(e){const t=c.decode(e),r=e.slice(c.decode.bytes);if(r.length!==t)throw new Error("inconsistent lengths");return h(r,"base58btc")}(t);case 444:case 445:return m(t);default:return h(t,"base16")}},d.toBytes=function(e,t){switch(i(e).code){case 4:case 41:return p(t);case 6:case 273:case 33:case 132:return y(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 777:return function(e){const t=l(e),r=Uint8Array.from(c.encode(t.length));return f([r,t],r.length+t.length)}(t);case 421:return function(e){let t;t="Q"===e[0]||"1"===e[0]?u.decode(a.decode("z".concat(e))).bytes:o.parse(e).multihash.bytes;const r=Uint8Array.from(c.encode(t.length));return f([r,t],r.length+t.length)}(t);case 444:return function(e){const t=e.split(":");if(2!==t.length)throw new Error("failed to parse onion addr: "+t+" does not contain a port number");if(16!==t[0].length)throw new Error("failed to parse onion addr: "+t[0]+" not a Tor onion address.");const r=s.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");const i=y(n);return f([r,i],r.length+i.length)}(t);case 445:return function(e){const t=e.split(":");if(2!==t.length)throw new Error("failed to parse onion addr: "+t+" does not contain a port number");if(56!==t[0].length)throw new Error("failed to parse onion addr: "+t[0]+" not a Tor onion3 address.");const r=s.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");const i=y(n);return f([r,i],r.length+i.length)}(t);default:return l(t,"base16")}}},57604:(e,t,r)=>{"use strict";const n=r(54483),i=r(68792),o=r(16980),{CID:s}=r(91759),{base58btc:a}=r(59376),u=r(61446),c=Symbol.for("nodejs.util.inspect.custom"),{toString:h}=r(27578),{equals:l}=r(3034),f=new Map,d=Symbol.for("@multiformats/js-multiaddr/multiaddr");class p{constructor(e){if(null==e&&(e=""),Object.defineProperty(this,d,{value:!0}),e instanceof Uint8Array)this.bytes=n.fromBytes(e);else if("string"===typeof e){if(e.length>0&&"/"!==e.charAt(0))throw new Error('multiaddr "'.concat(e,'" must start with a "/"'));this.bytes=n.fromString(e)}else{if(!p.isMultiaddr(e))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=n.fromBytes(e.bytes)}}toString(){return n.bytesToString(this.bytes)}toJSON(){return this.toString()}toOptions(){const e={},t=this.toString().split("/");return e.family="ip4"===t[1]?4:6,e.host=t[2],e.transport=t[3],e.port=parseInt(t[4]),e}protos(){return this.protoCodes().map((e=>Object.assign({},i(e))))}protoCodes(){const e=[],t=this.bytes;let r=0;for(;r<t.length;){const s=o.decode(t,r),a=o.decode.bytes,u=i(s);r+=n.sizeForAddr(u,t.slice(r+a))+a,e.push(s)}return e}protoNames(){return this.protos().map((e=>e.name))}tuples(){return n.bytesToTuples(this.bytes)}stringTuples(){const e=n.bytesToTuples(this.bytes);return n.tuplesToStringTuples(e)}encapsulate(e){return e=new p(e),new p(this.toString()+e.toString())}decapsulate(e){const t=e.toString(),r=this.toString(),n=r.lastIndexOf(t);if(n<0)throw new Error("Address "+this+" does not contain subaddress: "+e);return new p(r.slice(0,n))}decapsulateCode(e){const t=this.tuples();for(let r=t.length-1;r>=0;r--)if(t[r][0]===e)return new p(n.tuplesToBytes(t.slice(0,r)));return this}getPeerId(){try{const e=this.stringTuples().filter((e=>e[0]===i.names.ipfs.code)),t=e.pop();if(t&&t[1]){const e=t[1];return"Q"===e[0]||"1"===e[0]?h(a.decode("z".concat(e)),"base58btc"):h(s.parse(e).multihash.bytes,"base58btc")}return null}catch(e){return null}}getPath(){let e=null;try{e=this.stringTuples().filter((e=>!!i(e[0]).path))[0][1],e||(e=null)}catch(t){e=null}return e}equals(e){return l(this.bytes,e.bytes)}async resolve(){const e=this.protos().find((e=>e.resolvable));if(!e)return[this];const t=f.get(e.name);if(!t)throw u(new Error("no available resolver for ".concat(e.name)),"ERR_NO_AVAILABLE_RESOLVER");return(await t(this)).map((e=>new p(e)))}nodeAddress(){const e=this.protoCodes(),t=this.protoNames(),r=this.toString().split("/").slice(1);if(r.length<4)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6}/{address}/{tcp, udp}/{port}".');if(4!==e[0]&&41!==e[0]&&54!==e[0]&&55!==e[0])throw new Error("no protocol with name: \"'".concat(t[0],'\'". Must have a valid family name: "{ip4, ip6, dns4, dns6}".'));if("tcp"!==r[2]&&"udp"!==r[2])throw new Error("no protocol with name: \"'".concat(t[1],'\'". Must have a valid transport protocol: "{tcp, udp}".'));return{family:41===e[0]||55===e[0]?6:4,address:r[1],port:parseInt(r[3])}}isThinWaistAddress(e){const t=(e||this).protos();return 2===t.length&&((4===t[0].code||41===t[0].code)&&(6===t[1].code||273===t[1].code))}static fromNodeAddress(e,t){if(!e)throw new Error("requires node address object");if(!t)throw new Error("requires transport protocol");let r;switch(e.family){case 4:r="ip4";break;case 6:r="ip6";break;default:throw Error("Invalid addr family. Got '".concat(e.family,"' instead of 4 or 6"))}return new p("/"+[r,e.address,t,e.port].join("/"))}static isName(e){return!!p.isMultiaddr(e)&&e.protos().some((e=>e.resolvable))}static isMultiaddr(e){return e instanceof p||Boolean(e&&e[d])}[c](){return"<Multiaddr "+h(this.bytes,"base16")+" - "+n.bytesToString(this.bytes)+">"}inspect(){return"<Multiaddr "+h(this.bytes,"base16")+" - "+n.bytesToString(this.bytes)+">"}}p.protocols=i,p.resolvers=f,e.exports={Multiaddr:p,multiaddr:function(e){return new p(e)},protocols:i,resolvers:f}},55743:(e,t,r)=>{"use strict";const n=r(96339),{toString:i}=r(27578),o=n,s=n.v4,a=n.v6,u=function(e,t,r){let n;if(r=~~r,s(e))n=t||new Uint8Array(r+4),e.split(/\./g).map((function(e){n[r++]=255&parseInt(e,10)}));else if(a(e)){const o=e.split(":",8);let a;for(a=0;a<o.length;a++){let e;s(o[a])&&(e=u(o[a]),o[a]=i(e.slice(0,2),"base16")),e&&++a<8&&o.splice(a,0,i(e.slice(2,4),"base16"))}if(""===o[0])for(;o.length<8;)o.unshift("0");else if(""===o[o.length-1])for(;o.length<8;)o.push("0");else if(o.length<8){for(a=0;a<o.length&&""!==o[a];a++);const e=[a,"1"];for(a=9-o.length;a>0;a--)e.push("0");o.splice.apply(o,e)}for(n=t||new Uint8Array(r+16),a=0;a<o.length;a++){const e=parseInt(o[a],16);n[r++]=e>>8&255,n[r++]=255&e}}if(!n)throw Error("Invalid ip address: "+e);return n};e.exports={isIP:o,isV4:s,isV6:a,toBytes:u,toString:function(e,t,r){t=~~t,r=r||e.length-t;const n=[];let i;const o=new DataView(e.buffer);if(4===r){for(let i=0;i<r;i++)n.push(e[t+i]);i=n.join(".")}else if(16===r){for(let e=0;e<r;e+=2)n.push(o.getUint16(t+e).toString(16));i=n.join(":"),i=i.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3"),i=i.replace(/:{3,4}/,"::")}return i}}},68792:e=>{"use strict";function t(e){if("number"===typeof e){if(t.codes[e])return t.codes[e];throw new Error("no protocol with code: "+e)}if("string"===typeof e){if(t.names[e])return t.names[e];throw new Error("no protocol with name: "+e)}throw new Error("invalid protocol id type: "+e)}const r=-1;function n(e,t,r,n,i){return{code:e,size:t,name:r,resolvable:Boolean(n),path:Boolean(i)}}t.lengthPrefixedVarSize=r,t.V=r,t.table=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,r,"ip6zone"],[53,r,"dns","resolvable"],[54,r,"dns4","resolvable"],[55,r,"dns6","resolvable"],[56,r,"dnsaddr","resolvable"],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,r,"unix",!1,"path"],[421,r,"ipfs"],[421,r,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,r,"garlic64"],[460,0,"quic"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,r,"memory"]],t.names={},t.codes={},t.table.map((e=>{const r=n.apply(null,e);return t.codes[r.code]=r,t.names[r.name]=r,null})),t.object=n,e.exports=t},33980:(e,t,r)=>{"use strict";const n=r(19120);e.exports=n},56776:(e,t,r)=>{"use strict";const n=r(68792),{code:i}=n("dnsaddr");e.exports={dnsaddrResolver:async function(e){const t=new(r(33980)),n=e.getPeerId(),[,o]=e.stringTuples().find((e=>{let[t]=e;return t===i}))||[];let s=(await t.resolveTxt("_dnsaddr.".concat(o))).flat().map((e=>e.split("=")[1]));return n&&(s=s.filter((e=>e.includes(n)))),s}}},15571:(e,t,r)=>{"use strict";const{encodeText:n}=r(77886);e.exports=class{constructor(e,t,r,i){this.name=e,this.code=t,this.codeBuf=n(this.code),this.alphabet=i,this.codec=r(i)}encode(e){return this.codec.encode(e)}decode(e){for(const t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error("invalid character '".concat(t,"' in '").concat(e,"'"));return this.codec.decode(e)}}},90769:(e,t,r)=>{"use strict";const n=r(73119),i=r(15571),{rfc4648:o}=r(18623),{decodeText:s,encodeText:a}=r(77886),u=[["identity","\0",()=>({encode:s,decode:a}),""],["base2","0",o(1),"01"],["base8","7",o(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",o(4),"0123456789abcdef"],["base16upper","F",o(4),"0123456789ABCDEF"],["base32hex","v",o(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",o(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",o(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",o(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",o(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],c=u.reduce(((e,t)=>(e[t[0]]=new i(t[0],t[1],t[2],t[3]),e)),{}),h=u.reduce(((e,t)=>(e[t[1]]=c[t[0]],e)),{});e.exports={names:c,codes:h}},99149:(e,t,r)=>{"use strict";const n=r(90769),{encodeText:i,decodeText:o,concat:s}=r(77886);function a(e){if(Object.prototype.hasOwnProperty.call(n.names,e))return n.names[e];if(Object.prototype.hasOwnProperty.call(n.codes,e))return n.codes[e];throw new Error("Unsupported encoding: ".concat(e))}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");const{name:r,codeBuf:n}=a(e);return function(e,t){a(e).decode(o(t))}(r,t),s([n,t],n.length+t.length)}).encode=function(e,t){const r=a(e),n=i(r.encode(t));return s([r.codeBuf,n],r.codeBuf.length+n.length)},t.decode=function(e){e instanceof Uint8Array&&(e=o(e));const t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),a(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=o(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return a(e[0]).name}catch(t){return!1}},t.encoding=a,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=o(e)),a(e[0])};const u=Object.freeze(n.names),c=Object.freeze(n.codes);t.names=u,t.codes=c},18623:e=>{"use strict";e.exports={rfc4648:e=>t=>({encode:r=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<<r)-1;let o="",s=0,a=0;for(let u=0;u<e.length;++u)for(a=a<<8|e[u],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o})(r,t,e),decode:r=>((e,t,r)=>{const n={};for(let c=0;c<t.length;++c)n[t[c]]=c;let i=e.length;for(;"="===e[i-1];)--i;const o=new Uint8Array(i*r/8|0);let s=0,a=0,u=0;for(let c=0;c<i;++c){const t=n[e[c]];if(void 0===t)throw new SyntaxError("Invalid character "+e[c]);a=a<<r|t,s+=r,s>=8&&(s-=8,o[u++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o})(r,t,e)})}},77886:e=>{"use strict";const t=new TextDecoder,r=new TextEncoder;e.exports={decodeText:e=>t.decode(e),encodeText:e=>r.encode(e),concat:function(e,t){const r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}}},24357:e=>{e.exports=function e(t,r){var n,i=0,o=0,s=r=r||0,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return e.bytes=s-r,i}},75829:e=>{e.exports=function e(r,n,i){n=n||[];var o=i=i||0;for(;r>=t;)n[i++]=255&r|128,r/=128;for(;-128&r;)n[i++]=255&r|128,r>>>=7;return n[i]=0|r,e.bytes=i-o+1,n};var t=Math.pow(2,31)},69968:(e,t,r)=>{e.exports={encode:r(75829),decode:r(24357),encodingLength:r(67544)}},67544:e=>{var t=Math.pow(2,7),r=Math.pow(2,14),n=Math.pow(2,21),i=Math.pow(2,28),o=Math.pow(2,35),s=Math.pow(2,42),a=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e<t?1:e<r?2:e<n?3:e<i?4:e<o?5:e<s?6:e<a?7:e<u?8:e<c?9:10}},22141:e=>{"use strict";const t=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});e.exports={names:t}},15218:(e,t,r)=>{"use strict";const n=r(99149),i=r(69968),{names:o}=r(22141),{toString:s}=r(69025),{fromString:a}=r(13763),{concat:u}=r(319),c={};for(const y in o){const e=y;c[o[e]]=e}function h(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(e.length<2)throw new Error("multihash too short. must be > 2 bytes.");const t=i.decode(e);if(!d(t))throw new Error("multihash unknown function code: 0x".concat(t.toString(16)));e=e.slice(i.decode.bytes);const r=i.decode(e);if(r<0)throw new Error("multihash invalid length: ".concat(r));if((e=e.slice(i.decode.bytes)).length!==r)throw new Error("multihash length inconsistent: 0x".concat(s(e,"base16")));return{code:t,name:c[t],length:r,digest:e}}function l(e){let t=e;if("string"===typeof e){if(void 0===o[e])throw new Error("Unrecognized hash function named: ".concat(e));t=o[e]}if("number"!==typeof t)throw new Error("Hash function code should be a number. Got: ".concat(t));if(void 0===c[t]&&!f(t))throw new Error("Unrecognized function code: ".concat(t));return t}function f(e){return e>0&&e<16}function d(e){return!!f(e)||!!c[e]}function p(e){h(e)}Object.freeze(c),e.exports={names:o,codes:c,toHexString:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return s(e,"base16")},fromHexString:function(e){return a(e,"base16")},toB58String:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return s(n.encode("base58btc",e)).slice(1)},fromB58String:function(e){const t=e instanceof Uint8Array?s(e):e;return n.decode("z"+t)},decode:h,encode:function(e,t,r){if(!e||void 0===t)throw new Error("multihash encode requires at least two args: digest, code");const n=l(t);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==r&&(r=e.length),r&&e.length!==r)throw new Error("digest length should be equal to specified length.");const o=i.encode(n),s=i.encode(r);return u([o,s,e],o.length+s.length+e.length)},coerceCode:l,isAppCode:f,validate:p,prefix:function(e){return p(e),e.subarray(0,2)},isValidCode:d}},3031:(e,t)=>{"use strict";t.PROTOCOL_ID="/multistream/1.0.0"},47545:(e,t,r)=>{"use strict";const n=r(39287)("mss:handle"),i=r(64277),o=r(15839),s=r(16389),{PROTOCOL_ID:a}=r(3031);e.exports=async(e,t)=>{t=Array.isArray(t)?t:[t];const{writer:r,reader:u,rest:c,stream:h}=s(e);for(;;){const e=(await o.read(u)).toString();if(n('read "%s"',e),e!==a){if(t.includes(e))return o.write(r,e),n('respond with "%s" for "%s"',e,e),c(),{stream:h,protocol:e};"ls"!==e?(o.write(r,"na"),n('respond with "na" for "%s"',e)):(o.write(r,new i(t.map((e=>o.encode(e))))),n('respond with "%s" for %s',t,e))}else n('respond with "%s" for "%s"',a,e),o.write(r,a)}}},50560:(e,t,r)=>{"use strict";const n=r(79218),i=r(47545),o=r(44599),{PROTOCOL_ID:s}=r(3031);t.PROTOCOL_ID=s;class a{constructor(e){this._stream=e,this._shaken=!1}async _handshake(){if(this._shaken)return;const{stream:e}=await n(this._stream,s);this._stream=e,this._shaken=!0}}t.Dialer=class extends a{select(e){return n(this._stream,e,this._shaken?null:s)}async ls(){await this._handshake();const{stream:e,protocols:t}=await o(this._stream);return this._stream=e,t}};t.Listener=class extends a{handle(e){return i(this._stream,e)}}},44599:(e,t,r)=>{"use strict";const n=r(44606),i=r(39287)("it-multistream-select:ls"),o=r(15839),s=r(16389),a=r(4666),u=r(91522);e.exports=async e=>{const{reader:t,writer:r,rest:c,stream:h}=s(e);i('write "ls"'),o.write(r,"ls"),c();const l=await o.read(t),f=n([l]),d=[];return await u(f,a.decode(),(async e=>{for await(const t of e)d.push(t.shallowSlice(0,-1).toString())})),{stream:h,protocols:d}}},15839:(e,t,r)=>{"use strict";const n=r(64277),i=r(4666),o=r(91522),s=r(61446),a=r(6113),u=r(11903),c=a("\n");t.encode=e=>i.encode.single(new n([e,c])),t.write=(e,r)=>e.push(t.encode(r)),t.writeAll=(e,r)=>{e.push(r.reduce(((e,r)=>e.append(t.encode(r))),new n))},t.read=async e=>{let t=1;const r={[Symbol.asyncIterator](){return this},next:()=>e.next(t)},n=await o(r,i.decode({onLength:e=>{t=e}}),u);if(n.get(n.length-1)!==c[0])throw s(new Error("missing newline"),"ERR_INVALID_MULTISTREAM_SELECT_MESSAGE");return n.shallowSlice(0,-1)}},79218:(e,t,r)=>{"use strict";const n=r(39287)("mss:select"),i=r(61446),o=r(15839),s=r(16389);e.exports=async(e,t,r)=>{t=Array.isArray(t)?[...t]:[t];const{reader:a,writer:u,rest:c,stream:h}=s(e),l=t.shift();r?(n('select: write ["%s", "%s"]',r,l),o.writeAll(u,[r,l])):(n('select: write "%s"',l),o.write(u,l));let f=(await o.read(a)).toString();if(n('select: read "%s"',f),f===r&&(f=(await o.read(a)).toString(),n('select: read "%s"',f)),f===l)return c(),{stream:h,protocol:l};for(const i of t){n('select: write "%s"',i),o.write(u,i);const e=(await o.read(a)).toString();if(n('select: read "%s" for "%s"',e,i),e===i)return c(),{stream:h,protocol:i}}throw c(),i(new Error("protocol selection failed"),"ERR_UNSUPPORTED_PROTOCOL")}},21197:e=>{"use strict";function t(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}e.exports=function(e){var r=void 0,n=void 0;function i(e){if(!(e instanceof Object))throw new Error('Target "'+e+'" is not an object');n=e}function o(e){Object.keys(e).forEach((function(t){var r=e[t];if("function"!==typeof r)throw new Error('Trap "'+t+": "+r+'" is not a function');if(!Reflect[t])throw new Error('Trap "'+t+": "+r+'" is not a valid trap')})),r=e}i((function(){})),e&&i(e),o(Reflect);var s=new Proxy({},{get:function(e,i){return function(){for(var e=arguments.length,o=Array(e),s=0;s<e;s++)o[s]=arguments[s];return r[i].apply(null,[n].concat(t(o.slice(1))))}}});return{setTarget:i,setHandler:o,getTarget:function(){return n},getHandler:function(){return r},proxy:new Proxy(n,s)}}},12023:(e,t,r)=>{"use strict";let n;n=globalThis.AbortController&&globalThis.AbortSignal?globalThis:r(90834),e.exports={AbortController:n.AbortController,AbortSignal:n.AbortSignal}},8113:(e,t,r)=>{"use strict";globalThis.fetch&&globalThis.Headers&&globalThis.Request&&globalThis.Response?e.exports={default:globalThis.fetch,Headers:globalThis.Headers,Request:globalThis.Request,Response:globalThis.Response}:e.exports={default:r(690).default,Headers:r(690).Headers,Request:r(690).Request,Response:r(690).Response}},14971:function(e,t){(function(){var e,r,n,i,o,s,a,u;u=function(e){return[(e&255<<24)>>>24,(e&255<<16)>>>16,(65280&e)>>>8,255&e].join(".")},a=function(e){var t,n,i,o,s,a;for(t=[],i=o=0;o<=3&&0!==e.length;i=++o){if(i>0){if("."!==e[0])throw new Error("Invalid IP");e=e.substring(1)}s=(a=r(e))[0],n=a[1],e=e.substring(n),t.push(s)}if(0!==e.length)throw new Error("Invalid IP");switch(t.length){case 1:if(t[0]>4294967295)throw new Error("Invalid IP");return t[0]>>>0;case 2:if(t[0]>255||t[1]>16777215)throw new Error("Invalid IP");return(t[0]<<24|t[1])>>>0;case 3:if(t[0]>255||t[1]>255||t[2]>65535)throw new Error("Invalid IP");return(t[0]<<24|t[1]<<16|t[2])>>>0;case 4:if(t[0]>255||t[1]>255||t[2]>255||t[3]>255)throw new Error("Invalid IP");return(t[0]<<24|t[1]<<16|t[2]<<8|t[3])>>>0;default:throw new Error("Invalid IP")}},i=(n=function(e){return e.charCodeAt(0)})("0"),s=n("a"),o=n("A"),r=function(e){var t,r,a,u,c;for(u=0,t=10,r="9",a=0,e.length>1&&"0"===e[a]&&("x"===e[a+1]||"X"===e[a+1]?(a+=2,t=16):"0"<=e[a+1]&&e[a+1]<="9"&&(a++,t=8,r="7")),c=a;a<e.length;){if("0"<=e[a]&&e[a]<=r)u=u*t+(n(e[a])-i)>>>0;else{if(16!==t)break;if("a"<=e[a]&&e[a]<="f")u=u*t+(10+n(e[a])-s)>>>0;else{if(!("A"<=e[a]&&e[a]<="F"))break;u=u*t+(10+n(e[a])-o)>>>0}}if(u>4294967295)throw new Error("too large");a++}if(a===c)throw new Error("empty octet");return[u,a]},e=function(){function e(e,t){var r,n,i;if("string"!==typeof e)throw new Error("Missing `net' parameter");if(t||(i=e.split("/",2),e=i[0],t=i[1]),t||(t=32),"string"===typeof t&&t.indexOf(".")>-1){try{this.maskLong=a(t)}catch(o){throw o,new Error("Invalid mask: "+t)}for(r=n=32;n>=0;r=--n)if(this.maskLong===4294967295<<32-r>>>0){this.bitmask=r;break}}else{if(!t&&0!==t)throw new Error("Invalid mask: empty");this.bitmask=parseInt(t,10),this.maskLong=0,this.bitmask>0&&(this.maskLong=4294967295<<32-this.bitmask>>>0)}try{this.netLong=(a(e)&this.maskLong)>>>0}catch(o){throw o,new Error("Invalid net address: "+e)}if(!(this.bitmask<=32))throw new Error("Invalid mask for ip4: "+t);this.size=Math.pow(2,32-this.bitmask),this.base=u(this.netLong),this.mask=u(this.maskLong),this.hostmask=u(~this.maskLong),this.first=this.bitmask<=30?u(this.netLong+1):this.base,this.last=this.bitmask<=30?u(this.netLong+this.size-2):u(this.netLong+this.size-1),this.broadcast=this.bitmask<=30?u(this.netLong+this.size-1):void 0}return e.prototype.contains=function(t){return"string"===typeof t&&(t.indexOf("/")>0||4!==t.split(".").length)&&(t=new e(t)),t instanceof e?this.contains(t.base)&&this.contains(t.broadcast||t.last):(a(t)&this.maskLong)>>>0===(this.netLong&this.maskLong)>>>0},e.prototype.next=function(t){return null==t&&(t=1),new e(u(this.netLong+this.size*t),this.mask)},e.prototype.forEach=function(e){var t,r,n;for(n=a(this.first),r=a(this.last),t=0;n<=r;)e(u(n),n,t),t++,n++},e.prototype.toString=function(){return this.base+"/"+this.bitmask},e}(),t.ip2long=a,t.long2ip=u,t.Netmask=e}).call(this)},690:(e,t)=>{"use strict";var r=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},16221:(e,t,r)=>{var n=r(5525);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(76579),r(66180),r(35139),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){h||l();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return d(r._w,e,t,!1)},decrypt:function(e,t){return d(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!==typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i<t.length;++i)r.putByte(t[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){t=r,r=[];var o=t.length();if(16===o||24===o||32===o){o>>>=2;for(i=0;i<o;++i)r.push(t.getInt32())}}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var s=this.mode.name,a=-1!==["CFB","OFB","CTR","GCM"].indexOf(s);this._w=f(r,e.decrypt&&!a),this._init=!0}},n.aes._expandKey=function(e,t){return h||l(),f(e,t)},n.aes._updateBlock=d,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var o,s,a,u,c,h=!1;function l(){h=!0,a=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;o=new Array(256),s=new Array(256),u=new Array(4),c=new Array(4);for(t=0;t<4;++t)u[t]=new Array(256),c[t]=new Array(256);var r,n,i,l,f,d,p,y=0,g=0;for(t=0;t<256;++t){l=(l=g^g<<1^g<<2^g<<3^g<<4)>>8^255&l^99,o[y]=l,s[l]=y,d=(f=e[l])<<24^l<<16^l<<8^l^f,p=((r=e[y])^(n=e[r])^(i=e[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var m=0;m<4;++m)u[m][y]=d,c[m][l]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===y?y=g=1:(y=r^e[e[e[r^i]]],g^=e[e[g]])}}function f(e,t){for(var r,n=e.slice(0),i=1,s=n.length,u=4*(s+6+1),h=s;h<u;++h)r=n[h-1],h%s===0?(r=o[r>>>16&255]<<24^o[r>>>8&255]<<16^o[255&r]<<8^o[r>>>24]^a[i]<<24,i++):s>6&&h%s===4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[255&r]),n[h]=n[h-s]^r;if(t){for(var l,f=c[0],d=c[1],p=c[2],y=c[3],g=n.slice(0),m=(h=0,(u=n.length)-4);h<u;h+=4,m-=4)if(0===h||h===u-4)g[h]=n[m],g[h+1]=n[m+3],g[h+2]=n[m+2],g[h+3]=n[m+1];else for(var b=0;b<4;++b)l=n[m+b],g[h+(3&-b)]=f[o[l>>>24]]^d[o[l>>>16&255]]^p[o[l>>>8&255]]^y[o[255&l]];n=g}return n}function d(e,t,r,n){var i,a,h,l,f,d,p,y,g,m,b,v,w=e.length/4-1;n?(i=c[0],a=c[1],h=c[2],l=c[3],f=s):(i=u[0],a=u[1],h=u[2],l=u[3],f=o),d=t[0]^e[0],p=t[n?3:1]^e[1],y=t[2]^e[2],g=t[n?1:3]^e[3];for(var _=3,E=1;E<w;++E)m=i[d>>>24]^a[p>>>16&255]^h[y>>>8&255]^l[255&g]^e[++_],b=i[p>>>24]^a[y>>>16&255]^h[g>>>8&255]^l[255&d]^e[++_],v=i[y>>>24]^a[g>>>16&255]^h[d>>>8&255]^l[255&p]^e[++_],g=i[g>>>24]^a[d>>>16&255]^h[p>>>8&255]^l[255&y]^e[++_],d=m,p=b,y=v;r[0]=f[d>>>24]<<24^f[p>>>16&255]<<16^f[y>>>8&255]<<8^f[255&g]^e[++_],r[n?3:1]=f[p>>>24]<<24^f[y>>>16&255]<<16^f[g>>>8&255]<<8^f[255&d]^e[++_],r[2]=f[y>>>24]<<24^f[g>>>16&255]<<16^f[d>>>8&255]<<8^f[255&p]^e[++_],r[n?1:3]=f[g>>>24]<<24^f[d>>>16&255]<<16^f[p>>>8&255]<<8^f[255&y]^e[++_]}function p(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=e,i.call(t,r)},t}},66530:(e,t,r)=>{var n=r(5525);r(93758);var i=n.asn1;t.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},t.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},93758:(e,t,r)=>{var n=r(5525);r(35139),r(89777);var i=e.exports=n.asn1=n.asn1||{};function o(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,o,s){if(n.util.isArray(o)){for(var a=[],u=0;u<o.length;++u)void 0!==o[u]&&a.push(o[u]);o=a}var c={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(o),value:o};return s&&"bitStringContents"in s&&(c.bitStringContents=s.bitStringContents,c.original=i.copy(c)),c},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var o=0;o<e.length;++o)r.push(i.copy(e[o],t));return r}return"string"===typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var o=0;o<e.length;++o)if(!i.equals(e[o],t[o]))return!1;return!0}if(typeof e!==typeof t)return!1;if("string"===typeof e)return e===t;var s=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(s=s&&e.bitStringContents===t.bitStringContents),s},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};function s(e,t,r,n){var a;o(e,t,2);var u=e.getByte();t--;var c=192&u,h=31&u;a=e.length();var l,f,d=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;o(e,t,i),n=e.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(e,t);if(t-=a-e.length(),void 0!==d&&d>t){if(n.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=e.length(),p.remaining=t,p.requested=d,p}d=t}var y=32===(32&u);if(y)if(l=[],void 0===d)for(;;){if(o(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}a=e.length(),l.push(s(e,t,r+1,n)),t-=a-e.length()}else for(;d>0;)a=e.length(),l.push(s(e,d,r+1,n)),t-=a-e.length(),d-=a-e.length();if(void 0===l&&c===i.Class.UNIVERSAL&&h===i.Type.BITSTRING&&(f=e.bytes(d)),void 0===l&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&h===i.Type.BITSTRING&&d>1){var g=e.read,m=t,b=0;if(h===i.Type.BITSTRING&&(o(e,t,1),b=e.getByte(),t--),0===b)try{a=e.length();var v=s(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),w=a-e.length();t-=w,h==i.Type.BITSTRING&&w++;var _=v.tagClass;w!==d||_!==i.Class.UNIVERSAL&&_!==i.Class.CONTEXT_SPECIFIC||(l=[v])}catch(S){}void 0===l&&(e.read=g,t=m)}if(void 0===l){if(void 0===d){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=t}if(h===i.Type.BMPSTRING)for(l="";d>0;d-=2)o(e,t,2),l+=String.fromCharCode(e.getInt16()),t-=2;else l=e.getBytes(d)}var E=void 0===f?null:{bitStringContents:f};return i.create(c,h,y,l,E)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"===typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"===typeof e&&(e=n.util.createBuffer(e)),s(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,o=n.util.createBuffer(),s=!1;if("bitStringContents"in e&&(s=!0,e.original&&(s=i.equals(e,e.original))),s)o.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:o.putByte(0);for(var a=0;a<e.value.length;++a)void 0!==e.value[a]&&o.putBuffer(i.toDer(e.value[a]))}else if(e.type===i.Type.BMPSTRING)for(a=0;a<e.value.length;++a)o.putInt16(e.value.charCodeAt(a));else e.type===i.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0===(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128===(128&e.value.charCodeAt(1)))?o.putBytes(e.value.substr(1)):o.putBytes(e.value);if(t.putByte(r),o.length()<=127)t.putByte(127&o.length());else{var u=o.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(a=c.length-1;a>=0;--a)t.putByte(c.charCodeAt(a))}return t.putBuffer(o),t},i.oidToDer=function(e){var t,r,i,o,s=e.split("."),a=n.util.createBuffer();a.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var u=2;u<s.length;++u){t=!0,r=[],i=parseInt(s[u],10);do{o=127&i,i>>>=7,t||(o|=128),r.push(o),t=!1}while(i>0);for(var c=r.length-1;c>=0;--c)a.putByte(r[c])}return a},i.derToOid=function(e){var t;"string"===typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),o=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),a=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(a=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(o,s,a,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var h=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);h*=6e4,"+"===u?t.setTime(+t-h):t.setTime(+t+h)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),a=parseInt(e.substr(12,2),10),u=0,c=0,h=!1;"Z"===e.charAt(e.length-1)&&(h=!0);var l=e.length-5,f=e.charAt(l);"+"!==f&&"-"!==f||(c=60*parseInt(e.substr(l+1,2),10)+parseInt(e.substr(l+4,2),10),c*=6e4,"+"===f&&(c*=-1),h=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),h?(t.setUTCFullYear(r,n,i),t.setUTCHours(o,s,a,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(o,s,a,u)),t},i.dateToUtcTime=function(e){if("string"===typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.dateToGeneralizedTime=function(e){if("string"===typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"===typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,o){var s=!1;if(e.tagClass!==t.tagClass&&"undefined"!==typeof t.tagClass||e.type!==t.type&&"undefined"!==typeof t.type)o&&(e.tagClass!==t.tagClass&&o.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&o.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||"undefined"===typeof t.constructed){if(s=!0,t.value&&n.util.isArray(t.value))for(var a=0,u=0;s&&u<t.value.length;++u)s=t.value[u].optional||!1,e.value[a]&&((s=i.validate(e.value[a],t.value[u],r,o))?++a:t.value[u].optional&&(s=!0)),!s&&o&&o.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(s&&r)if(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else o&&o.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return s};var a=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var o="";r=r||2,(t=t||0)>0&&(o+="\n");for(var s="",u=0;u<t*r;++u)s+=" ";switch(o+=s+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:o+="Universal:";break;case i.Class.APPLICATION:o+="Application:";break;case i.Class.CONTEXT_SPECIFIC:o+="Context-Specific:";break;case i.Class.PRIVATE:o+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(o+=e.type,e.type){case i.Type.NONE:o+=" (None)";break;case i.Type.BOOLEAN:o+=" (Boolean)";break;case i.Type.INTEGER:o+=" (Integer)";break;case i.Type.BITSTRING:o+=" (Bit string)";break;case i.Type.OCTETSTRING:o+=" (Octet string)";break;case i.Type.NULL:o+=" (Null)";break;case i.Type.OID:o+=" (Object Identifier)";break;case i.Type.ODESC:o+=" (Object Descriptor)";break;case i.Type.EXTERNAL:o+=" (External or Instance of)";break;case i.Type.REAL:o+=" (Real)";break;case i.Type.ENUMERATED:o+=" (Enumerated)";break;case i.Type.EMBEDDED:o+=" (Embedded PDV)";break;case i.Type.UTF8:o+=" (UTF8)";break;case i.Type.ROID:o+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:o+=" (Sequence)";break;case i.Type.SET:o+=" (Set)";break;case i.Type.PRINTABLESTRING:o+=" (Printable String)";break;case i.Type.IA5String:o+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:o+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:o+=" (Generalized time)";break;case i.Type.BMPSTRING:o+=" (BMP String)"}else o+=e.type;if(o+="\n",o+=s+"Constructed: "+e.constructed+"\n",e.composed){var c=0,h="";for(u=0;u<e.value.length;++u)void 0!==e.value[u]&&(c+=1,h+=i.prettyPrint(e.value[u],t+1,r),u+1<e.value.length&&(h+=","));o+=s+"Sub values: "+c+h}else{if(o+=s+"Value: ",e.type===i.Type.OID){var l=i.derToOid(e.value);o+=l,n.pki&&n.pki.oids&&l in n.pki.oids&&(o+=" ("+n.pki.oids[l]+") ")}if(e.type===i.Type.INTEGER)try{o+=i.derToInteger(e.value)}catch(d){o+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?o+="0x"+n.util.bytesToHex(e.value.slice(1)):o+="(none)",e.value.length>0){var f=e.value.charCodeAt(0);1==f?o+=" (1 unused bit shown)":f>1&&(o+=" ("+f+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(a.test(e.value)||(o+="("+e.value+") "),o+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?o+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?o+=e.value:a.test(e.value)?o+="0x"+n.util.bytesToHex(e.value):0===e.value.length?o+="[null]":o+=e.value}return o}},89810:(e,t,r)=>{var n=r(47573).Buffer,i={};e.exports=i;var o={};i.encode=function(e,t,r){if("string"!==typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!==typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,o=t.length,s=t.charAt(0),a=[0];for(i=0;i<e.length;++i){for(var u=0,c=e[i];u<a.length;++u)c+=a[u]<<8,a[u]=c%o,c=c/o|0;for(;c>0;)a.push(c%o),c=c/o|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=s;for(i=a.length-1;i>=0;--i)n+=t[a[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),o=[0];for(r=0;r<e.length();++r){for(var s=0,a=e.at(r);s<o.length;++s)a+=o[s]<<8,o[s]=a%n,a=a/n|0;for(;a>0;)o.push(a%n),a=a/n|0}var u="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)u+=i;for(r=o.length-1;r>=0;--r)u+=t[o[r]];return u}(e,t);if(r){var h=new RegExp(".{1,"+r+"}","g");n=n.match(h).join("\r\n")}return n},i.decode=function(e,t){if("string"!==typeof e)throw new TypeError('"input" must be a string.');if("string"!==typeof t)throw new TypeError('"alphabet" must be a string.');var r=o[t];if(!r){r=o[t]=[];for(var i=0;i<t.length;++i)r[t.charCodeAt(i)]=i}e=e.replace(/\s/g,"");var s=t.length,a=t.charAt(0),u=[0];for(i=0;i<e.length;i++){var c=r[e.charCodeAt(i)];if(void 0===c)return;for(var h=0,l=c;h<u.length;++h)l+=u[h]*s,u[h]=255&l,l>>=8;for(;l>0;)u.push(255&l),l>>=8}for(var f=0;e[f]===a&&f<e.length-1;++f)u.push(0);return"undefined"!==typeof n?n.from(u.reverse()):new Uint8Array(u.reverse())}},76579:(e,t,r)=>{var n=r(5525);r(35139),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"===typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"===typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},66180:(e,t,r)=>{var n=r(5525);r(35139),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function o(e,t){if("string"===typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){var o=[],s=t/4;for(i=0;i<s;++i)o.push(e.getInt32());e=o}return e}function s(e){e[e.length-1]=e[e.length-1]+1&4294967295}function a(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(o>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(o>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(a(8*i)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=a(8*t.length());var o=t.length()%this.blockSize;for(o&&t.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o<=0||r){if(r){var a=n%this.blockSize;this._cipherLength+=a,this._partialOutput.truncate(this.blockSize-a)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(a(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var o=[];this.cipher.encrypt(this._j0,o);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^o[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,o=new Array(i),s=0;s<i;++s){var a=[0,0,0,0],u=(n-1-s%n)*t;a[s/n|0]=1<<t-1<<u,o[s]=this.generateSubHashTable(this.multiply(a,e),t)}return o},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var o=n>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o<n;){for(var s=1;s<o;++s){var a=i[o],u=i[s];i[o+s]=[a[0]^u[0],a[1]^u[1],a[2]^u[2],a[3]^u[3]]}o*=2}for(i[0]=[0,0,0,0],o=n+1;o<r;++o){var c=i[o^n];i[o]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i}},34892:(e,t,r)=>{var n=r(5525);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(76579),r(66180),r(35139),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return d(r._keys,e,t,!1)},decrypt:function(e,t){return d(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],h=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],l=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],f=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,w=0;w<g;w++){var _=e.getInt32(),E=e.getInt32();_^=(t=252645135&(_>>>4^E))<<4,_^=t=65535&((E^=t)>>>-16^_),_^=(t=858993459&(_>>>2^(E^=t<<-16)))<<2,_^=t=65535&((E^=t)>>>-16^_),_^=(t=1431655765&(_>>>1^(E^=t<<-16)))<<1,_^=t=16711935&((E^=t)>>>8^_),t=(_^=(t=1431655765&(_>>>1^(E^=t<<8)))<<1)<<8|(E^=t)>>>20&240,_=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=t;for(var S=0;S<b.length;++S){b[S]?(_=_<<2|_>>>26,E=E<<2|E>>>26):(_=_<<1|_>>>27,E=E<<1|E>>>27),E&=-15;var M=r[(_&=-15)>>>28]|n[_>>>24&15]|i[_>>>20&15]|o[_>>>16&15]|s[_>>>12&15]|a[_>>>8&15]|u[_>>>4&15],A=c[E>>>28]|h[E>>>24&15]|l[E>>>20&15]|f[E>>>16&15]|d[E>>>12&15]|p[E>>>8&15]|y[E>>>4&15];t=65535&(A>>>16^M),m[v++]=M^t,m[v++]=A^t<<16}}return m}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],a=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],h=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],l=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],f=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function d(e,t,r,n){var i,d,p=32===e.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];y^=(d=252645135&(y>>>4^g))<<4,y^=(d=65535&(y>>>16^(g^=d)))<<16,y^=d=858993459&((g^=d)>>>2^y),y^=d=16711935&((g^=d<<2)>>>8^y),y=(y^=(d=1431655765&(y>>>1^(g^=d<<8)))<<1)<<1|y>>>31,g=(g^=d)<<1|g>>>31;for(var m=0;m<p;m+=3){for(var b=i[m+1],v=i[m+2],w=i[m];w!=b;w+=v){var _=g^e[w],E=(g>>>4|g<<28)^e[w+1];d=y,y=g,g=d^(s[_>>>24&63]|u[_>>>16&63]|h[_>>>8&63]|f[63&_]|o[E>>>24&63]|a[E>>>16&63]|c[E>>>8&63]|l[63&E])}d=y,y=g,g=d}g=g>>>1|g<<31,g^=d=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(d=16711935&(g>>>8^(y^=d<<1)))<<8,g^=(d=858993459&(g>>>2^(y^=d)))<<2,g^=d=65535&((y^=d)>>>16^g),g^=d=252645135&((y^=d<<16)>>>4^g),y^=d<<4,r[0]=y,r[1]=g}function p(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=e,i.call(t,r)},t}},5409:(e,t,r)=>{var n=r(47573).Buffer,i=r(5525);r(24926),r(99087),r(16654),r(35139);var o=r(66530),s=o.publicKeyValidator,a=o.privateKeyValidator;if("undefined"===typeof u)var u=i.jsbn.BigInteger;var c=i.util.ByteBuffer,h="undefined"===typeof n?Uint8Array:n;i.pki=i.pki||{},e.exports=i.pki.ed25519=i.ed25519=i.ed25519||{};var l=i.ed25519;function f(e){var t=e.message;if(t instanceof Uint8Array||t instanceof h)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"===typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"===typeof t){if("undefined"!==typeof n)return n.from(t,r);t=new c(t,r)}else if(!(t instanceof c))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var i=new h(t.length()),o=0;o<i.length;++o)i[o]=t.at(o);return i}l.constants={},l.constants.PUBLIC_KEY_BYTE_LENGTH=32,l.constants.PRIVATE_KEY_BYTE_LENGTH=64,l.constants.SEED_BYTE_LENGTH=32,l.constants.SIGN_BYTE_LENGTH=64,l.constants.HASH_BYTE_LENGTH=64,l.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=i.random.getBytesSync(l.constants.SEED_BYTE_LENGTH);else if("string"===typeof t){if(t.length!==l.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+l.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=f({message:t,encoding:"binary"});for(var r=new h(l.constants.PUBLIC_KEY_BYTE_LENGTH),n=new h(l.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=t[o];return function(e,t){var r,n=[N(),N(),N(),N()],i=_(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,O(n,i),I(e,n),r=0;r<32;++r)t[r+32]=e[r]}(r,n),{publicKey:r,privateKey:n}},l.privateKeyFromAsn1=function(e){var t={},r=[];if(!i.asn1.validate(e,a,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var o=i.asn1.derToOid(t.privateKeyOid),s=i.oids.EdDSA25519;if(o!==s)throw new Error('Invalid OID "'+o+'"; OID must be "'+s+'".');var u=t.privateKey;return{privateKeyBytes:f({message:i.asn1.fromDer(u).value,encoding:"binary"})}},l.publicKeyFromAsn1=function(e){var t={},r=[];if(!i.asn1.validate(e,s,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var o=i.asn1.derToOid(t.publicKeyOid),a=i.oids.EdDSA25519;if(o!==a)throw new Error('Invalid OID "'+o+'"; OID must be "'+a+'".');var u=t.ed25519PublicKey;if(u.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return f({message:u,encoding:"binary"})},l.publicKeyFromPrivateKey=function(e){var t=f({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+l.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new h(l.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},l.sign=function(e){var t=f(e=e||{}),r=f({message:e.privateKey,encoding:"binary"});if(r.length===l.constants.SEED_BYTE_LENGTH)r=l.generateKeyPair({seed:r}).privateKey;else if(r.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+l.constants.SEED_BYTE_LENGTH+" or "+l.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new h(l.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,n){var i,o,s=new Float64Array(64),a=[N(),N(),N(),N()],u=_(n,32);u[0]&=248,u[31]&=127,u[31]|=64;var c=r+64;for(i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=u[32+i];var h=_(e.subarray(32),r+32);for(S(h),O(a,h),I(e,a),i=32;i<64;++i)e[i]=n[i];var l=_(e,r+64);for(S(l),i=32;i<64;++i)s[i]=0;for(i=0;i<32;++i)s[i]=h[i];for(i=0;i<32;++i)for(o=0;o<32;o++)s[i+o]+=l[i]*u[o];E(e.subarray(32),s)}(n,t,t.length,r);for(var i=new h(l.constants.SIGN_BYTE_LENGTH),o=0;o<i.length;++o)i[o]=n[o];return i},l.verify=function(e){var t=f(e=e||{});if(void 0===e.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=f({message:e.signature,encoding:"binary"});if(r.length!==l.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+l.constants.SIGN_BYTE_LENGTH);var n=f({message:e.publicKey,encoding:"binary"});if(n.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+l.constants.PUBLIC_KEY_BYTE_LENGTH);var i,o=new h(l.constants.SIGN_BYTE_LENGTH+t.length),s=new h(l.constants.SIGN_BYTE_LENGTH+t.length);for(i=0;i<l.constants.SIGN_BYTE_LENGTH;++i)o[i]=r[i];for(i=0;i<t.length;++i)o[i+l.constants.SIGN_BYTE_LENGTH]=t[i];return function(e,t,r,n){var i,o=new h(32),s=[N(),N(),N(),N()],a=[N(),N(),N(),N()];if(-1,r<64)return-1;if(function(e,t){var r=N(),n=N(),i=N(),o=N(),s=N(),a=N(),u=N();x(e[2],p),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),U(i,e[1]),j(o,i,y),K(i,i,e[2]),L(o,e[2],o),U(s,o),U(a,s),j(u,a,s),j(r,u,i),j(r,r,o),function(e,t){var r,n=N();for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)U(n,n),1!==r&&j(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),j(r,r,i),j(r,r,o),j(r,r,o),j(e[0],r,o),U(n,e[0]),j(n,n,o),T(n,i)&&j(e[0],e[0],w);if(U(n,e[0]),j(n,n,o),T(n,i))return-1;P(e[0])===t[31]>>7&&K(e[0],d,e[0]);return j(e[3],e[0],e[1]),0}(a,n))return-1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var u=_(e,r);if(S(u),C(s,a,u),O(a,t.subarray(32)),M(s,a),I(o,s),r-=64,R(t,0,o,0)){for(i=0;i<r;++i)e[i]=0;return-1}for(i=0;i<r;++i)e[i]=t[i+64];return r}(s,o,o.length,n)>=0};var d=N(),p=N([1]),y=N([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),g=N([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),m=N([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),b=N([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),v=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),w=N([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function _(e,t){var r=i.md.sha512.create(),o=new c(e);r.update(o.getBytes(t),"binary");var s=r.digest().getBytes();if("undefined"!==typeof n)return n.from(s,"binary");for(var a=new h(l.constants.HASH_BYTE_LENGTH),u=0;u<64;++u)a[u]=s.charCodeAt(u);return a}function E(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*v[i-(n-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*v[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*v[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function S(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;E(e,t)}function M(e,t){var r=N(),n=N(),i=N(),o=N(),s=N(),a=N(),u=N(),c=N(),h=N();K(r,e[1],e[0]),K(h,t[1],t[0]),j(r,r,h),L(n,e[0],e[1]),L(h,t[0],t[1]),j(n,n,h),j(i,e[3],t[3]),j(i,i,g),j(o,e[2],t[2]),L(o,o,o),K(s,n,r),K(a,o,i),L(u,o,i),L(c,n,r),j(e[0],s,a),j(e[1],c,u),j(e[2],u,a),j(e[3],s,c)}function A(e,t,r){for(var n=0;n<4;++n)D(e[n],t[n],r)}function I(e,t){var r=N(),n=N(),i=N();!function(e,t){var r,n=N();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)U(n,n),2!==r&&4!==r&&j(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(i,t[2]),j(r,t[0],i),j(n,t[1],i),k(e,n),e[31]^=P(r)<<7}function k(e,t){var r,n,i,o=N(),s=N();for(r=0;r<16;++r)s[r]=t[r];for(B(s),B(s),B(s),n=0;n<2;++n){for(o[0]=s[0]-65517,r=1;r<15;++r)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,D(s,o,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function T(e,t){var r=new h(32),n=new h(32);return k(r,e),k(n,t),R(r,0,n,0)}function R(e,t,r,n){return function(e,t,r,n,i){var o,s=0;for(o=0;o<i;++o)s|=e[t+o]^r[n+o];return(1&s-1>>>8)-1}(e,t,r,n,32)}function P(e){var t=new h(32);return k(t,e),1&t[0]}function C(e,t,r){var n,i;for(x(e[0],d),x(e[1],p),x(e[2],p),x(e[3],d),i=255;i>=0;--i)A(e,t,n=r[i/8|0]>>(7&i)&1),M(t,e),M(e,e),A(e,t,n)}function O(e,t){var r=[N(),N(),N(),N()];x(r[0],m),x(r[1],b),x(r[2],p),j(r[3],m,b),C(e,r,t)}function x(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function B(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function D(e,t,r){for(var n,i=~(r-1),o=0;o<16;++o)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function N(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function L(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function K(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function U(e,t){j(e,t,t)}function j(e,t,r){var n,i,o=0,s=0,a=0,u=0,c=0,h=0,l=0,f=0,d=0,p=0,y=0,g=0,m=0,b=0,v=0,w=0,_=0,E=0,S=0,M=0,A=0,I=0,k=0,T=0,R=0,P=0,C=0,O=0,x=0,B=0,D=0,N=r[0],L=r[1],K=r[2],U=r[3],j=r[4],q=r[5],F=r[6],z=r[7],V=r[8],H=r[9],G=r[10],W=r[11],Y=r[12],Z=r[13],X=r[14],J=r[15];o+=(n=t[0])*N,s+=n*L,a+=n*K,u+=n*U,c+=n*j,h+=n*q,l+=n*F,f+=n*z,d+=n*V,p+=n*H,y+=n*G,g+=n*W,m+=n*Y,b+=n*Z,v+=n*X,w+=n*J,s+=(n=t[1])*N,a+=n*L,u+=n*K,c+=n*U,h+=n*j,l+=n*q,f+=n*F,d+=n*z,p+=n*V,y+=n*H,g+=n*G,m+=n*W,b+=n*Y,v+=n*Z,w+=n*X,_+=n*J,a+=(n=t[2])*N,u+=n*L,c+=n*K,h+=n*U,l+=n*j,f+=n*q,d+=n*F,p+=n*z,y+=n*V,g+=n*H,m+=n*G,b+=n*W,v+=n*Y,w+=n*Z,_+=n*X,E+=n*J,u+=(n=t[3])*N,c+=n*L,h+=n*K,l+=n*U,f+=n*j,d+=n*q,p+=n*F,y+=n*z,g+=n*V,m+=n*H,b+=n*G,v+=n*W,w+=n*Y,_+=n*Z,E+=n*X,S+=n*J,c+=(n=t[4])*N,h+=n*L,l+=n*K,f+=n*U,d+=n*j,p+=n*q,y+=n*F,g+=n*z,m+=n*V,b+=n*H,v+=n*G,w+=n*W,_+=n*Y,E+=n*Z,S+=n*X,M+=n*J,h+=(n=t[5])*N,l+=n*L,f+=n*K,d+=n*U,p+=n*j,y+=n*q,g+=n*F,m+=n*z,b+=n*V,v+=n*H,w+=n*G,_+=n*W,E+=n*Y,S+=n*Z,M+=n*X,A+=n*J,l+=(n=t[6])*N,f+=n*L,d+=n*K,p+=n*U,y+=n*j,g+=n*q,m+=n*F,b+=n*z,v+=n*V,w+=n*H,_+=n*G,E+=n*W,S+=n*Y,M+=n*Z,A+=n*X,I+=n*J,f+=(n=t[7])*N,d+=n*L,p+=n*K,y+=n*U,g+=n*j,m+=n*q,b+=n*F,v+=n*z,w+=n*V,_+=n*H,E+=n*G,S+=n*W,M+=n*Y,A+=n*Z,I+=n*X,k+=n*J,d+=(n=t[8])*N,p+=n*L,y+=n*K,g+=n*U,m+=n*j,b+=n*q,v+=n*F,w+=n*z,_+=n*V,E+=n*H,S+=n*G,M+=n*W,A+=n*Y,I+=n*Z,k+=n*X,T+=n*J,p+=(n=t[9])*N,y+=n*L,g+=n*K,m+=n*U,b+=n*j,v+=n*q,w+=n*F,_+=n*z,E+=n*V,S+=n*H,M+=n*G,A+=n*W,I+=n*Y,k+=n*Z,T+=n*X,R+=n*J,y+=(n=t[10])*N,g+=n*L,m+=n*K,b+=n*U,v+=n*j,w+=n*q,_+=n*F,E+=n*z,S+=n*V,M+=n*H,A+=n*G,I+=n*W,k+=n*Y,T+=n*Z,R+=n*X,P+=n*J,g+=(n=t[11])*N,m+=n*L,b+=n*K,v+=n*U,w+=n*j,_+=n*q,E+=n*F,S+=n*z,M+=n*V,A+=n*H,I+=n*G,k+=n*W,T+=n*Y,R+=n*Z,P+=n*X,C+=n*J,m+=(n=t[12])*N,b+=n*L,v+=n*K,w+=n*U,_+=n*j,E+=n*q,S+=n*F,M+=n*z,A+=n*V,I+=n*H,k+=n*G,T+=n*W,R+=n*Y,P+=n*Z,C+=n*X,O+=n*J,b+=(n=t[13])*N,v+=n*L,w+=n*K,_+=n*U,E+=n*j,S+=n*q,M+=n*F,A+=n*z,I+=n*V,k+=n*H,T+=n*G,R+=n*W,P+=n*Y,C+=n*Z,O+=n*X,x+=n*J,v+=(n=t[14])*N,w+=n*L,_+=n*K,E+=n*U,S+=n*j,M+=n*q,A+=n*F,I+=n*z,k+=n*V,T+=n*H,R+=n*G,P+=n*W,C+=n*Y,O+=n*Z,x+=n*X,B+=n*J,w+=(n=t[15])*N,s+=38*(E+=n*K),a+=38*(S+=n*U),u+=38*(M+=n*j),c+=38*(A+=n*q),h+=38*(I+=n*F),l+=38*(k+=n*z),f+=38*(T+=n*V),d+=38*(R+=n*H),p+=38*(P+=n*G),y+=38*(C+=n*W),g+=38*(O+=n*Y),m+=38*(x+=n*Z),b+=38*(B+=n*X),v+=38*(D+=n*J),o=(n=(o+=38*(_+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=u,e[4]=c,e[5]=h,e[6]=l,e[7]=f,e[8]=d,e[9]=p,e[10]=y,e[11]=g,e[12]=m,e[13]=b,e[14]=v,e[15]=w}},5525:e=>{e.exports={options:{usePureJavaScript:!1}}},64937:(e,t,r)=>{var n=r(5525);r(28717),r(35139),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,o={start:function(o,s){if(null!==o)if("string"===typeof o){if(!((o=o.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');t=n.md.algorithms[o].create()}else t=o;if(null===s)s=e;else{if("string"===typeof s)s=n.util.createBuffer(s);else if(n.util.isArray(s)){var a=s;s=n.util.createBuffer();for(var u=0;u<a.length;++u)s.putByte(a[u])}var c=s.length();c>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=s.length();for(u=0;u<c;++u){a=s.at(u);r.putByte(54^a),i.putByte(92^a)}if(c<t.blockLength)for(a=t.blockLength-c,u=0;u<a;++u)r.putByte(54),i.putByte(92);e=s,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return o.digest=o.getMac,o}},24926:(e,t,r)=>{var n,i=r(5525);e.exports=i.jsbn=i.jsbn||{};function o(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function s(){return new o(null)}function a(e,t,r,n,i,o){for(var s=16383&t,a=t>>14;--o>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,h=a*u+c*s;i=((u=s*u+((16383&h)<<14)+r.data[n]+i)>>28)+(h>>14)+a*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=o,"undefined"===typeof navigator?(o.prototype.am=a,n=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(e,t,r,n,i,o){for(var s=32767&t,a=t>>15;--o>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,h=a*u+c*s;i=((u=s*u+((32767&h)<<15)+r.data[n]+(1073741823&i))>>>30)+(h>>>15)+a*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(o.prototype.am=function(e,t,r,n,i,o){for(;--o>=0;){var s=t*this.data[e++]+r.data[n]+i;i=Math.floor(s/67108864),r.data[n++]=67108863&s}return i},n=26):(o.prototype.am=a,n=28),o.prototype.DB=n,o.prototype.DM=(1<<n)-1,o.prototype.DV=1<<n;o.prototype.FV=Math.pow(2,52),o.prototype.F1=52-n,o.prototype.F2=2*n-52;var u,c,h=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)h[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)h[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)h[u++]=c;function l(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function f(e,t){var r=h[e.charCodeAt(t)];return null==r?-1:r}function d(e){var t=s();return t.fromInt(e),t}function p(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function m(e,t){return e&t}function b(e,t){return e|t}function v(e,t){return e^t}function w(e,t){return e&~t}function _(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function E(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function S(){}function M(e){return e}function A(e){this.r2=s(),this.q3=s(),o.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=s();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(o.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=s();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},o.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},o.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},o.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,s=0;--n>=0;){var a=8==r?255&e[n]:f(e,n);a<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==s?this.data[this.t++]=a:s+r>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this.data[this.t++]=a>>this.DB-s):this.data[this.t-1]|=a<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&o.ZERO.subTo(this,this)},o.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},o.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},o.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},o.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,o=(1<<i)-1,s=Math.floor(e/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+s+1]=this.data[r]>>i|a,a=(this.data[r]&o)<<n;for(r=s-1;r>=0;--r)t.data[r]=0;t.data[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()},o.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var s=r+1;s<this.t;++s)t.data[s-r-1]|=(this.data[s]&o)<<i,t.data[s-r]=this.data[s]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}},o.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},o.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&o.ZERO.subTo(t,t)},o.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},o.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=s());var a=s(),u=this.s,c=e.s,h=this.DB-p(n.data[n.t-1]);h>0?(n.lShiftTo(h,a),i.lShiftTo(h,r)):(n.copyTo(a),i.copyTo(r));var l=a.t,f=a.data[l-1];if(0!=f){var d=f*(1<<this.F1)+(l>1?a.data[l-2]>>this.F2:0),y=this.FV/d,g=(1<<this.F1)/d,m=1<<this.F2,b=r.t,v=b-l,w=null==t?s():t;for(a.dlShiftTo(v,w),r.compareTo(w)>=0&&(r.data[r.t++]=1,r.subTo(w,r)),o.ONE.dlShiftTo(l,w),w.subTo(a,a);a.t<l;)a.data[a.t++]=0;for(;--v>=0;){var _=r.data[--b]==f?this.DM:Math.floor(r.data[b]*y+(r.data[b-1]+m)*g);if((r.data[b]+=a.am(0,_,r,v,0,l))<_)for(a.dlShiftTo(v,w),r.subTo(w,r);r.data[b]<--_;)r.subTo(w,r)}null!=t&&(r.drShiftTo(l,t),u!=c&&o.ZERO.subTo(t,t)),r.t=l,r.clamp(),h>0&&r.rShiftTo(h,r),u<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(e,t){if(e>4294967295||e<1)return o.ONE;var r=s(),n=s(),i=t.convert(this),a=p(e)-1;for(i.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},o.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(r=this.data[s]>>a)>0&&(i=!0,o=l(r));s>=0;)a<t?(r=(this.data[s]&(1<<a)-1)<<t-a,r|=this.data[--s]>>(a+=this.DB-t)):(r=this.data[s]>>(a-=t)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=l(r));return i?o:"0"},o.prototype.negate=function(){var e=s();return o.ZERO.subTo(this,e),e},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(e){var t=s();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(o.ZERO)>0&&e.subTo(t,t),t},o.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new g(t),this.exp(e,r)},o.ZERO=d(0),o.ONE=d(1),S.prototype.convert=M,S.prototype.revert=M,S.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},S.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=s();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var I=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],k=(1<<26)/I[I.length-1];o.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},o.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=d(r),i=s(),o=s(),a="";for(this.divRemTo(n,i,o);i.signum()>0;)a=(r+o.intValue()).toString(e).substr(1)+a,i.divRemTo(n,i,o);return o.intValue().toString(e)+a},o.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,s=0,a=0,u=0;u<e.length;++u){var c=f(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(i=!0):(a=t*a+c,++s>=r&&(this.dMultiply(n),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(a,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(o.ONE.shiftLeft(e-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(o.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},o.prototype.bitwiseTo=function(e,t,r){var n,i,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=o;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},o.prototype.changeBit=function(e,t){var r=o.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},o.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},o.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},o.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},o.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},o.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},o.prototype.millerRabin=function(e){var t=this.subtract(o.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),s={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},a=0;a<e;++a){do{n=new o(this.bitLength(),s)}while(n.compareTo(o.ONE)<=0||n.compareTo(t)>=0);var u=n.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<r&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(o.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},o.prototype.clone=function(){var e=s();return this.copyTo(e),e},o.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},o.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},o.prototype.equals=function(e){return 0==this.compareTo(e)},o.prototype.min=function(e){return this.compareTo(e)<0?this:e},o.prototype.max=function(e){return this.compareTo(e)>0?this:e},o.prototype.and=function(e){var t=s();return this.bitwiseTo(e,m,t),t},o.prototype.or=function(e){var t=s();return this.bitwiseTo(e,b,t),t},o.prototype.xor=function(e){var t=s();return this.bitwiseTo(e,v,t),t},o.prototype.andNot=function(e){var t=s();return this.bitwiseTo(e,w,t),t},o.prototype.not=function(){for(var e=s(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},o.prototype.shiftLeft=function(e){var t=s();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},o.prototype.shiftRight=function(e){var t=s();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},o.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+_(this.data[e]);return this.s<0?this.t*this.DB:-1},o.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=E(this.data[r]^t);return e},o.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},o.prototype.setBit=function(e){return this.changeBit(e,b)},o.prototype.clearBit=function(e){return this.changeBit(e,w)},o.prototype.flipBit=function(e){return this.changeBit(e,v)},o.prototype.add=function(e){var t=s();return this.addTo(e,t),t},o.prototype.subtract=function(e){var t=s();return this.subTo(e,t),t},o.prototype.multiply=function(e){var t=s();return this.multiplyTo(e,t),t},o.prototype.divide=function(e){var t=s();return this.divRemTo(e,t,null),t},o.prototype.remainder=function(e){var t=s();return this.divRemTo(e,null,t),t},o.prototype.divideAndRemainder=function(e){var t=s(),r=s();return this.divRemTo(e,t,r),new Array(t,r)},o.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),o=d(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new y(t):t.isEven()?new A(t):new g(t);var a=new Array,u=3,c=r-1,h=(1<<r)-1;if(a[1]=n.convert(this),r>1){var l=s();for(n.sqrTo(a[1],l);u<=h;)a[u]=s(),n.mulTo(l,a[u-2],a[u]),u+=2}var f,m,b=e.t-1,v=!0,w=s();for(i=p(e.data[b])-1;b>=0;){for(i>=c?f=e.data[b]>>i-c&h:(f=(e.data[b]&(1<<i+1)-1)<<c-i,b>0&&(f|=e.data[b-1]>>this.DB+i-c)),u=r;0==(1&f);)f>>=1,--u;if((i-=u)<0&&(i+=this.DB,--b),v)a[f].copyTo(o),v=!1;else{for(;u>1;)n.sqrTo(o,w),n.sqrTo(w,o),u-=2;u>0?n.sqrTo(o,w):(m=o,o=w,w=m),n.mulTo(w,a[f],o)}for(;b>=0&&0==(e.data[b]&1<<i);)n.sqrTo(o,w),m=o,o=w,w=m,--i<0&&(i=this.DB-1,--b)}return n.revert(o)},o.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return o.ZERO;for(var r=e.clone(),n=this.clone(),i=d(1),s=d(0),a=d(0),u=d(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(e,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),t?(a.isEven()&&u.isEven()||(a.addTo(this,a),u.subTo(e,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(a,i),s.subTo(u,s)):(n.subTo(r,n),t&&a.subTo(i,a),u.subTo(s,u))}return 0!=n.compareTo(o.ONE)?o.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},o.prototype.pow=function(e){return this.exp(e,new S)},o.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},o.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=I[I.length-1]){for(t=0;t<I.length;++t)if(r.data[0]==I[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<I.length;){for(var n=I[t],i=t+1;i<I.length&&n<k;)n*=I[i++];for(n=r.modInt(n);t<i;)if(n%I[t++]==0)return!1}return r.millerRabin(e)}},28717:(e,t,r)=>{var n=r(5525);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},79955:(e,t,r)=>{var n=r(5525);r(57452),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},57452:(e,t,r)=>{var n=r(5525);r(35139),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,o=Math.ceil(r/e.digestLength),s=0;s<o;s++){var a=new n.util.ByteBuffer;a.putInt32(s),e.start(),e.update(t+a.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},89777:(e,t,r)=>{var n=r(5525);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function o(e,t){i[e]=t,i[t]=e}function s(e,t){i[e]=t}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.5","serialName"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},79850:(e,t,r)=>{var n=r(5525);if(r(16221),r(93758),r(34892),r(28717),r(89777),r(77846),r(82010),r(99087),r(28501),r(95842),r(35139),"undefined"===typeof i)var i=n.jsbn.BigInteger;var o=n.asn1,s=n.pki=n.pki||{};e.exports=s.pbe=n.pbe=n.pbe||{};var a=s.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},h={name:"pkcs-12PbeParams",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"iterations"}]};function l(e,t){return e.start().update(t).digest().getBytes()}function f(e){var t;if(e){if(!(t=s.oids[o.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return d(t)}function d(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}s.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,u,c,h=n.random.getBytesSync(r.saltSize),l=r.count,f=o.integerToDer(l);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,y,g;switch(r.algorithm){case"aes128":i=16,p=16,y=a["aes128-CBC"],g=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,y=a["aes192-CBC"],g=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,y=a["aes256-CBC"],g=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,y=a.desCBC,g=n.des.createEncryptionCipher;break;default:throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),b=d(m),v=n.pkcs5.pbkdf2(t,h,l,i,b),w=n.random.getBytesSync(p);(S=g(v)).start(w),S.update(o.toDer(e)),S.finish(),c=S.output.getBytes();var _=function(e,t,r,i){var a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&a.value.push(o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.oids[i]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]));return a}(h,f,i,m);u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.pkcs5PBES2).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.pkcs5PBKDF2).getBytes()),_]),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(y).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,w)])])])}else{var E;if("3des"!==r.algorithm)throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E;i=24;var S,M=new n.util.ByteBuffer(h);v=s.pbe.generatePkcs12Key(t,M,1,l,i),w=s.pbe.generatePkcs12Key(t,M,2,l,i);(S=n.des.createEncryptionCipher(v)).start(w),S.update(o.toDer(e)),S.finish(),c=S.output.getBytes(),u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,h),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,f.getBytes())])])}return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[u,o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,c)])},s.decryptPrivateKeyInfo=function(e,t){var r=null,i={},a=[];if(!o.validate(e,u,i,a)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=a,c}var h=o.derToOid(i.encryptionOid),l=s.pbe.getCipher(h,i.encryptionParams,t),f=n.util.createBuffer(i.encryptedData);return l.update(f),l.finish()&&(r=o.fromDer(l.output)),r},s.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:o.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},s.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return o.fromDer(t.body)},s.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=s.wrapRsaPrivateKey(s.privateKeyToAsn1(e));return i=s.encryptPrivateKeyInfo(i,t,r),s.encryptedPrivateKeyToPem(i)}var a,u,c,h;switch(r.algorithm){case"aes128":a="AES-128-CBC",c=16,u=n.random.getBytesSync(16),h=n.aes.createEncryptionCipher;break;case"aes192":a="AES-192-CBC",c=24,u=n.random.getBytesSync(16),h=n.aes.createEncryptionCipher;break;case"aes256":a="AES-256-CBC",c=32,u=n.random.getBytesSync(16),h=n.aes.createEncryptionCipher;break;case"3des":a="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),h=n.des.createEncryptionCipher;break;case"des":a="DES-CBC",c=8,u=n.random.getBytesSync(8),h=n.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw l.algorithm=r.algorithm,l}var f=h(n.pbe.opensslDeriveBytes(t,u.substr(0,8),c));f.start(u),f.update(o.toDer(s.privateKeyToAsn1(e))),f.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:a,parameters:n.util.bytesToHex(u).toUpperCase()},body:f.output.getBytes()};return n.pem.encode(d)},s.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var a,u;switch(i.dekInfo.algorithm){case"DES-CBC":a=8,u=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":a=24,u=n.des.createDecryptionCipher;break;case"AES-128-CBC":a=16,u=n.aes.createDecryptionCipher;break;case"AES-192-CBC":a=24,u=n.aes.createDecryptionCipher;break;case"AES-256-CBC":a=32,u=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":a=5,u=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":a=8,u=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":a=16,u=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var h=n.util.hexToBytes(i.dekInfo.parameters),l=u(n.pbe.opensslDeriveBytes(t,h.substr(0,8),a));if(l.start(h),l.update(n.util.createBuffer(i.body)),!l.finish())return r;r=l.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?s.decryptPrivateKeyInfo(o.fromDer(r),t):o.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(e,t,r,i,o,s){var a,u;if("undefined"===typeof s||null===s){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');s=n.md.sha1.create()}var c=s.digestLength,h=s.blockLength,l=new n.util.ByteBuffer,f=new n.util.ByteBuffer;if(null!==e&&void 0!==e){for(u=0;u<e.length;u++)f.putInt16(e.charCodeAt(u));f.putInt16(0)}var d=f.length(),p=t.length(),y=new n.util.ByteBuffer;y.fillWithByte(r,h);var g=h*Math.ceil(p/h),m=new n.util.ByteBuffer;for(u=0;u<g;u++)m.putByte(t.at(u%p));var b=h*Math.ceil(d/h),v=new n.util.ByteBuffer;for(u=0;u<b;u++)v.putByte(f.at(u%d));var w=m;w.putBuffer(v);for(var _=Math.ceil(o/c),E=1;E<=_;E++){var S=new n.util.ByteBuffer;S.putBytes(y.bytes()),S.putBytes(w.bytes());for(var M=0;M<i;M++)s.start(),s.update(S.getBytes()),S=s.digest();var A=new n.util.ByteBuffer;for(u=0;u<h;u++)A.putByte(S.at(u%c));var I=Math.ceil(p/h)+Math.ceil(d/h),k=new n.util.ByteBuffer;for(a=0;a<I;a++){var T=new n.util.ByteBuffer(w.getBytes(h)),R=511;for(u=A.length()-1;u>=0;u--)R>>=8,R+=A.at(u)+T.at(u),T.setAt(u,255&R);k.putBuffer(T)}w=k,l.putBuffer(S)}return l.truncate(l.length()-o),l},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},s.pbe.getCipherForPBES2=function(e,t,r){var i,a={},u=[];if(!o.validate(t,c,a,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((e=o.derToOid(a.kdfOid))!==s.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=o.derToOid(a.encOid))!==s.oids["aes128-CBC"]&&e!==s.oids["aes192-CBC"]&&e!==s.oids["aes256-CBC"]&&e!==s.oids["des-EDE3-CBC"]&&e!==s.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var h,l,d=a.kdfSalt,p=n.util.createBuffer(a.kdfIterationCount);switch(p=p.getInt(p.length()<<3),s.oids[e]){case"aes128-CBC":h=16,l=n.aes.createDecryptionCipher;break;case"aes192-CBC":h=24,l=n.aes.createDecryptionCipher;break;case"aes256-CBC":h=32,l=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":h=24,l=n.des.createDecryptionCipher;break;case"desCBC":h=8,l=n.des.createDecryptionCipher}var y=f(a.prfOid),g=n.pkcs5.pbkdf2(r,d,p,h,y),m=a.encIv,b=l(g);return b.start(m),b},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},a=[];if(!o.validate(t,h,i,a))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=a,y;var u,c,l,d=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),e){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,l=n.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,l=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var g=f(i.prfOid),m=s.pbe.generatePkcs12Key(r,d,1,p,u,g);return g.start(),l(m,s.pbe.generatePkcs12Key(r,d,2,p,c,g))},s.pbe.opensslDeriveBytes=function(e,t,r,i){if("undefined"===typeof i||null===i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var o=[l(i,e+t)],s=16,a=1;s<r;++a,s+=16)o.push(l(i,o[a-1]+e+t));return o.join("").substr(0,r)}},77846:(e,t,r)=>{var n=r(47573).Buffer,i=r(5525);r(64937),r(28717),r(35139);var o,s=i.pkcs5=i.pkcs5||{};i.util.isNodejs&&!i.options.usePureJavaScript&&(o=r(95942)),e.exports=i.pbkdf2=s.pbkdf2=function(e,t,r,s,a,u){if("function"===typeof a&&(u=a,a=null),i.util.isNodejs&&!i.options.usePureJavaScript&&o.pbkdf2&&(null===a||"object"!==typeof a)&&(o.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!==typeof a&&(a="sha1"),e=n.from(e,"binary"),t=n.from(t,"binary"),u?4===o.pbkdf2Sync.length?o.pbkdf2(e,t,r,s,(function(e,t){if(e)return u(e);u(null,t.toString("binary"))})):o.pbkdf2(e,t,r,s,a,(function(e,t){if(e)return u(e);u(null,t.toString("binary"))})):4===o.pbkdf2Sync.length?o.pbkdf2Sync(e,t,r,s).toString("binary"):o.pbkdf2Sync(e,t,r,s,a).toString("binary");if("undefined"!==typeof a&&null!==a||(a="sha1"),"string"===typeof a){if(!(a in i.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=i.md[a].create()}var c=a.digestLength;if(s>4294967295*c){var h=new Error("Derived key is too long.");if(u)return u(h);throw h}var l=Math.ceil(s/c),f=s-(l-1)*c,d=i.hmac.create();d.start(a,e);var p,y,g,m="";if(!u){for(var b=1;b<=l;++b){d.start(null,null),d.update(t),d.update(i.util.int32ToBytes(b)),p=g=d.digest().getBytes();for(var v=2;v<=r;++v)d.start(null,null),d.update(g),y=d.digest().getBytes(),p=i.util.xorBytes(p,y,c),g=y;m+=b<l?p:p.substr(0,f)}return m}b=1;function w(){if(b>l)return u(null,m);d.start(null,null),d.update(t),d.update(i.util.int32ToBytes(b)),p=g=d.digest().getBytes(),v=2,_()}function _(){if(v<=r)return d.start(null,null),d.update(g),y=d.digest().getBytes(),p=i.util.xorBytes(p,y,c),g=y,++v,i.util.setImmediate(_);m+=b<l?p:p.substr(0,f),++b,w()}w()}},82010:(e,t,r)=>{var n=r(5525);r(35139);var i=e.exports=n.pem=n.pem||{};function o(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var o=0,s=-1;for(i=0;i<t.length;++i,++o)if(o>65&&-1!==s){var a=t[s];","===a?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+a+t.substr(s+1),o=i-s-1,s=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(s=i);return t}function s(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=o(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=o(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=o(r)),e.headers)for(var s=0;s<e.headers.length;++s)i+=o(e.headers[s]);return e.procType&&(i+="\r\n"),i+=n.util.encode64(e.body,t.maxline||64)+"\r\n",i+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,o=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,a=/\r?\n/;t=i.exec(e);){var u={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(t[3])};if(r.push(u),t[2]){for(var c=t[2].split(a),h=0;t&&h<c.length;){for(var l=c[h].replace(/\s+$/,""),f=h+1;f<c.length;++f){var d=c[f];if(!/\s/.test(d[0]))break;l+=d,h=f}if(t=l.match(o)){for(var p={name:t[1],values:[]},y=t[2].split(","),g=0;g<y.length;++g)p.values.push(s(y[g]));if(u.procType)if(u.contentDomain||"Content-Domain"!==p.name)if(u.dekInfo||"DEK-Info"!==p.name)u.headers.push(p);else{if(0===p.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.contentDomain=y[0]||"";else{if("Proc-Type"!==p.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==p.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++h}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},12842:(e,t,r)=>{var n=r(5525);r(35139),r(99087),r(28369);var i=e.exports=n.pkcs1=n.pkcs1||{};function o(e,t,r){r||(r=n.md.sha1.create());for(var i="",o=Math.ceil(t/r.digestLength),s=0;s<o;++s){var a=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+a),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,s,a,u;"string"===typeof r?(i=r,s=arguments[3]||void 0,a=arguments[4]||void 0):r&&(i=r.label||void 0,s=r.seed||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),a?a.start():a=n.md.sha1.create(),u||(u=a);var c=Math.ceil(e.n.bitLength()/8),h=c-2*a.digestLength-2;if(t.length>h)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=t.length,g.maxLength=h,g;i||(i=""),a.update(i,"raw");for(var l=a.digest(),f="",d=h-t.length,p=0;p<d;p++)f+="\0";var y=l.getBytes()+f+"\x01"+t;if(s){if(s.length!==a.digestLength){var g;throw(g=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=s.length,g.digestLength=a.digestLength,g}}else s=n.random.getBytes(a.digestLength);var m=o(s,c-a.digestLength-1,u),b=n.util.xorBytes(y,m,y.length),v=o(b,a.digestLength,u),w=n.util.xorBytes(s,v,s.length);return"\0"+w+b},i.decode_rsa_oaep=function(e,t,r){var i,s,a;"string"===typeof r?(i=r,s=arguments[3]||void 0):r&&(i=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(a=r.mgf1.md));var u=Math.ceil(e.n.bitLength()/8);if(t.length!==u)throw(b=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,b.expectedLength=u,b;if(void 0===s?s=n.md.sha1.create():s.start(),a||(a=s),u<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),s.update(i,"raw");for(var c=s.digest().getBytes(),h=t.charAt(0),l=t.substring(1,s.digestLength+1),f=t.substring(1+s.digestLength),d=o(f,s.digestLength,a),p=n.util.xorBytes(l,d,l.length),y=o(p,u-s.digestLength-1,a),g=n.util.xorBytes(f,y,f.length),m=g.substring(0,s.digestLength),b="\0"!==h,v=0;v<s.digestLength;++v)b|=c.charAt(v)!==m.charAt(v);for(var w=1,_=s.digestLength,E=s.digestLength;E<g.length;E++){var S=g.charCodeAt(E),M=1&S^1,A=w?65534:0;b|=S&A,_+=w&=M}if(b||1!==g.charCodeAt(_))throw new Error("Invalid RSAES-OAEP padding.");return g.substring(_+1)}},71270:(e,t,r)=>{var n=r(5525);r(16221),r(93758),r(34892),r(89777),r(82010),r(15075),r(99087),r(35139),r(49781);var i=n.asn1,o=e.exports=n.pkcs7=n.pkcs7||{};function s(e){var t={},r=[];if(!i.validate(e,o.asn1.recipientInfoValidator,t,r)){var s=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw s.errors=r,s}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function a(e){for(var t,r=[],o=0;o<e.length;++o)r.push((t=e[o],i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:t.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(t.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}function u(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),o=0;o<e.unauthenticatedAttributes.length;++o){var s=e.unauthenticatedAttributes[o];r.values.push(c(s))}t.value.push(r)}return t}function c(e){var t;if(e.type===n.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),o=new Date("2050-01-01T00:00:00Z"),s=e.value;if("string"===typeof s){var a=Date.parse(s);s=isNaN(a)?13===s.length?i.utcTimeToDate(s):i.generalizedTimeToDate(s):new Date(a)}t=s>=r&&s<o?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(s)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(s))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function h(e,t,r){var o={};if(!i.validate(t,r,o,[])){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}if(i.derToOid(o.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(o.encryptedContent){var a="";if(n.util.isArray(o.encryptedContent))for(var u=0;u<o.encryptedContent.length;++u){if(o.encryptedContent[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");a+=o.encryptedContent[u].value}else a=o.encryptedContent;e.encryptedContent={algorithm:i.derToOid(o.encAlgorithm),parameter:n.util.createBuffer(o.encParameter.value),content:n.util.createBuffer(a)}}if(o.content){a="";if(n.util.isArray(o.content))for(u=0;u<o.content.length;++u){if(o.content[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");a+=o.content[u].value}else a=o.content;e.content=n.util.createBuffer(a)}return e.version=o.version.charCodeAt(0),e.rawCapture=o,o}function l(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}o.messageFromPem=function(e){var t=n.pem.decode(e)[0];if("PKCS7"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return o.messageFromAsn1(s)},o.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:t})},o.messageFromAsn1=function(e){var t={},r=[];if(!i.validate(e,o.asn1.contentInfoValidator,t,r)){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw s.errors=r,s}var a,u=i.derToOid(t.contentType);switch(u){case n.pki.oids.envelopedData:a=o.createEnvelopedData();break;case n.pki.oids.encryptedData:a=o.createEncryptedData();break;case n.pki.oids.signedData:a=o.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+u+" is not (yet) supported.")}return a.fromAsn1(t.content.value[0]),a},o.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(h(e,t,o.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(n.pki.certificateToAsn1(e.certificates[r]));var o=[],s=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),o.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,o)),s.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var o=t.certificate;"string"===typeof o&&(o=n.pki.certificateFromPem(o)),r=o.issuer.attributes,i=o.serialNumber}var s=t.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"===typeof s&&(s=n.pki.privateKeyFromPem(s));var a=t.digestAlgorithm||n.pki.oids.sha1;switch(a){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+a)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var c=!1,h=!1,l=0;l<u.length;++l){var f=u[l];if(c||f.type!==n.pki.oids.contentType){if(h||f.type!==n.pki.oids.messageDigest);else if(h=!0,c)break}else if(c=!0,h)break}if(!c||!h)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:s,version:1,issuer:r,serialNumber:i,digestAlgorithm:a,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(t){var r;(t=t||{},"object"!==typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof n.util.ByteBuffer?r=e.content.bytes():"string"===typeof e.content&&(r=n.util.encodeUtf8(e.content)),t.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)]))));0!==e.signers.length&&function(t){var r;r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0];if(!r)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var o=i.derToOid(e.contentInfo.value[0].value),s=i.toDer(r);for(var a in s.getByte(),i.getBerValueLength(s),s=s.getBytes(),t)t[a].start().update(s);for(var h=new Date,l=0;l<e.signers.length;++l){var f=e.signers[l];if(0===f.authenticatedAttributes.length){if(o!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var d=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),p=0;p<f.authenticatedAttributes.length;++p){var y=f.authenticatedAttributes[p];y.type===n.pki.oids.messageDigest?y.value=t[f.digestAlgorithm].digest():y.type===n.pki.oids.signingTime&&(y.value||(y.value=h)),d.value.push(c(y)),f.authenticatedAttributesAsn1.value.push(c(y))}s=i.toDer(d).getBytes(),f.md.start().update(s)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(u(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var o=e.signers[r];(s=o.digestAlgorithm)in t||(t[s]=n.md[n.pki.oids[s]].create()),0===o.authenticatedAttributes.length?o.md=t[s]:o.md=n.md[n.pki.oids[s]].create()}for(var s in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"===typeof t&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},o.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){h(e,t,o.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),l(e)}}},o.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=h(e,t,o.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(s(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,a(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(t=e.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.parameter.getBytes())]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])]);var t},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],o=i.issuer;if(i.serialNumber===t.serialNumber&&o.length===r.length){for(var s=!0,a=0;a<r.length;++a)if(o[a].type!==r[a].type||o[a].value!==r[a].value){s=!1;break}if(s)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}l(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var i,o,s;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,o=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,o=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,o=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,o=8,s=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(o));var a=s(t);if(a.start(e.encryptedContent.parameter.copy()),a.update(e.content),!a.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=a.output}for(var u=0;u<e.recipients.length;++u){var c=e.recipients[u];if(void 0===c.encryptedContent.content){if(c.encryptedContent.algorithm!==n.pki.oids.rsaEncryption)throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm);c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data)}}}}}},15075:(e,t,r)=>{var n=r(5525);r(93758),r(35139);var i=n.asn1,o=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=o;var s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};o.contentInfoValidator=s;var a={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};o.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(a)},o.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(a)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};o.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},o.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},74011:(e,t,r)=>{var n=r(5525);r(35139),r(24926),r(99087),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],o=new r(null);o.fromInt(30);var s=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"===typeof t&&(i=t,t={});var o=(t=t||{}).algorithm||"PRIMEINC";"string"===typeof o&&(o={name:o}),o.options=o.options||{};var s=t.prng||n.random,u={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===o.name)return function(e,t,i,o){if("workers"in i)return function(e,t,i,o){if("undefined"===typeof Worker)return a(e,t,i,o);var s=c(e,t),u=i.workers,h=i.workLoad||100,l=30*h/8,f=i.workerScript||"forge/prime.worker.js";if(-1===u)return n.util.estimateCores((function(e,t){e&&(t=2),u=t-1,d()}));function d(){u=Math.max(1,u);for(var n=[],i=0;i<u;++i)n[i]=new Worker(f);for(i=0;i<u;++i)n[i].addEventListener("message",d);var a=!1;function d(i){if(!a){0;var u=i.data;if(u.found){for(var f=0;f<n.length;++f)n[f].terminate();return a=!0,o(null,new r(u.prime,16))}s.bitLength()>e&&(s=c(e,t));var d=s.toString(16);i.target.postMessage({hex:d,workLoad:h}),s.dAddOffset(l,0)}}}d()}(e,t,i,o);return a(e,t,i,o)}(e,u,o.options,i);throw new Error("Invalid prime generation algorithm: "+o.name)}}function a(e,t,r,n){var i=c(e,t),o=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var s=10;"maxBlockTime"in r&&(s=r.maxBlockTime),u(i,e,t,0,o,s,n)}function u(e,t,r,o,s,a,h){var l=+new Date;do{if(e.bitLength()>t&&(e=c(t,r)),e.isProbablePrime(s))return h(null,e);e.dAddOffset(i[o++%8],0)}while(a<0||+new Date-l<a);n.util.setImmediate((function(){u(e,t,r,o,s,a,h)}))}function c(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),s,n),n.dAddOffset(31-n.mod(o).byteValue(),0),n}}()},81759:(e,t,r)=>{var n=r(21964),i=r(5525);r(35139);var o=null;!i.util.isNodejs||i.options.usePureJavaScript||n.versions["node-webkit"]||(o=r(95942)),(e.exports=i.prng=i.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,n=new Array(32),s=0;s<32;++s)n[s]=r.create();function a(){if(t.pools[0].messageLength>=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r===0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=i.util.globalScope,n=r.crypto||r.msCrypto;n&&n.getRandomValues&&(t=function(e){return n.getRandomValues(e)});var o=i.util.createBuffer();if(t)for(;o.length()<e;){var s=Math.max(1,Math.min(e-o.length(),65536)/4),a=new Uint32Array(Math.floor(s));try{t(a);for(var u=0;u<a.length;++u)o.putInt32(a[u])}catch(d){if(!("undefined"!==typeof QuotaExceededError&&d instanceof QuotaExceededError))throw d}}if(o.length()<e)for(var c,h,l,f=Math.floor(65536*Math.random());o.length()<e;){h=16807*(65535&f),h+=(32767&(c=16807*(f>>16)))<<16,f=4294967295&(h=(2147483647&(h+=c>>15))+(h>>31));for(u=0;u<3;++u)l=f>>>(u<<3),l^=Math.floor(256*Math.random()),o.putByte(String.fromCharCode(255&l))}return o.getBytes(e)}return t.pools=n,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var n=t.plugin.cipher,o=t.plugin.increment,s=t.plugin.formatKey,a=t.plugin.formatSeed,c=i.util.createBuffer();t.key=null,function h(l){if(l)return r(l);if(c.length()>=e)return r(null,c.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return i.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}(h)}));var f=n(t.key,t.seed);t.generated+=f.length,c.putBytes(f),t.key=s(n(t.key,o(t.seed))),t.seed=a(n(t.key,t.seed)),i.util.setImmediate(h)}()},t.generateSync=function(e){var r=t.plugin.cipher,n=t.plugin.increment,o=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var u=i.util.createBuffer();u.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&a();var c=r(t.key,t.seed);t.generated+=c.length,u.putBytes(c),t.key=o(r(t.key,n(t.seed))),t.seed=s(r(t.key,t.seed))}return u.getBytes(e)},o?(t.seedFile=function(e,t){o.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return o.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(r){t(r)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},37889:(e,t,r)=>{var n=r(5525);r(99087),r(35139),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,o=r.digestLength,s=e.salt||null;if("string"===typeof s&&(s=n.util.createBuffer(s)),"saltLength"in e)t=e.saltLength;else{if(null===s)throw new Error("Salt length not specified or specific salt not given.");t=s.length()}if(null!==s&&s.length()!==t)throw new Error("Given salt length does not match length of given salt.");var a=e.prng||n.random,u={encode:function(e,u){var c,h,l=u-1,f=Math.ceil(l/8),d=e.digest().getBytes();if(f<o+t+2)throw new Error("Message is too long to encrypt.");h=null===s?a.getBytesSync(t):s.bytes();var p=new n.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(d),p.putBytes(h),r.start(),r.update(p.getBytes());var y=r.digest().getBytes(),g=new n.util.ByteBuffer;g.fillWithByte(0,f-t-o-2),g.putByte(1),g.putBytes(h);var m=g.getBytes(),b=f-o-1,v=i.generate(y,b),w="";for(c=0;c<b;c++)w+=String.fromCharCode(m.charCodeAt(c)^v.charCodeAt(c));var _=65280>>8*f-l&255;return(w=String.fromCharCode(w.charCodeAt(0)&~_)+w.substr(1))+y+String.fromCharCode(188)},verify:function(e,s,a){var u,c=a-1,h=Math.ceil(c/8);if(s=s.substr(-h),h<o+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==s.charCodeAt(h-1))throw new Error("Encoded message does not end in 0xBC.");var l=h-o-1,f=s.substr(0,l),d=s.substr(l,o),p=65280>>8*h-c&255;if(0!==(f.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(d,l),g="";for(u=0;u<l;u++)g+=String.fromCharCode(f.charCodeAt(u)^y.charCodeAt(u));g=String.fromCharCode(g.charCodeAt(0)&~p)+g.substr(1);var m=h-o-t-2;for(u=0;u<m;u++)if(0!==g.charCodeAt(u))throw new Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(m))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var b=g.substr(-t),v=new n.util.ByteBuffer;return v.fillWithByte(0,8),v.putBytes(e),v.putBytes(b),r.start(),r.update(v.getBytes()),d===r.digest().getBytes()}};return u}},99087:(e,t,r)=>{var n=r(5525);r(16221),r(35788),r(81759),r(35139),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),o=n.util.createBuffer();function s(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),o.putInt32(i[0]),o.putInt32(i[1]),o.putInt32(i[2]),o.putInt32(i[3]),o.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var a=s(),u=null,c=n.util.globalScope,h=c.crypto||c.msCrypto;if(h&&h.getRandomValues&&(u=function(e){return h.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"===typeof window||window.document,a.collectInt(+new Date,32),"undefined"!==typeof navigator){var l="";for(var f in navigator)try{"string"==typeof navigator[f]&&(l+=navigator[f])}catch(d){}a.collect(l),l=null}t&&(t().mousemove((function(e){a.collectInt(e.clientX,16),a.collectInt(e.clientY,16)})),t().keypress((function(e){a.collectInt(e.charCode,8)})))}if(n.random)for(var f in a)n.random[f]=a[f];else n.random=a;n.random.createInstance=s,e.exports=n.random}("undefined"!==typeof jQuery?jQuery:null)},28501:(e,t,r)=>{var n=r(5525);r(35139);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],o=[1,2,3,5],s=function(e,t){return e<<t&65535|(65535&e)>>16-t},a=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"===typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,o=e,s=e.length(),a=t,u=Math.ceil(a/8),c=255>>(7&a);for(r=s;r<128;r++)o.putByte(i[o.at(r-1)+o.at(r-s)&255]);for(o.setAt(128-u,i[o.at(128-u)&c]),r=127-u;r>=0;r--)o.setAt(r,i[o.at(r+1)^o.at(r+u)]);return o};var u=function(e,t,r){var i,u,c,h,l=!1,f=null,d=null,p=null,y=[];for(e=n.rc2.expandKey(e,t),c=0;c<64;c++)y.push(e.getInt16Le());r?(i=function(e){for(c=0;c<4;c++)e[c]+=y[h]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),e[c]=s(e[c],o[c]),h++},u=function(e){for(c=0;c<4;c++)e[c]+=y[63&e[(c+3)%4]]}):(i=function(e){for(c=3;c>=0;c--)e[c]=a(e[c],o[c]),e[c]-=y[h]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),h--},u=function(e){for(c=3;c>=0;c--)e[c]-=y[63&e[(c+3)%4]]});var g=function(e){var t=[];for(c=0;c<4;c++){var n=f.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),t.push(65535&n)}h=r?0:63;for(var i=0;i<e.length;i++)for(var o=0;o<e[i][0];o++)e[i][1](t);for(c=0;c<4;c++)null!==p&&(r?p.putInt16Le(t[c]):t[c]^=p.getInt16Le()),d.putInt16Le(t[c])},m=null;return m={start:function(e,t){e&&"string"===typeof e&&(e=n.util.createBuffer(e)),l=!1,f=n.util.createBuffer(),d=t||new n.util.createBuffer,p=e,m.output=d},update:function(e){for(l||f.putBuffer(e);f.length()>=8;)g([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,f,!r);else{var n=8===f.length()?8:8-f.length();f.fillWithByte(n,n)}if(t&&(l=!0,m.update()),!r&&(t=0===f.length()))if(e)t=e(8,d,!r);else{var i=d.length(),o=d.at(i-1);o>i?t=!1:d.truncate(o)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},95842:(e,t,r)=>{var n=r(5525);if(r(93758),r(24926),r(89777),r(12842),r(74011),r(99087),r(35139),"undefined"===typeof i)var i=n.jsbn.BigInteger;var o=n.util.isNodejs?r(95942):null,s=n.asn1,a=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],h={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},l={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},f={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=s.oidToDer(t).getBytes(),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),o=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);o.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,n)),o.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var a=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(o),i.value.push(a),s.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var o;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(o.compareTo(t.n)>=0||!o.gcd(t.n).equals(i.ONE));for(var s=(e=e.multiply(o.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),a=e.mod(t.q).modPow(t.dQ,t.q);s.compareTo(a)<0;)s=s.add(t.p);var u=s.subtract(a).multiply(t.qInv).mod(t.p).multiply(t.q).add(a);return u=u.multiply(o.modInverse(t.n)).mod(t.n)};function g(e,t,r){var i=n.util.createBuffer(),o=Math.ceil(t.n.bitLength()/8);if(e.length>o-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=o-11,s}i.putByte(0),i.putByte(r);var a,u=o-3-e.length;if(0===r||1===r){a=0===r?0:255;for(var c=0;c<u;++c)i.putByte(a)}else for(;u>0;){var h=0,l=n.random.getBytes(u);for(c=0;c<u;++c)0===(a=l.charCodeAt(c))?++h:i.putByte(a);u=h}return i.putByte(0),i.putBytes(e),i}function m(e,t,r,i){var o=Math.ceil(t.n.bitLength()/8),s=n.util.createBuffer(e),a=s.getByte(),u=s.getByte();if(0!==a||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&"undefined"===typeof i)throw new Error("Encryption block is invalid.");var c=0;if(0===u){c=o-3-i;for(var h=0;h<c;++h)if(0!==s.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(c=0;s.length()>1;){if(255!==s.getByte()){--s.read;break}++c}else if(2===u)for(c=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++c}if(0!==s.getByte()||c!==o-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function b(e,t,r){"function"===typeof t&&(r=t,t={});var o={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function s(){a(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void a(e.qBits,c))}))}function a(e,t){n.prime.generateProbablePrime(e,o,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var o=e.p;e.p=e.q,e.q=o}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void s();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void a(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void s();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void a(e.qBits,c);var h=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(o.prng=t.prng),s()}function v(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0===(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128===(128&r.charCodeAt(1)))?r.substr(1):r}function w(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function _(e){return n.util.isNodejs&&"function"===typeof o[e]}function E(e){return"undefined"!==typeof a.globalScope&&"object"===typeof a.globalScope.crypto&&"object"===typeof a.globalScope.crypto.subtle&&"function"===typeof a.globalScope.crypto.subtle[e]}function S(e){return"undefined"!==typeof a.globalScope&&"object"===typeof a.globalScope.msCrypto&&"object"===typeof a.globalScope.msCrypto.subtle&&"function"===typeof a.globalScope.msCrypto.subtle[e]}function M(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}u.rsa.encrypt=function(e,t,r){var o,s=r,a=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(s=2===r,o=g(e,t,r)):(o=n.util.createBuffer()).putBytes(e);for(var u=new i(o.toHex(),16),c=y(u,t,s).toString(16),h=n.util.createBuffer(),l=a-Math.ceil(c.length/2);l>0;)h.putByte(0),--l;return h.putBytes(n.util.hexToBytes(c)),h.getBytes()},u.rsa.decrypt=function(e,t,r,o){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var a=new Error("Encrypted message length is invalid.");throw a.length=e.length,a.expected=s,a}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=y(u,t,r).toString(16),h=n.util.createBuffer(),l=s-Math.ceil(c.length/2);l>0;)h.putByte(0),--l;return h.putBytes(n.util.hexToBytes(c)),!1!==o?m(h.getBytes(),t,r):h.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"===typeof e&&(e=parseInt(e,10)),e=e||2048;var o,s=(r=r||{}).prng||n.random,a={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},u=r.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(o={algorithm:u,state:0,bits:e,rng:a,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,o=0,s=function(e,t){return e|t},a=+new Date,h=0;null===e.keys&&(t<=0||h<t);){if(0===e.state){var l=null===e.p?e.pBits:e.qBits,f=l-1;0===e.pqState?(e.num=new i(l,e.rng),e.num.testBit(f)||e.num.bitwiseTo(i.ONE.shiftLeft(f),s,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),o=0,++e.pqState):1===e.pqState?e.num.bitLength()>l?e.pqState=0:e.num.isProbablePrime(w(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[o++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var d=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,d,e.p,e.q,d.mod(e.p1),d.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}h+=(n=+new Date)-a,a=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"===typeof e?(r=e,e=void 0):"function"===typeof e&&(i=e,e=void 0):2===arguments.length?"number"===typeof e?"function"===typeof t?(i=t,t=void 0):"number"!==typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"===typeof t?"function"===typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(_("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(E("generateKey")&&E("exportKey"))return a.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:M(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return a.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(S("generateKey")&&S("exportKey")){var c=a.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:M(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=a.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(_("generateKeyPairSync")){var h=o.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(h.privateKey),publicKey:u.publicKeyFromPem(h.publicKey)}}var l=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(l,0),l.keys;b(l,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"===typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return g(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"===typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var o=t.encode(e,r,!0);return u.rsa.encrypt(o,r,!0)},verify:function(e,t,n){"string"===typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=m(t,r,!0),e===s.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=m(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,o,s,a,c){var h={n:e,e:t,d:r,p:i,q:o,dP:s,dQ:a,qInv:c,decrypt:function(e,t,r){"string"===typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,h,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:m};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,h,!1)},sign:function(e,t){var r=!1;"string"===typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:p},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,h.n.bitLength());return u.rsa.encrypt(n,h,r)}};return h},u.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(u.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,o,a,c,f,d,p,y={},g=[];if(s.validate(e,h,y,g)&&(e=s.fromDer(n.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(e,l,y,g)){var m=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=g,m}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),o=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrime1).toHex(),c=n.util.createBuffer(y.privateKeyPrime2).toHex(),f=n.util.createBuffer(y.privateKeyExponent1).toHex(),d=n.util.createBuffer(y.privateKeyExponent2).toHex(),p=n.util.createBuffer(y.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(o,16),new i(a,16),new i(c,16),new i(f,16),new i(d,16),new i(p,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,d,t,r)){var o,a=s.derToOid(t.publicKeyOid);if(a!==u.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=a,o;e=t.rsaPublicKey}if(r=[],!s.validate(e,f,t,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),h=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(h,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(u.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(e.e))])}},28369:(e,t,r)=>{var n=r(5525);r(28717),r(35139);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),s=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(o,s){"utf8"===s&&(o=n.util.encodeUtf8(o));var u=o.length;i.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(o),a(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(o.substr(0,i.blockLength-c));for(var h=8*i.fullMessageLength[0],l=0;l<i.fullMessageLength.length-1;++l)h+=(u=8*i.fullMessageLength[l+1])/4294967296>>>0,s.putInt32(h>>>0),h=u>>>0;s.putInt32(h);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};a(f,r,s);var d=n.util.createBuffer();return d.putInt32(f.h0),d.putInt32(f.h1),d.putInt32(f.h2),d.putInt32(f.h3),d.putInt32(f.h4),d},i};var o=null,s=!1;function a(e,t,r){for(var n,i,o,s,a,u,c,h=r.length();h>=64;){for(i=e.h0,o=e.h1,s=e.h2,a=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(a^o&(s^a))+u+1518500249+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<20;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(a^o&(s^a))+u+1518500249+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<32;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(o^s^a)+u+1859775393+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<40;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(o^s^a)+u+1859775393+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<60;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(o&s|a&(o^s))+u+2400959708+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<80;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(o^s^a)+u+3395469782+n,u=a,a=s,s=(o<<30|o>>>2)>>>0,o=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+s|0,e.h3=e.h3+a|0,e.h4=e.h4+u|0,h-=64}}},35788:(e,t,r)=>{var n=r(5525);r(28717),r(35139);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(o,s){"utf8"===s&&(o=n.util.encodeUtf8(o));var a=o.length;i.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=a[1],a[1]=a[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,a[0]=a[1]/4294967296>>>0;return t.putBytes(o),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var a,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(o.substr(0,i.blockLength-c));for(var h=8*i.fullMessageLength[0],l=0;l<i.fullMessageLength.length-1;++l)h+=(a=8*i.fullMessageLength[l+1])/4294967296>>>0,s.putInt32(h>>>0),h=a>>>0;s.putInt32(h);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(f,r,s);var d=n.util.createBuffer();return d.putInt32(f.h0),d.putInt32(f.h1),d.putInt32(f.h2),d.putInt32(f.h3),d.putInt32(f.h4),d.putInt32(f.h5),d.putInt32(f.h6),d.putInt32(f.h7),d},i};var o=null,s=!1,a=null;function u(e,t,r){for(var n,i,o,s,u,c,h,l,f,d,p,y,g,m=r.length();m>=64;){for(u=0;u<16;++u)t[u]=r.getInt32();for(;u<64;++u)n=((n=t[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=n+t[u-7]+i+t[u-16]|0;for(c=e.h0,h=e.h1,l=e.h2,f=e.h3,d=e.h4,p=e.h5,y=e.h6,g=e.h7,u=0;u<64;++u)o=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),s=c&h|l&(c^h),n=g+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(y^d&(p^y))+a[u]+t[u],g=y,y=p,p=d,d=f+n>>>0,f=l,l=h,h=c,c=n+(i=o+s)>>>0;e.h0=e.h0+c|0,e.h1=e.h1+h|0,e.h2=e.h2+l|0,e.h3=e.h3+f|0,e.h4=e.h4+d|0,e.h5=e.h5+p|0,e.h6=e.h6+y|0,e.h7=e.h7+g|0,m-=64}}},16654:(e,t,r)=>{var n=r(5525);r(28717),r(35139);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var o=n.sha384=n.sha512.sha384=n.sha512.sha384||{};o.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=o,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(a||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),128),u=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],a=!0),"undefined"===typeof e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),o=new Array(80),l=0;l<80;++l)o[l]=new Array(2);var f=64;switch(e){case"SHA-384":f=48;break;case"SHA-512/256":f=32;break;case"SHA-512/224":f=28}var d={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:f,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){d.messageLength=0,d.fullMessageLength=d.messageLength128=[];for(var e=d.messageLengthSize/4,o=0;o<e;++o)d.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(t.length);for(o=0;o<t.length;++o)r[o]=t[o].slice(0);return d}};return d.start(),d.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var s=e.length;d.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var a=d.fullMessageLength.length-1;a>=0;--a)d.fullMessageLength[a]+=s[1],s[1]=s[0]+(d.fullMessageLength[a]/4294967296>>>0),d.fullMessageLength[a]=d.fullMessageLength[a]>>>0,s[0]=s[1]/4294967296>>>0;return i.putBytes(e),h(r,o,i),(i.read>2048||0===i.length())&&i.compact(),d},d.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var a,u=d.fullMessageLength[d.fullMessageLength.length-1]+d.messageLengthSize&d.blockLength-1;t.putBytes(s.substr(0,d.blockLength-u));for(var c=8*d.fullMessageLength[0],l=0;l<d.fullMessageLength.length-1;++l)c+=(a=8*d.fullMessageLength[l+1])/4294967296>>>0,t.putInt32(c>>>0),c=a>>>0;t.putInt32(c);var f=new Array(r.length);for(l=0;l<r.length;++l)f[l]=r[l].slice(0);h(f,o,t);var p,y=n.util.createBuffer();p="SHA-512"===e?f.length:"SHA-384"===e?f.length-2:f.length-4;for(l=0;l<p;++l)y.putInt32(f[l][0]),l===p-1&&"SHA-512/224"===e||y.putInt32(f[l][1]);return y},d};var s=null,a=!1,u=null,c=null;function h(e,t,r){for(var n,i,o,s,a,c,h,l,f,d,p,y,g,m,b,v,w,_,E,S,M,A,I,k,T,R,P,C,O,x,B,D,N,L=r.length();L>=128;){for(P=0;P<16;++P)t[P][0]=r.getInt32()>>>0,t[P][1]=r.getInt32()>>>0;for(;P<80;++P)n=(((C=(x=t[P-2])[0])>>>19|(O=x[1])<<13)^(O>>>29|C<<3)^C>>>6)>>>0,i=((C<<13|O>>>19)^(O<<3|C>>>29)^(C<<26|O>>>6))>>>0,o=(((C=(D=t[P-15])[0])>>>1|(O=D[1])<<31)^(C>>>8|O<<24)^C>>>7)>>>0,s=((C<<31|O>>>1)^(C<<24|O>>>8)^(C<<25|O>>>7))>>>0,B=t[P-7],N=t[P-16],O=i+B[1]+s+N[1],t[P][0]=n+B[0]+o+N[0]+(O/4294967296>>>0)>>>0,t[P][1]=O>>>0;for(p=e[0][0],y=e[0][1],g=e[1][0],m=e[1][1],b=e[2][0],v=e[2][1],w=e[3][0],_=e[3][1],E=e[4][0],S=e[4][1],M=e[5][0],A=e[5][1],I=e[6][0],k=e[6][1],T=e[7][0],R=e[7][1],P=0;P<80;++P)h=((E>>>14|S<<18)^(E>>>18|S<<14)^(S>>>9|E<<23))>>>0,l=(I^E&(M^I))>>>0,a=((p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25))>>>0,c=((p<<4|y>>>28)^(y<<30|p>>>2)^(y<<25|p>>>7))>>>0,f=(p&g|b&(p^g))>>>0,d=(y&m|v&(y^m))>>>0,O=R+(((E<<18|S>>>14)^(E<<14|S>>>18)^(S<<23|E>>>9))>>>0)+((k^S&(A^k))>>>0)+u[P][1]+t[P][1],n=T+h+l+u[P][0]+t[P][0]+(O/4294967296>>>0)>>>0,i=O>>>0,o=a+f+((O=c+d)/4294967296>>>0)>>>0,s=O>>>0,T=I,R=k,I=M,k=A,M=E,A=S,E=w+n+((O=_+i)/4294967296>>>0)>>>0,S=O>>>0,w=b,_=v,b=g,v=m,g=p,m=y,p=n+o+((O=i+s)/4294967296>>>0)>>>0,y=O>>>0;O=e[0][1]+y,e[0][0]=e[0][0]+p+(O/4294967296>>>0)>>>0,e[0][1]=O>>>0,O=e[1][1]+m,e[1][0]=e[1][0]+g+(O/4294967296>>>0)>>>0,e[1][1]=O>>>0,O=e[2][1]+v,e[2][0]=e[2][0]+b+(O/4294967296>>>0)>>>0,e[2][1]=O>>>0,O=e[3][1]+_,e[3][0]=e[3][0]+w+(O/4294967296>>>0)>>>0,e[3][1]=O>>>0,O=e[4][1]+S,e[4][0]=e[4][0]+E+(O/4294967296>>>0)>>>0,e[4][1]=O>>>0,O=e[5][1]+A,e[5][0]=e[5][0]+M+(O/4294967296>>>0)>>>0,e[5][1]=O>>>0,O=e[6][1]+k,e[6][0]=e[6][0]+I+(O/4294967296>>>0)>>>0,e[6][1]=O>>>0,O=e[7][1]+R,e[7][0]=e[7][0]+T+(O/4294967296>>>0)>>>0,e[7][1]=O>>>0,L-=128}}},35139:(e,t,r)=>{var n=r(21964),i=r(47573).Buffer,o=r(5525),s=r(89810),a=e.exports=o.util=o.util||{};function u(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function c(e){if(this.data="",this.read=0,"string"===typeof e)this.data=e;else if(a.isArrayBuffer(e)||a.isArrayBufferView(e))if("undefined"!==typeof i&&e instanceof i)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(n){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof c||"object"===typeof e&&"string"===typeof e.data&&"number"===typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!==typeof n&&n.nextTick&&!n.browser)return a.nextTick=n.nextTick,void("function"===typeof setImmediate?a.setImmediate=setImmediate:a.setImmediate=a.nextTick);if("function"===typeof setImmediate)return a.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(a.nextTick=function(e){return setImmediate(e)});if(a.setImmediate=function(e){setTimeout(e,0)},"undefined"!==typeof window&&"function"===typeof window.postMessage){var e="forge.setImmediate",t=[];a.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!==typeof MutationObserver){var r=Date.now(),i=!0,o=document.createElement("div");t=[];new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(o,{attributes:!0});var s=a.setImmediate;a.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),s(e)):(t.push(e),1===t.length&&o.setAttribute("a",i=!i))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!==typeof n&&n.versions&&n.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"===typeof self?window:self,a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=c,a.ByteStringBuffer=c;a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},a.ByteStringBuffer.prototype.putInt=function(e,t){u(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},a.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},a.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},a.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},a.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},a.ByteStringBuffer.prototype.getInt=function(e){u(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.ByteStringBuffer.prototype.bytes=function(e){return"undefined"===typeof e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.ByteStringBuffer.prototype.toString=function(){return a.decodeUtf8(this.bytes())},a.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=a.isArrayBuffer(e),n=a.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==e&&void 0!==e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},a.DataBuffer.prototype.length=function(){return this.write-this.read},a.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},a.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},a.DataBuffer.prototype.putBytes=function(e,t){if(a.isArrayBufferView(e)){var r=(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(a.isArrayBuffer(e)){var n=new Uint8Array(e);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(e instanceof a.DataBuffer||"object"===typeof e&&"number"===typeof e.read&&"number"===typeof e.write&&a.isArrayBufferView(e.data)){n=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(e instanceof a.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"===typeof e){var i;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.hex.decode(e,i,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=a.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=a.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},a.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},a.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},a.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},a.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){u(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return u(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},a.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},a.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},a.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},a.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},a.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},a.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},a.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},a.DataBuffer.prototype.getInt=function(e){u(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.DataBuffer.prototype.bytes=function(e){return"undefined"===typeof e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return a.binary.raw.encode(t);if("hex"===e)return a.binary.hex.encode(t);if("base64"===e)return a.binary.base64.encode(t);if("utf8"===e)return a.text.utf8.decode(t);if("utf16"===e)return a.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},a.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=a.encodeUtf8(e)),new a.ByteBuffer(e)},a.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",o="",s=0,a=0;r>0;--r,++s)i=e.charCodeAt(s)^t.charCodeAt(s),a>=10&&(n+=o,o="",a=0),o+=String.fromCharCode(i),++a;return n+=o},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},a.bytesToHex=function(e){return a.createBuffer(e).toHex()},a.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){for(var r,n,i,o="",s="",a=0;a<e.length;)r=e.charCodeAt(a++),n=e.charCodeAt(a++),i=e.charCodeAt(a++),o+=h.charAt(r>>2),o+=h.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=h.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":h.charAt(63&i)),t&&o.length>t&&(s+=o.substr(0,t)+"\r\n",o=o.substr(t));return s+=o},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,o="",s=0;s<e.length;)t=l[e.charCodeAt(s++)-43],r=l[e.charCodeAt(s++)-43],n=l[e.charCodeAt(s++)-43],i=l[e.charCodeAt(s++)-43],o+=String.fromCharCode(t<<2|r>>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},a.binary.hex.encode=a.bytesToHex,a.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,o=r=r||0;for(1&e.length&&(i=1,n[o++]=parseInt(e[0],16));i<e.length;i+=2)n[o++]=parseInt(e.substr(i,2),16);return t?o-r:n},a.binary.base64.encode=function(e,t){for(var r,n,i,o="",s="",a=0;a<e.byteLength;)r=e[a++],n=e[a++],i=e[a++],o+=h.charAt(r>>2),o+=h.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=h.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":h.charAt(63&i)),t&&o.length>t&&(s+=o.substr(0,t)+"\r\n",o=o.substr(t));return s+=o},a.binary.base64.decode=function(e,t,r){var n,i,o,s,a=t;a||(a=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u<e.length;)n=l[e.charCodeAt(u++)-43],i=l[e.charCodeAt(u++)-43],o=l[e.charCodeAt(u++)-43],s=l[e.charCodeAt(u++)-43],a[c++]=n<<2|i>>4,64!==o&&(a[c++]=(15&i)<<4|o>>2,64!==s&&(a[c++]=(3&o)<<6|s));return t?c-r:a.subarray(0,c)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,f,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,f,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},a.text.utf8.decode=function(e){return a.decodeUtf8(String.fromCharCode.apply(null,e))},a.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),o=r=r||0,s=r,a=0;a<e.length;++a)i[s++]=e.charCodeAt(a),o+=2;return t?o-r:n},a.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},a.deflate=function(e,t,r){if(t=a.decode64(e.deflate(a.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},a.inflate=function(e,t,r){var n=e.inflate(a.encode64(t)).rval;return null===n?null:a.decode64(n)};var d=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=a.encode64(JSON.stringify(r)),n=e.setItem(t,r)),"undefined"!==typeof n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},p=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(a.decode64(r))),r},y=function(e,t,r,n){var i=p(e,t);null===i&&(i={}),i[r]=n,d(e,t,i)},g=function(e,t,r){var n=p(e,t);return null!==n&&(n=r in n?n[r]:null),n},m=function(e,t,r){var n=p(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var o in n){i=!1;break}i&&(n=null),d(e,t,n)}},b=function(e,t){d(e,t,null)},v=function(e,t,r){var n,i=null;"undefined"===typeof r&&(r=["web","flash"]);var o=!1,s=null;for(var a in r){n=r[a];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),o="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),o=!0)}catch(u){s=u}if(o)break}if(!o)throw s;return i};a.setItem=function(e,t,r,n,i){v(y,arguments,i)},a.getItem=function(e,t,r,n){return v(g,arguments,n)},a.removeItem=function(e,t,r,n){v(m,arguments,n)},a.clearItems=function(e,t,r){v(b,arguments,r)},a.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var w=null;a.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,o,s=r[n].indexOf("=");s>0?(i=r[n].substring(0,s),o=r[n].substring(s+1)):(i=r[n],o=null),i in t||(t[i]=[]),i in Object.prototype||null===o||t[i].push(unescape(o))}return t};return"undefined"===typeof e?(null===w&&(w="undefined"!==typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=w):t=r(e),t},a.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:a.getQueryVariables(r)}},a.makeRequest=function(e){var t=a.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return"undefined"===typeof e?t.path:t.path[e]},getQuery:function(e,r){var n;return"undefined"===typeof e?n=t.query:(n=t.query[e])&&"undefined"!==typeof r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},a.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},a.format=function(e){for(var t,r,n=/%./g,i=0,o=[],s=0;t=n.exec(e);){(r=e.substring(s,n.lastIndex-2)).length>0&&o.push(r),s=n.lastIndex;var a=t[0][1];switch(a){case"s":case"o":i<arguments.length?o.push(arguments[1+i++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+a+"?>")}}return o.push(e.substring(s)),o.join("")},a.formatNumber=function(e,t,r,n){var i=e,o=isNaN(t=Math.abs(t))?2:t,s=void 0===r?",":r,a=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",h=c.length>3?c.length%3:0;return u+(h?c.substr(0,h)+a:"")+c.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+a)+(o?s+Math.abs(i-c).toFixed(o).slice(2):"")},a.formatSize=function(e){return e=e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes"},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=a.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},a.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++t,!0}))).length+t),n=a.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var o=a.hexToBytes(e[i]);o.length<2&&n.putByte(0),n.putBytes(o)}else n.fillWithByte(0,r),r=0;return n.getBytes()},a.bytesToIP=function(e){return 4===e.length?a.bytesToIPv4(e):16===e.length?a.bytesToIPv6(e):null},a.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},a.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var o=a.bytesToHex(e[i]+e[i+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var s=r[r.length-1],u=t.length;s&&u===s.end+1?(s.end=u,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"===typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"===typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"===typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(n,i,o){if(0===i){var s=Math.floor(n.reduce((function(e,t){return e+t}),0)/n.length);return a.cores=Math.max(1,s),URL.revokeObjectURL(r),t(null,a.cores)}!function(e,t){for(var n=[],i=[],o=0;o<e;++o){var s=new Worker(r);s.addEventListener("message",(function(r){if(i.push(r.data),i.length===e){for(var o=0;o<e;++o)n[o].terminate();t(null,i)}})),n.push(s)}for(o=0;o<e;++o)n[o].postMessage(o)}(o,(function(t,r){n.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],o=r[n]=[],s=0;s<e;++s)if(n!==s){var a=t[s];(i.st>a.st&&i.st<a.et||a.st>i.st&&a.st<i.et)&&o.push(s)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(o,r)),e(n,i-1,o)}))}([],5,16)}},49781:(e,t,r)=>{var n=r(5525);r(16221),r(93758),r(34892),r(28717),r(79955),r(89777),r(82010),r(37889),r(95842),r(35139);var i=n.asn1,o=e.exports=n.pki=n.pki||{},s=o.oids,a={};a.CN=s.commonName,a.commonName="CN",a.C=s.countryName,a.countryName="C",a.L=s.localityName,a.localityName="L",a.ST=s.stateOrProvinceName,a.stateOrProvinceName="ST",a.O=s.organizationName,a.organizationName="O",a.OU=s.organizationalUnitName,a.organizationalUnitName="OU",a.E=s.emailAddress,a.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},h={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},l={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},f={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[l,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function d(e,t){"string"===typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}o.RDNAttributesAsArray=function(e,t){for(var r,n,o,u=[],c=0;c<e.value.length;++c){r=e.value[c];for(var h=0;h<r.value.length;++h)o={},n=r.value[h],o.type=i.derToOid(n.value[0].value),o.value=n.value[1].value,o.valueTagClass=n.value[1].type,o.type in s&&(o.name=s[o.type],o.name in a&&(o.shortName=a[o.name])),t&&(t.update(o.type),t.update(o.value)),u.push(o)}return u},o.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],u=i.derToOid(n.value[0].value),c=n.value[1].value,h=0;h<c.length;++h){var l={};if(l.type=u,l.value=c[h].value,l.valueTagClass=c[h].type,l.type in s&&(l.name=s[l.type],l.name in a&&(l.shortName=a[l.name])),l.type===s.extensionRequest){l.extensions=[];for(var f=0;f<l.value.length;++f)l.extensions.push(o.certificateExtensionFromAsn1(l.value[f]))}t.push(l)}return t};var p=function(e,t,r){var n={};if(e!==s["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:s.sha1},mgf:{algorithmOid:s.mgf1,hash:{algorithmOid:s.sha1}},saltLength:20});var o={},a=[];if(!i.validate(t,h,o,a)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=a,u}return void 0!==o.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(o.hashOid)),void 0!==o.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(o.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(o.maskGenHashOid)),void 0!==o.saltLength&&(n.saltLength=o.saltLength.charCodeAt(0)),n};function y(e){for(var t,r,o=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),s=e.attributes,a=0;a<s.length;++a){var u=(t=s[a]).value,c=i.Type.PRINTABLESTRING;"valueTagClass"in t&&(c=t.valueTagClass)===i.Type.UTF8&&(u=n.util.encodeUtf8(u)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,c,!1,u)])]),o.value.push(r)}return o}function g(e){for(var t,r=0;r<e.length;++r){if("undefined"===typeof(t=e[r]).name&&(t.type&&t.type in o.oids?t.name=o.oids[t.type]:t.shortName&&t.shortName in a&&(t.name=o.oids[a[t.shortName]])),"undefined"===typeof t.type){if(!t.name||!(t.name in o.oids))throw(u=new Error("Attribute type not specified.")).attribute=t,u;t.type=o.oids[t.name]}if("undefined"===typeof t.shortName&&t.name&&t.name in a&&(t.shortName=a[t.name]),t.type===s.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(o.certificateExtensionToAsn1(m(t.extensions[n])))}var u;if("undefined"===typeof t.value)throw(u=new Error("Attribute value not specified.")).attribute=t,u}}function m(e,t){if(t=t||{},"undefined"===typeof e.name&&e.id&&e.id in o.oids&&(e.name=o.oids[e.id]),"undefined"===typeof e.id){if(!e.name||!(e.name in o.oids))throw(_=new Error("Extension ID not specified.")).extension=e,_;e.id=o.oids[e.name]}if("undefined"!==typeof e.value)return e;if("keyUsage"===e.name){var r=0,a=0,u=0;e.digitalSignature&&(a|=128,r=7),e.nonRepudiation&&(a|=64,r=6),e.keyEncipherment&&(a|=32,r=5),e.dataEncipherment&&(a|=16,r=4),e.keyAgreement&&(a|=8,r=3),e.keyCertSign&&(a|=4,r=2),e.cRLSign&&(a|=2,r=1),e.encipherOnly&&(a|=1,r=0),e.decipherOnly&&(u|=128,r=7);var c=String.fromCharCode(r);0!==u?c+=String.fromCharCode(a)+String.fromCharCode(u):0!==a&&(c+=String.fromCharCode(a)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var h=e.value.value;for(var l in e)!0===e[l]&&(l in s?h.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s[l]).getBytes())):-1!==l.indexOf(".")&&h.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(l).getBytes())))}else if("nsCertType"===e.name){r=0,a=0;e.client&&(a|=128,r=7),e.server&&(a|=64,r=6),e.email&&(a|=32,r=5),e.objsign&&(a|=16,r=4),e.reserved&&(a|=8,r=3),e.sslCA&&(a|=4,r=2),e.emailCA&&(a|=2,r=1),e.objCA&&(a|=1,r=0);c=String.fromCharCode(r);0!==a&&(c+=String.fromCharCode(a)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var f=0;f<e.altNames.length;++f){c=(b=e.altNames[f]).value;if(7===b.type&&b.ip){if(null===(c=n.util.bytesFromIP(b.ip)))throw(_=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,_}else 8===b.type&&(c=b.oid?i.oidToDer(i.oidToDer(b.oid)):i.oidToDer(c));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,b.type,!1,c))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,d.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);h=e.value.value;if(e.keyIdentifier){var p=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;h.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,p))}if(e.authorityCertIssuer){var g=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];h.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var m=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);h.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);h=e.value.value;var b,v=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),w=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(f=0;f<e.altNames.length;++f){c=(b=e.altNames[f]).value;if(7===b.type&&b.ip){if(null===(c=n.util.bytesFromIP(b.ip)))throw(_=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,_}else 8===b.type&&(c=b.oid?i.oidToDer(i.oidToDer(b.oid)):i.oidToDer(c));w.value.push(i.create(i.Class.CONTEXT_SPECIFIC,b.type,!1,c))}v.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[w])),h.push(v)}var _;if("undefined"===typeof e.value)throw(_=new Error("Extension value not specified.")).extension=e,_;return e}function b(e,t){if(e===s["RSASSA-PSS"]){var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r)}return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}function v(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,o=0;o<r.length;++o){var s=r[o],a=s.value,u=i.Type.UTF8;"valueTagClass"in s&&(u=s.valueTagClass),u===i.Type.UTF8&&(a=n.util.encodeUtf8(a));var c=!1;"valueConstructed"in s&&(c=s.valueConstructed);var h=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,u,c,a)])]);t.value.push(h)}return t}o.certificateFromPem=function(e,t,r){var s=n.pem.decode(e)[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var a=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw a.headerType=s.type,a}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=i.fromDer(s.body,r);return o.certificateFromAsn1(u,t)},o.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(o.certificateToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return o.publicKeyFromAsn1(s)},o.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(o.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(o.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.getPublicKeyFingerprint=function(e,t){var r,s=(t=t||{}).md||n.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(o.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(o.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}s.start(),s.update(r);var a=s.digest();if("hex"===t.encoding){var u=a.toHex();return t.delimiter?u.match(/.{2}/g).join(t.delimiter):u}if("binary"===t.encoding)return a.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return a},o.certificationRequestFromPem=function(e,t,r){var s=n.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==s.type){var a=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw a.headerType=s.type,a}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var u=i.fromDer(s.body,r);return o.certificationRequestFromAsn1(u,t)},o.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(o.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},o.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return d(e.issuer,t)},e.issuer.addField=function(t){g([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return d(e.subject,t)},e.subject.addField=function(t){g([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){g(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){g(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)m(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"===typeof t&&(t={name:t});for(var r,n=null,i=0;null===n&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,r){e.md=r||n.md.sha1.create();var a=s[e.md.algorithm+"WithRSAEncryption"];if(!a){var u=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=a,e.tbsCertificate=o.getTBSCertificate(e);var c=i.toDer(e.tbsCertificate);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var a=t.issuer,u=e.subject;throw(y=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=a.attributes,y.actualIssuer=u.attributes,y}var c=t.md;if(null===c){if(t.signatureOid in s)switch(s[t.signatureOid]){case"sha1WithRSAEncryption":c=n.md.sha1.create();break;case"md5WithRSAEncryption":c=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":c=n.md.sha256.create();break;case"sha384WithRSAEncryption":c=n.md.sha384.create();break;case"sha512WithRSAEncryption":c=n.md.sha512.create()}if(null===c)throw(y=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,y;var h=t.tbsCertificate||o.getTBSCertificate(t),l=i.toDer(h);c.update(l.getBytes())}if(null!==c){var f;switch(t.signatureOid){case s.sha1WithRSAEncryption:f=void 0;break;case s["RSASSA-PSS"]:var d,p,y;if(void 0===(d=s[t.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[d])throw(y=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,y.name=d,y;if(void 0===(p=s[t.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[p])throw(y=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,y.name=p,y;if(p=n.mgf[p].create(n.md[d].create()),void 0===(d=s[t.signatureParameters.hash.algorithmOid])||void 0===n.md[d])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:d};f=n.pss.create(n.md[d].create(),p,t.signatureParameters.saltLength)}r=e.publicKey.verify(c.digest().getBytes(),t.signature,f)}return r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var o,s;r=!0;for(var a=0;r&&a<n.attributes.length;++a)o=n.attributes[a],s=i.attributes[a],o.type===s.type&&o.value===s.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return o.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=s.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var o=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===o}}return!1},e},o.certificateFromAsn1=function(e,t){var r={},a=[];if(!i.validate(e,c,r,a))throw(f=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=a,f;if(i.derToOid(r.publicKeyOid)!==o.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=o.createCertificate();u.version=r.certVersion?r.certVersion.charCodeAt(0):0;var h=n.util.createBuffer(r.certSerialNumber);u.serialNumber=h.toHex(),u.signatureOid=n.asn1.derToOid(r.certSignatureOid),u.signatureParameters=p(u.signatureOid,r.certSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),u.siginfo.parameters=p(u.siginfo.algorithmOid,r.certinfoSignatureParams,!1),u.signature=r.certSignature;var l=[];if(void 0!==r.certValidity1UTCTime&&l.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&l.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&l.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&l.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),l.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=l[0],u.validity.notAfter=l[1],u.tbsCertificate=r.tbsCertificate,t){var f;if(u.md=null,u.signatureOid in s)switch(s[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create()}if(null===u.md)throw(f=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,f;var y=i.toDer(u.tbsCertificate);u.md.update(y.getBytes())}var m=n.md.sha1.create();u.issuer.getField=function(e){return d(u.issuer,e)},u.issuer.addField=function(e){g([e]),u.issuer.attributes.push(e)},u.issuer.attributes=o.RDNAttributesAsArray(r.certIssuer,m),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=m.digest().toHex();var b=n.md.sha1.create();return u.subject.getField=function(e){return d(u.subject,e)},u.subject.addField=function(e){g([e]),u.subject.attributes.push(e)},u.subject.attributes=o.RDNAttributesAsArray(r.certSubject,b),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=b.digest().toHex(),r.certExtensions?u.extensions=o.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},o.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(o.certificateExtensionFromAsn1(n.value[i]));return t},o.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in s)if(t.name=s[t.id],"keyUsage"===t.name){var r=0,o=0;(u=i.fromDer(t.value)).value.length>1&&(r=u.value.charCodeAt(1),o=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128===(128&r),t.nonRepudiation=64===(64&r),t.keyEncipherment=32===(32&r),t.dataEncipherment=16===(16&r),t.keyAgreement=8===(8&r),t.keyCertSign=4===(4&r),t.cRLSign=2===(2&r),t.encipherOnly=1===(1&r),t.decipherOnly=128===(128&o)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var a=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?a=u.value[0].value:u.value.length>1&&(a=u.value[1].value),null!==a&&(t.pathLenConstraint=i.derToInteger(a))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),c=0;c<u.value.length;++c){var h=i.derToOid(u.value[c].value);h in s?t[s[h]]=!0:t[h]=!0}else if("nsCertType"===t.name){r=0;(u=i.fromDer(t.value)).value.length>1&&(r=u.value.charCodeAt(1)),t.client=128===(128&r),t.server=64===(64&r),t.email=32===(32&r),t.objsign=16===(16&r),t.reserved=8===(8&r),t.sslCA=4===(4&r),t.emailCA=2===(2&r),t.objCA=1===(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var l;t.altNames=[];u=i.fromDer(t.value);for(var f=0;f<u.value.length;++f){var d={type:(l=u.value[f]).type,value:l.value};switch(t.altNames.push(d),l.type){case 1:case 2:case 6:break;case 7:d.ip=n.util.bytesToIP(l.value);break;case 8:d.oid=i.derToOid(l.value)}}}else if("subjectKeyIdentifier"===t.name){u=i.fromDer(t.value);t.subjectKeyIdentifier=n.util.bytesToHex(u.value)}return t},o.certificationRequestFromAsn1=function(e,t){var r={},a=[];if(!i.validate(e,f,r,a))throw(c=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=a,c;if(i.derToOid(r.publicKeyOid)!==o.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=o.createCertificationRequest();if(u.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,u.signatureOid=n.asn1.derToOid(r.csrSignatureOid),u.signatureParameters=p(u.signatureOid,r.csrSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),u.siginfo.parameters=p(u.siginfo.algorithmOid,r.csrSignatureParams,!1),u.signature=r.csrSignature,u.certificationRequestInfo=r.certificationRequestInfo,t){var c;if(u.md=null,u.signatureOid in s)switch(s[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create()}if(null===u.md)throw(c=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=u.signatureOid,c;var h=i.toDer(u.certificationRequestInfo);u.md.update(h.getBytes())}var l=n.md.sha1.create();return u.subject.getField=function(e){return d(u.subject,e)},u.subject.addField=function(e){g([e]),u.subject.attributes.push(e)},u.subject.attributes=o.RDNAttributesAsArray(r.certificationRequestInfoSubject,l),u.subject.hash=l.digest().toHex(),u.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),u.getAttribute=function(e){return d(u,e)},u.addAttribute=function(e){g([e]),u.attributes.push(e)},u.attributes=o.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),u},o.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return d(e.subject,t)},e.subject.addField=function(t){g([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return d(e,t)},e.addAttribute=function(t){g([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){g(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){g(t),e.attributes=t},e.sign=function(t,r){e.md=r||n.md.sha1.create();var a=s[e.md.algorithm+"WithRSAEncryption"];if(!a){var u=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=a,e.certificationRequestInfo=o.getCertificationRequestInfo(e);var c=i.toDer(e.certificationRequestInfo);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){if(e.signatureOid in s)switch(s[e.signatureOid]){case"sha1WithRSAEncryption":r=n.md.sha1.create();break;case"md5WithRSAEncryption":r=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":r=n.md.sha256.create();break;case"sha384WithRSAEncryption":r=n.md.sha384.create();break;case"sha512WithRSAEncryption":r=n.md.sha512.create()}if(null===r)throw(f=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,f;var a=e.certificationRequestInfo||o.getCertificationRequestInfo(e),u=i.toDer(a);r.update(u.getBytes())}if(null!==r){var c;switch(e.signatureOid){case s.sha1WithRSAEncryption:break;case s["RSASSA-PSS"]:var h,l,f;if(void 0===(h=s[e.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[h])throw(f=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,f.name=h,f;if(void 0===(l=s[e.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[l])throw(f=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,f.name=l,f;if(l=n.mgf[l].create(n.md[h].create()),void 0===(h=s[e.signatureParameters.hash.algorithmOid])||void 0===n.md[h])throw(f=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,f.name=h,f;c=n.pss.create(n.md[h].create(),l,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,c)}return t},e};var w=new Date("1950-01-01T00:00:00Z"),_=new Date("2050-01-01T00:00:00Z");function E(e){return e>=w&&e<_?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}o.getTBSCertificate=function(e){var t=E(e.validity.notBefore),r=E(e.validity.notAfter),s=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),b(e.siginfo.algorithmOid,e.siginfo.parameters)]),y(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),y(e.subject),o.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&s.value.push(o.certificateExtensionsToAsn1(e.extensions)),s},o.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),o.publicKeyToAsn1(e.publicKey),v(e)])},o.distinguishedNameToAsn1=function(e){return y(e)},o.certificateToAsn1=function(e){var t=e.tbsCertificate||o.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),b(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},o.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(o.certificateExtensionToAsn1(e[n]));return t},o.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!==typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},o.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||o.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),b(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},o.createCaStore=function(e){var t={certs:{}};function r(e){return s(e),t.certs[e.hash]||null}function s(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=o.RDNAttributesAsArray(y(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if("string"===typeof e&&(e=n.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"===typeof e&&(e=n.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var s=i.toDer(o.certificateToAsn1(e)).getBytes(),a=0;a<t.length;++a){if(s===i.toDer(o.certificateToAsn1(t[a])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(n.util.isArray(i))for(var o=0;o<i.length;++o)e.push(i[o]);else e.push(i)}return e},t.removeCertificate=function(e){var a;if("string"===typeof e&&(e=n.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))return null;var u=r(e.subject);if(!n.util.isArray(u))return a=t.certs[e.subject.hash],delete t.certs[e.subject.hash],a;for(var c=i.toDer(o.certificateToAsn1(e)).getBytes(),h=0;h<u.length;++h){c===i.toDer(o.certificateToAsn1(u[h])).getBytes()&&(a=u[h],u.splice(h,1))}return 0===u.length&&delete t.certs[e.subject.hash],a},e)for(var a=0;a<e.length;++a){var u=e[a];t.addCertificate(u)}return t},o.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},o.verifyCertificateChain=function(e,t,r){"function"===typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),s=r.validityCheckDate;"undefined"===typeof s&&(s=new Date);var a=!0,u=null,c=0;do{var h=t.shift(),l=null,f=!1;if(s&&(s<h.validity.notBefore||s>h.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:o.certificateError.certificate_expired,notBefore:h.validity.notBefore,notAfter:h.validity.notAfter,now:s}),null===u){if(null===(l=t[0]||e.getIssuer(h))&&h.isIssuer(h)&&(f=!0,l=h),l){var d=l;n.util.isArray(d)||(d=[d]);for(var p=!1;!p&&d.length>0;){l=d.shift();try{p=l.verify(h)}catch(E){}}p||(u={message:"Certificate signature is invalid.",error:o.certificateError.bad_certificate})}null!==u||l&&!f||e.hasCertificate(h)||(u={message:"Certificate is not trusted.",error:o.certificateError.unknown_ca})}if(null===u&&l&&!h.isIssuer(l)&&(u={message:"Certificate issuer is invalid.",error:o.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===u&&g<h.extensions.length;++g){var m=h.extensions[g];m.critical&&!(m.name in y)&&(u={message:"Certificate has an unsupported critical extension.",error:o.certificateError.unsupported_certificate})}if(null===u&&(!a||0===t.length&&(!l||f))){var b=h.getExtension("basicConstraints"),v=h.getExtension("keyUsage");if(null!==v&&(v.keyCertSign&&null!==b||(u={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:o.certificateError.bad_certificate})),null!==u||null===b||b.cA||(u={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:o.certificateError.bad_certificate}),null===u&&null!==v&&"pathLenConstraint"in b)c-1>b.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:o.certificateError.bad_certificate})}var w=null===u||u.error,_=r.verify?r.verify(w,c,i):w;if(!0!==_)throw!0===w&&(u={message:"The application rejected the certificate.",error:o.certificateError.bad_certificate}),(_||0===_)&&("object"!==typeof _||n.util.isArray(_)?"string"===typeof _&&(u.error=_):(_.message&&(u.message=_.message),_.error&&(u.error=_.error))),u;u=null,a=!1,++c}while(t.length>0);return!0}},92388:e=>{"use strict";var t=function(e){return e!==e};e.exports=function(e,r){return 0===e&&0===r?1/e===1/r:e===r||!(!t(e)||!t(r))}},95812:(e,t,r)=>{"use strict";var n=r(91157),i=r(811),o=r(92388),s=r(60902),a=r(62977),u=i(s(),Object);n(u,{getPolyfill:s,implementation:o,shim:a}),e.exports=u},60902:(e,t,r)=>{"use strict";var n=r(92388);e.exports=function(){return"function"===typeof Object.is?Object.is:n}},62977:(e,t,r)=>{"use strict";var n=r(60902),i=r(91157);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},31838:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(74792),a=Object.prototype.propertyIsEnumerable,u=!a.call({toString:null},"toString"),c=a.call((function(){}),"prototype"),h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"===typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"===typeof window[e])try{l(window[e])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(e){var t=null!==e&&"object"===typeof e,r="[object Function]"===o.call(e),n=s(e),a=t&&"[object String]"===o.call(e),f=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var y=0;y<e.length;++y)f.push(String(y));if(n&&e.length>0)for(var g=0;g<e.length;++g)f.push(String(g));else for(var m in e)p&&"prototype"===m||!i.call(e,m)||f.push(String(m));if(u)for(var b=function(e){if("undefined"===typeof window||!d)return l(e);try{return l(e)}catch(t){return!1}}(e),v=0;v<h.length;++v)b&&"constructor"===h[v]||!i.call(e,h[v])||f.push(h[v]);return f}}e.exports=n},59998:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(74792),o=Object.keys,s=o?function(e){return o(e)}:r(31838),a=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(n.call(e)):a(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},74792:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},27450:(e,t,r)=>{"use strict";const n=r(30071),i=r(62528);e.exports=(e,t)=>{const r=n(e,{...t,count:1});return i.fn((async e=>{e((()=>{r.cancel()}));const[t]=await r;return t}))()},e.exports.AggregateError=n.AggregateError},62528:e=>{"use strict";class t extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}}class r{static fn(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return new r(((t,r,i)=>{n.push(i),e(...n).then(t,r)}))}}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise(((t,r)=>{this._reject=r;const n=e=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(e)};return Object.defineProperties(n,{shouldReject:{get:()=>this._rejectOnCancel,set:e=>{this._rejectOnCancel=e}}}),e((e=>{this._isCanceled&&n.shouldReject||(this._isPending=!1,t(e))}),(e=>{this._isPending=!1,r(e)}),n)}))}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(this._isPending&&!this._isCanceled){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(const e of this._cancelHandlers)e()}catch(r){return void this._reject(r)}this._rejectOnCancel&&this._reject(new t(e))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(r.prototype,Promise.prototype),e.exports=r,e.exports.CancelError=t},44966:e=>{"use strict";e.exports=()=>{const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}},57863:(e,t,r)=>{const n=r(73938),i=r(44966);e.exports=class{constructor(){this._buffer=new n,this._waitingConsumers=new n}push(e){const{promise:t,resolve:r}=i();return this._buffer.push({chunk:e,resolve:r}),this._consume(),t}_consume(){for(;!this._waitingConsumers.isEmpty()&&!this._buffer.isEmpty();){const e=this._waitingConsumers.shift(),t=this._buffer.shift();e.resolve(t.chunk),t.resolve()}}shift(){const{promise:e,resolve:t}=i();return this._waitingConsumers.push({resolve:t}),this._consume(),e}isEmpty(){return this._buffer.isEmpty()}}},28959:e=>{"use strict";e.exports=(e,t)=>(t=t||(()=>{}),e.then((e=>new Promise((e=>{e(t())})).then((()=>e))),(e=>new Promise((e=>{e(t())})).then((()=>{throw e})))))},10523:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(43748),i=r(12793),o=r(1696),s=()=>{},a=new i.TimeoutError;t.default=class extends n{constructor(e){var t,r,n,i;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=s,this._resolveIdle=s,!("number"===typeof(e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:o.default},e)).intervalCap&&e.intervalCap>=1))throw new TypeError("Expected `intervalCap` to be a number from 1 and up, got `".concat(null!==(r=null===(t=e.intervalCap)||void 0===t?void 0:t.toString())&&void 0!==r?r:"","` (").concat(typeof e.intervalCap,")"));if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError("Expected `interval` to be a finite number >= 0, got `".concat(null!==(i=null===(n=e.interval)||void 0===n?void 0:n.toString())&&void 0!==i?i:"","` (").concat(typeof e.interval,")"));this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||0===e.interval,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=!0===e.throwOnTimeout,this._isPaused=!1===e.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=s,0===this._pendingCount&&(this._resolveIdle(),this._resolveIdle=s,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const e=Date.now();if(void 0===this._intervalId){const t=this._intervalEnd-e;if(!(t<0))return void 0===this._timeoutId&&(this._timeoutId=setTimeout((()=>{this._onResumeInterval()}),t)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const t=this._queue.dequeue();return!!t&&(this.emit("active"),t(),e&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((()=>{this._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!("number"===typeof e&&e>=1))throw new TypeError("Expected `concurrency` to be a number from 1 and up, got `".concat(e,"` (").concat(typeof e,")"));this._concurrency=e,this._processQueue()}async add(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(((r,n)=>{this._queue.enqueue((async()=>{this._pendingCount++,this._intervalCount++;try{const o=void 0===this._timeout&&void 0===t.timeout?e():i.default(Promise.resolve(e()),void 0===t.timeout?this._timeout:t.timeout,(()=>{(void 0===t.throwOnTimeout?this._throwOnTimeout:t.throwOnTimeout)&&n(a)}));r(await o)}catch(o){n(o)}this._next()}),t),this._tryToStartAnother(),this.emit("add")}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise((e=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}}))}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise((e=>{const t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}}))}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}}},17881:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let n=0,i=e.length;for(;i>0;){const o=i/2|0;let s=n+o;r(e[s],t)<=0?(n=++s,i-=o+1):i=o}return n}},1696:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(17881);t.default=class{constructor(){this._queue=[]}enqueue(e,t){const r={priority:(t=Object.assign({priority:0},t)).priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority)return void this._queue.push(r);const i=n.default(this._queue,r,((e,t)=>t.priority-e.priority));this._queue.splice(i,0,r)}dequeue(){const e=this._queue.shift();return null===e||void 0===e?void 0:e.run}filter(e){return this._queue.filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return this._queue.length}}},12793:(e,t,r)=>{"use strict";const n=r(28959);class i extends Error{constructor(e){super(e),this.name="TimeoutError"}}const o=(e,t,r)=>new Promise(((o,s)=>{if("number"!==typeof t||t<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(t===1/0)return void o(e);const a=setTimeout((()=>{if("function"===typeof r){try{o(r())}catch(u){s(u)}return}const n="string"===typeof r?r:"Promise timed out after ".concat(t," milliseconds"),a=r instanceof Error?r:new i(n);"function"===typeof e.cancel&&e.cancel(),s(a)}),t);n(e.then(o,s),(()=>{clearTimeout(a)}))}));e.exports=o,e.exports.default=o,e.exports.TimeoutError=i},37926:e=>{"use strict";const t=async e=>{try{return{isFulfilled:!0,isRejected:!1,value:await e}}catch(t){return{isFulfilled:!1,isRejected:!0,reason:t}}};e.exports=t,e.exports.default=t},5621:(e,t,r)=>{"use strict";const n=r(47702),i=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class o extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,({message:e}=e)):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const s=(e,t)=>new Promise(((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};const a=n.operation(t);a.attempt((async n=>{try{r(await e(n))}catch(c){if(!(c instanceof Error))return void s(new TypeError('Non-error was thrown: "'.concat(c,'". You should only throw errors.')));if(c instanceof o)a.stop(),s(c.originalError);else if(c instanceof TypeError&&(u=c.message,!i.includes(u)))a.stop(),s(c);else{((e,t,r)=>{const n=r.retries-(t-1);e.attemptNumber=t,e.retriesLeft=n})(c,n,t);try{await t.onFailedAttempt(c)}catch(c){return void s(c)}a.retry(c)||s(a.mainError())}}var u}))}));e.exports=s,e.exports.default=s,e.exports.AbortError=o},43982:(e,t,r)=>{"use strict";const n=r(37926),i=r(67396);e.exports=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{concurrency:r=1/0}=t,o=i(r);return Promise.all(e.map((e=>e&&"function"===typeof e.then?n(e):n("function"===typeof e?o((()=>e())):Promise.resolve(e)))))}},67396:(e,t,r)=>{"use strict";const n=r(33764),i=e=>{if(!Number.isInteger(e)&&e!==1/0||!(e>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));const t=[];let r=0;const i=()=>{r--,t.length>0&&t.shift()()},o=function(e,t){r++;for(var o=arguments.length,s=new Array(o>2?o-2:0),a=2;a<o;a++)s[a-2]=arguments[a];const u=n(e,...s);t(u),u.then(i,i)},s=function(n,i){for(var s=arguments.length,a=new Array(s>2?s-2:0),u=2;u<s;u++)a[u-2]=arguments[u];r<e?o(n,i,...a):t.push(o.bind(null,n,i,...a))},a=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new Promise((t=>s(e,t,...r)))};return Object.defineProperties(a,{activeCount:{get:()=>r},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}}),a};e.exports=i,e.exports.default=i},30071:(e,t,r)=>{"use strict";const n=r(3579),i=r(62528);class o extends Error{}e.exports=(e,t)=>new i(((r,i,s)=>{const{count:a,filter:u=(()=>!0)}=t;if(!Number.isFinite(a))return void i(new TypeError("Expected a finite number, got ".concat(typeof t.count)));const c=[],h=[];let l=0,f=!1;const d=new Set,p=()=>{for(const t of e)d.has(t)||"function"!==typeof t.cancel||t.cancel()};s(p);for(const t of e)l++,(async()=>{try{const e=await t;if(f)return;if(!u(e))throw new o("Value does not satisfy filter");c.push(e)}catch(e){h.push(e)}finally{d.add(t),!f&&(c.length===a&&(r(c),f=!0),l-h.length<a&&(i(new n(h)),f=!0),f)&&p()}})();a>l&&(i(new RangeError("Expected input to contain at least ".concat(t.count," items, but contains ").concat(l," items"))),p())})),e.exports.AggregateError=n,e.exports.FilterError=o},31317:e=>{"use strict";class t extends Error{constructor(e){super(e),this.name="TimeoutError"}}const r=(e,r,n,i)=>{let o;const s=new Promise(((s,a)=>{if("number"!==typeof r||r<0)throw new TypeError("Expected `milliseconds` to be a positive number");r!==1/0?(i={customTimers:{setTimeout:setTimeout,clearTimeout:clearTimeout},...i},o=i.customTimers.setTimeout.call(void 0,(()=>{if("function"===typeof n){try{s(n())}catch(u){a(u)}return}const i="string"===typeof n?n:"Promise timed out after ".concat(r," milliseconds"),o=n instanceof Error?n:new t(i);"function"===typeof e.cancel&&e.cancel(),a(o)}),r),(async()=>{try{s(await e)}catch(t){a(t)}finally{i.customTimers.clearTimeout.call(void 0,o)}})()):s(e)}));return s.clear=()=>{clearTimeout(o),o=void 0},s};e.exports=r,e.exports.default=r,e.exports.TimeoutError=t},33764:e=>{"use strict";const t=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new Promise((t=>{t(e(...r))}))};e.exports=t,e.exports.default=t},96732:(e,t,r)=>{"use strict";const{CID:n}=r(91759),i=r(36206),o=r(29936),s=r(59376),a=r(86443),{base58btc:u}=r(59376),{base32:c}=r(36206),{base16:h}=r(9092),l=r(27893),f=r(13328),d=r(93077),{PeerIdProto:p}=r(20730),{equals:y}=r(34569),{fromString:g}=r(29285),{toString:m}=r(32995),{identity:b}=r(4991),v={...i,...o,...s,...a},w=Object.keys(v).reduce(((e,t)=>e.or(v[t])),c.decoder);const _=d(class{constructor(e,t,r){if(!(e instanceof Uint8Array))throw new Error("invalid id provided");if(t&&r&&!y(t.public.bytes,r.bytes))throw new Error("inconsistent arguments");this._id=e,this._idB58String=u.encode(this.id).substring(1),this._privKey=t,this._pubKey=r}get id(){return this._id}set id(e){throw new Error("Id is immutable")}get privKey(){return this._privKey}set privKey(e){this._privKey=e}get pubKey(){if(this._pubKey)return this._pubKey;if(this._privKey)return this._privKey.public;try{const e=l.decode(this.id);e.code===b.code&&(this._pubKey=f.unmarshalPublicKey(e.digest))}catch(e){}return this._pubKey}set pubKey(e){this._pubKey=e}marshalPubKey(){if(this.pubKey)return f.marshalPublicKey(this.pubKey)}marshalPrivKey(){if(this.privKey)return f.marshalPrivateKey(this.privKey)}marshal(e){return p.encode({id:this.toBytes(),pubKey:this.marshalPubKey(),privKey:e?null:this.marshalPrivKey()}).finish()}toPrint(){let e=this.toB58String();e.startsWith("Qm")&&(e=e.slice(2));let t=6;return e.length<t&&(t=e.length),"<peer.ID "+e.substr(0,t)+">"}toJSON(){return{id:this.toB58String(),privKey:A(this.marshalPrivKey()),pubKey:A(this.marshalPubKey())}}toHexString(){return h.encode(this.id).substring(1)}toBytes(){return this.id}toB58String(){return this._idB58String}toString(){if(!this._idCIDString){const e=n.createV1(114,l.decode(this.id));Object.defineProperty(this,"_idCIDString",{value:e.toString(),enumerable:!1})}return this._idCIDString}equals(e){if(e instanceof Uint8Array)return y(this.id,e);if(e.id)return y(this.id,e.id);throw new Error("not valid Id")}isEqual(e){return this.equals(e)}isValid(){return Boolean(this.privKey&&this.privKey.public&&this.privKey.public.bytes&&this.pubKey.bytes instanceof Uint8Array&&y(this.privKey.public.bytes,this.pubKey.bytes))}hasInlinePublicKey(){try{if(l.decode(this.id).code===b.code)return!0}catch(e){}return!1}},{className:"PeerId",symbolName:"@libp2p/js-peer-id/PeerId"});t=e.exports=_;const E=e=>e.bytes.length<=42?l.create(b.code,e.bytes).bytes:e.hash(),S=async(e,t)=>{const r=await E(t);return new _(r,e,t)};t.create=async e=>{(e=e||{}).bits=e.bits||2048,e.keyType=e.keyType||"RSA";const t=await f.generateKeyPair(e.keyType,e.bits);return S(t,t.public)},t.createFromHexString=e=>new _(h.decode("f"+e)),t.createFromBytes=e=>{try{const r=n.decode(e);if(!M(r))throw new Error("Supplied PeerID CID is invalid");return t.createFromCID(r)}catch{if(l.decode(e).code!==b.code)throw new Error("Supplied PeerID CID is invalid");return new _(e)}},t.createFromB58String=e=>t.createFromBytes(u.decode("z"+e));const M=e=>114===e.code||112===e.code;function A(e){if(e)return m(e,"base64pad")}t.createFromCID=e=>{if(!(e=n.asCID(e))||!M(e))throw new Error("Supplied PeerID CID is invalid");return new _(e.multihash.bytes)},t.createFromPubKey=async e=>{let t=e;if("string"===typeof t&&(t=g(e,"base64pad")),!(t instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");const r=await f.unmarshalPublicKey(t);return S(void 0,r)},t.createFromPrivKey=async e=>{if("string"===typeof e&&(e=g(e,"base64pad")),!(e instanceof Uint8Array))throw new Error("Supplied key is neither a base64 string nor a Uint8Array");const t=await f.unmarshalPrivateKey(e);return S(t,t.public)},t.createFromJSON=async e=>{const t=u.decode("z"+e.id),r=e.privKey&&g(e.privKey,"base64pad"),n=e.pubKey&&g(e.pubKey,"base64pad"),i=n&&await f.unmarshalPublicKey(n);if(!r)return new _(t,void 0,i);const o=await f.unmarshalPrivateKey(r),s=await E(o.public);let a;if(i&&(a=await E(i)),i&&!y(s,a))throw new Error("Public and private key do not match");if(t&&!y(s,t))throw new Error("Id and private key do not match");return new _(t,o,i)},t.createFromProtobuf=async e=>{"string"===typeof e&&(e=g(e,"base16"));let t,r,{id:n,privKey:i,pubKey:o}=p.decode(e);if(i=!!i&&await f.unmarshalPrivateKey(i),o=!!o&&await f.unmarshalPublicKey(o),i&&(r=await E(i.public)),o&&(t=await E(o)),i){if(o&&!y(r,t))throw new Error("Public and private key do not match");return new _(r,i,i.public)}if(o)return new _(t,void 0,o);if(n)return new _(n);throw new Error("Protobuf did not contain any usable key material")},t.parse=e=>("1"!==e.charAt(0)&&"Q"!==e.charAt(0)||(e="z".concat(e)),t.createFromBytes(w.decode(e))),t.isPeerId=e=>Boolean("object"===typeof e&&e._id&&e._idB58String)},20730:(e,t,r)=>{"use strict";var n=r(6018),i=n.Reader,o=n.Writer,s=n.util,a=n.roots["libp2p-peer-id"]||(n.roots["libp2p-peer-id"]={});a.PeerIdProto=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.id=s.newBuffer([]),e.prototype.pubKey=s.newBuffer([]),e.prototype.privKey=s.newBuffer([]),e.encode=function(e,t){return t||(t=o.create()),t.uint32(10).bytes(e.id),null!=e.pubKey&&Object.hasOwnProperty.call(e,"pubKey")&&t.uint32(18).bytes(e.pubKey),null!=e.privKey&&Object.hasOwnProperty.call(e,"privKey")&&t.uint32(26).bytes(e.privKey),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new a.PeerIdProto;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.id=e.bytes();break;case 2:n.pubKey=e.bytes();break;case 3:n.privKey=e.bytes();break;default:e.skipType(7&o)}}if(!n.hasOwnProperty("id"))throw s.ProtocolError("missing required 'id'",{instance:n});return n},e.fromObject=function(e){if(e instanceof a.PeerIdProto)return e;var t=new a.PeerIdProto;return null!=e.id&&("string"===typeof e.id?s.base64.decode(e.id,t.id=s.newBuffer(s.base64.length(e.id)),0):e.id.length&&(t.id=e.id)),null!=e.pubKey&&("string"===typeof e.pubKey?s.base64.decode(e.pubKey,t.pubKey=s.newBuffer(s.base64.length(e.pubKey)),0):e.pubKey.length&&(t.pubKey=e.pubKey)),null!=e.privKey&&("string"===typeof e.privKey?s.base64.decode(e.privKey,t.privKey=s.newBuffer(s.base64.length(e.privKey)),0):e.privKey.length&&(t.privKey=e.privKey)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(t.bytes===String?r.id="":(r.id=[],t.bytes!==Array&&(r.id=s.newBuffer(r.id))),t.bytes===String?r.pubKey="":(r.pubKey=[],t.bytes!==Array&&(r.pubKey=s.newBuffer(r.pubKey))),t.bytes===String?r.privKey="":(r.privKey=[],t.bytes!==Array&&(r.privKey=s.newBuffer(r.privKey)))),null!=e.id&&e.hasOwnProperty("id")&&(r.id=t.bytes===String?s.base64.encode(e.id,0,e.id.length):t.bytes===Array?Array.prototype.slice.call(e.id):e.id),null!=e.pubKey&&e.hasOwnProperty("pubKey")&&(r.pubKey=t.bytes===String?s.base64.encode(e.pubKey,0,e.pubKey.length):t.bytes===Array?Array.prototype.slice.call(e.pubKey):e.pubKey),null!=e.privKey&&e.hasOwnProperty("privKey")&&(r.privKey=t.bytes===String?s.base64.encode(e.privKey,0,e.privKey.length):t.bytes===Array?Array.prototype.slice.call(e.privKey):e.privKey),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e}(),e.exports=a},98072:(e,t,r)=>{"use strict";e.exports=r(47553)},47553:(e,t,r)=>{const n=r(14971).Netmask,i=r(51362),o=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"].map((e=>new n(e)));e.exports=e=>i.v6().test(e)?function(e){return/^::$/.test(e)||/^::1$/.test(e)||/^::f{4}:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(e)||/^::f{4}:0.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(e)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(e)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(e)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(e)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(e)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(e)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(e)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(e)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(e)||/^ff([0-9a-fA-F]{2,2}):/i.test(e)}(e):!(!i().test(e)&&!e.startsWith("0"))&&function(e){for(let t of o)if(t.contains(e))return!0;return!1}(e)},21964:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"===typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"===typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,h=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):h=-1,u.length&&f())}function f(){if(!c){var e=s(l);c=!0;for(var t=u.length;t;){for(a=u,u=[];++h<t;)a&&a[h].run();h=-1,t=u.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||c||s(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},6018:(e,t,r)=>{"use strict";e.exports=r(76430)},76430:(e,t,r)=>{"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(24416),n.BufferWriter=r(25576),n.Reader=r(50319),n.BufferReader=r(5991),n.util=r(53490),n.rpc=r(30903),n.roots=r(239),n.configure=i,i()},50319:(e,t,r)=>{"use strict";e.exports=u;var n,i=r(53490),o=i.LongBits,s=i.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c="undefined"!==typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},h=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new n(e):c(e)})(e)}:c};function l(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw a(this,8);return new o(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}u.create=h(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return e}}(),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return f(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},u.prototype.skip=function(e){if("number"===typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!==(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){n=e,u.create=h(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return l.call(this)[t](!1)},uint64:function(){return l.call(this)[t](!0)},sint64:function(){return l.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},5991:(e,t,r)=>{"use strict";e.exports=o;var n=r(50319);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(53490);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},239:e=>{"use strict";e.exports={}},30903:(e,t,r)=>{"use strict";t.Service=r(23754)},23754:(e,t,r)=>{"use strict";e.exports=i;var n=r(53490);function i(e,t,r){if("function"!==typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,s){if(!o)throw TypeError("request must be specified");var a=this;if(!s)return n.asPromise(e,a,t,r,i,o);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof i))try{r=i[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(u){return a.emit("error",u,t),void setTimeout((function(){s(u)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},88508:(e,t,r)=>{"use strict";e.exports=i;var n=r(53490);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"===typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===s?o:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},53490:function(e,t,r){"use strict";var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function o(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}n.asPromise=r(32308),n.base64=r(36227),n.EventEmitter=r(38001),n.float=r(98572),n.inquire=r(49329),n.utf8=r(41122),n.pool=r(42338),n.LongBits=r(88508),n.isNode=Boolean("undefined"!==typeof r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!==typeof window&&window||"undefined"!==typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"===typeof e||e instanceof String},n.isObject=function(e){return e&&"object"===typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!==typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(t){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"===typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"===typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!==typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},24416:(e,t,r)=>{"use strict";e.exports=l;var n,i=r(53490),o=i.LongBits,s=i.base64,a=i.utf8;function u(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function c(){}function h(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(l.create=function(){return new n})()}:function(){return new l}};function d(e,t,r){t[r]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=f(),l.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(l.alloc=i.pool(l.alloc,i.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(y,10,o.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=o.from(e);return this._push(y,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(y,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=o.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var m=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var r=l.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(m,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new u(c,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(e){n=e,l.create=f(),n._configure()}},25576:(e,t,r)=>{"use strict";e.exports=o;var n=r(24416);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(53490);function o(){n.call(this)}function s(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},o._configure()},1441:(e,t,r)=>{"use strict";e.exports=s;var n=r(18173),i=s.prototype,o=new Date%1e9;function s(e){e=e||{},this.id=e.id||(1e9*Math.random()>>>0)+o++,this.max=e.max||1/0,this.items=e.items||[],this._lookup={},this.size=this.items.length,this.lastModified=new Date(e.lastModified||new Date);for(var t,r,n=this.items.length;n--;)t=this.items[n],r=new Date(t.expires)-new Date,this._lookup[t.key]=t,r>0?this.expire(t.key,r):r<=0&&this.delete(t.key)}i.has=function(e){return e in this._lookup},i.get=function(e){if(!this.has(e))return null;var t=this._lookup[e];return t.refresh&&this.expire(e,t.refresh),this.items.splice(this.items.indexOf(t),1),this.items.push(t),t.value},i.meta=function(e){if(!this.has(e))return null;var t=this._lookup[e];return"meta"in t?t.meta:null},i.set=function(e,t,r){var n=this._lookup[e],i=this._lookup[e]={key:e,value:t};return this.lastModified=new Date,n?(clearTimeout(n.timeout),this.items.splice(this.items.indexOf(n),1,i)):(this.size>=this.max&&this.delete(this.items[0].key),this.items.push(i),this.size++),r&&("ttl"in r&&this.expire(e,r.ttl),"meta"in r&&(i.meta=r.meta),r.refresh&&(i.refresh=r.ttl)),this},i.delete=function(e){var t=this._lookup[e];return!!t&&(this.lastModified=new Date,this.items.splice(this.items.indexOf(t),1),clearTimeout(t.timeout),delete this._lookup[e],this.size--,this)},i.expire=function(e,t){var r=t||0,i=this._lookup[e];if(!i)return this;if("string"===typeof r&&(r=n(t)),"number"!==typeof r)throw new TypeError("Expiration time must be a string or number.");return clearTimeout(i.timeout),i.timeout=setTimeout(this.delete.bind(this,i.key),r),i.expires=Number(new Date)+r,this},i.clear=function(){for(var e=this.items.length;e--;)this.delete(this.items[e].key);return this},i.toJSON=function(){for(var e,t=new Array(this.items.length),r=t.length;r--;)e=this.items[r],t[r]={key:e.key,meta:e.meta,value:e.value,expires:e.expires,refresh:e.refresh};return{id:this.id,max:isFinite(this.max)?this.max:void 0,lastModified:this.lastModified,items:t}}},79881:(e,t,r)=>{"use strict";const n=r(41635);class i{constructor(e,t,r){const i=this;this._started=n(),this._rescheduled=0,this._scheduled=t,this._args=r,this._triggered=!1,this._timerWrapper=()=>{i._rescheduled>0?(i._scheduled=i._rescheduled-(n()-i._started),i._schedule(i._scheduled)):(i._triggered=!0,e.apply(null,i._args))},this._timer=setTimeout(this._timerWrapper,t)}reschedule(e){e||(e=this._scheduled);const t=n();t+e-(this._started+this._scheduled)<0?(clearTimeout(this._timer),this._schedule(e)):this._triggered?this._schedule(e):(this._started=t,this._rescheduled=e)}_schedule(e){this._triggered=!1,this._started=n(),this._rescheduled=0,this._scheduled=e,this._timer=setTimeout(this._timerWrapper,e)}clear(){clearTimeout(this._timer)}}e.exports=function(){if("function"!==typeof arguments[0])throw new Error("callback needed");if("number"!==typeof arguments[1])throw new Error("timeout needed");let e;if(arguments.length>0){e=new Array(arguments.length-2);for(var t=0;t<e.length;t++)e[t]=arguments[t+2]}return new i(arguments[0],arguments[1],e)}},41635:e=>{"use strict";e.exports=function(){return Date.now()}},47702:(e,t,r)=>{e.exports=r(96246)},96246:(e,t,r)=>{var n=r(48889);t.operation=function(e){var r=t.timeouts(e);return new n(r,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<t.retries;i++)n.push(this.createTimeout(i,t));return e&&e.forever&&!n.length&&n.push(this.createTimeout(i,t)),n.sort((function(e,t){return e-t})),n},t.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,n=Math.round(r*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return n=Math.min(n,t.maxTimeout)},t.wrap=function(e,r,n){if(r instanceof Array&&(n=r,r=null),!n)for(var i in n=[],e)"function"===typeof e[i]&&n.push(i);for(var o=0;o<n.length;o++){var s=n[o],a=e[s];e[s]=function(n){var i=t.operation(r),o=Array.prototype.slice.call(arguments,1),s=o.pop();o.push((function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),s.apply(this,arguments))})),i.attempt((function(){n.apply(e,o)}))}.bind(e,a),e[s].options=r}}},48889:e=>{function t(e,t){"boolean"===typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1)}var n=this;return this._timer=setTimeout((function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout((function(){n._operationTimeoutCb(n._attempts)}),n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)}),r),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){r._operationTimeoutCb()}),r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(e[o]||0)+1;e[o]=s,s>=r&&(t=i,r=s)}return t}},37950:function(e,t,r){"use strict";var n=r(29536).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getLength=t.decode=t.encode=void 0;var o=i(r(33518));function s(e,t){if("0"===e[0]&&"0"===e[1])throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function a(e,t){if(e<56)return n.from([e+t]);var r=h(e),i=h(t+55+r.length/2);return n.from(i+r,"hex")}function u(e){var t,r,i,o,a,c=[],h=e[0];if(h<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(h<=183){if(t=h-127,i=128===h?n.from([]):e.slice(1,t),2===t&&i[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:i,remainder:e.slice(t)}}if(h<=191){if(r=h-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if((t=s(e.slice(1,r).toString("hex"),16))<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if((i=e.slice(r,t+r)).length<t)throw new Error("invalid RLP: not enough bytes for string");return{data:i,remainder:e.slice(t+r)}}if(h<=247){for(t=h-191,o=e.slice(1,t);o.length;)a=u(o),c.push(a.data),o=a.remainder;return{data:c,remainder:e.slice(t)}}var l=(r=h-246)+(t=s(e.slice(1,r).toString("hex"),16));if(l>e.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(o=e.slice(r,l)).length)throw new Error("invalid rlp, List has a invalid length");for(;o.length;)a=u(o),c.push(a.data),o=a.remainder;return{data:c,remainder:e.slice(l)}}function c(e){return"0x"===e.slice(0,2)}function h(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function l(e){if(!n.isBuffer(e)){if("string"===typeof e)return c(e)?n.from((t="string"!==typeof(r=e)?r:c(r)?r.slice(2):r).length%2?"0"+t:t,"hex"):n.from(e);if("number"===typeof e||"bigint"===typeof e)return e?function(e){var t=h(e);return n.from(t,"hex")}(e):n.from([]);if(null===e||void 0===e)return n.from([]);if(e instanceof Uint8Array)return n.from(e);if(o.default.isBN(e))return n.from(e.toArray());throw new Error("invalid type")}var t,r;return e}t.encode=function e(t){if(Array.isArray(t)){for(var r=[],i=0;i<t.length;i++)r.push(e(t[i]));var o=n.concat(r);return n.concat([a(o.length,192),o])}var s=l(t);return 1===s.length&&s[0]<128?s:n.concat([a(s.length,128),s])},t.decode=function(e,t){if(void 0===t&&(t=!1),!e||0===e.length)return n.from([]);var r=u(l(e));if(t)return r;if(0!==r.remainder.length)throw new Error("invalid remainder");return r.data},t.getLength=function(e){if(!e||0===e.length)return n.from([]);var t=l(e),r=t[0];if(r<=127)return t.length;if(r<=183)return r-127;if(r<=191)return r-182;if(r<=247)return r-191;var i=r-246;return i+s(t.slice(1,i).toString("hex"),16)}},33518:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(72464).Buffer}catch(T){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),u=t;u<a;u++){var c=e.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=c(e,h,h+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(e,h,e.length,t),h=0;h<s;h++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){h(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(T){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],h=p[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var y=l.modrn(h).toString(e);r=(l=l.idivn(h)).isZero()?y+r:f[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var h=u>>>26,l=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;h+=(s=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|h}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,h=0|s[0],l=8191&h,f=h>>>13,d=0|s[1],p=8191&d,y=d>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,M=E>>>13,A=0|s[5],I=8191&A,k=A>>>13,T=0|s[6],R=8191&T,P=T>>>13,C=0|s[7],O=8191&C,x=C>>>13,B=0|s[8],D=8191&B,N=B>>>13,L=0|s[9],K=8191&L,U=L>>>13,j=0|a[0],q=8191&j,F=j>>>13,z=0|a[1],V=8191&z,H=z>>>13,G=0|a[2],W=8191&G,Y=G>>>13,Z=0|a[3],X=8191&Z,J=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,he=0|a[8],le=8191&he,fe=he>>>13,de=0|a[9],pe=8191&de,ye=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(y,q)|0,o=Math.imul(y,F);var me=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(b,q)|0,o=Math.imul(b,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0;var be=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0;var ve=(c+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0;var we=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,q),i=(i=Math.imul(I,F))+Math.imul(k,q)|0,o=Math.imul(k,F),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0;var _e=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,F))+Math.imul(P,q)|0,o=Math.imul(P,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Ee=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,F))+Math.imul(x,q)|0,o=Math.imul(x,F),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,H)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0;var Se=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),i=(i=Math.imul(D,F))+Math.imul(N,q)|0,o=Math.imul(N,F),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Me=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(K,q),i=(i=Math.imul(K,F))+Math.imul(U,q)|0,o=Math.imul(U,F),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,H)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,fe)|0;var Ae=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(K,V),i=(i=Math.imul(K,H))+Math.imul(U,V)|0,o=Math.imul(U,H),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,Y)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(K,W),i=(i=Math.imul(K,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(D,X)|0,i=(i=i+Math.imul(D,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,fe)|0;var ke=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(K,X),i=(i=Math.imul(K,J))+Math.imul(U,X)|0,o=Math.imul(U,J),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,fe)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(K,$),i=(i=Math.imul(K,ee))+Math.imul(U,$)|0,o=Math.imul(U,ee),n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,fe)|0;var Re=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ye)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(K,re),i=(i=Math.imul(K,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,fe)|0)+Math.imul(P,le)|0,o=o+Math.imul(P,fe)|0;var Pe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ye)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(K,oe),i=(i=Math.imul(K,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,fe)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,fe)|0;var Ce=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(K,ue),i=(i=Math.imul(K,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(N,le)|0,o=o+Math.imul(N,fe)|0;var Oe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ye)|0)+Math.imul(x,pe)|0))<<13)|0;c=((o=o+Math.imul(x,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(K,le),i=(i=Math.imul(K,fe))+Math.imul(U,le)|0,o=Math.imul(U,fe);var xe=(c+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Be=(c+(n=Math.imul(K,pe))|0)+((8191&(i=(i=Math.imul(K,ye))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ye))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,u[0]=ge,u[1]=me,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Se,u[8]=Me,u[9]=Ae,u[10]=Ie,u[11]=ke,u[12]=Te,u[13]=Re,u[14]=Pe,u[15]=Ce,u[16]=Oe,u[17]=xe,u[18]=Be,0!==c&&(u[19]=c,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var h=o-c,l=(0|e.words[h])*(0|t.words[c]),f=67108863&l;a=67108863&(f=f+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(e,t,r){return m(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(g=y),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?y(this,e,t):r<1024?m(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},v.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var l=u,f=c,d=0;d<s;d++){var p=r[h+d],y=n[h+d],g=r[h+d+s],m=n[h+d+s],b=l*g-f*m;m=l*m+f*g,g=b,r[h+d]=p+g,n[h+d]=y+m,r[h+d+s]=p-g,n[h+d+s]=y-m,d!==a&&(b=u*l-c*f,f=u*f+c*l,l=b)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},v.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0===(-8192&o))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),l=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,h,l,n,i);for(var d=0;d<n;d++){var p=a[d]*h[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*h[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"===typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<r;this.words[t]=u|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var h=0;for(c=this.length-1;c>=0&&(0!==h||c>=i);c--){var l=0|this.words[c];this.words[c]=h<<26-o|l>>>o,h=l&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=f)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!==(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),l=t.clone();!t.isZero();){for(var f=0,d=1;0===(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(l)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0===(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0===(t.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,f=1;0===(r.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(r.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(E,_),E.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},E.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(S,_),i(M,_),i(A,_),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new S;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},I.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(h(e,e.umod(this.m)._forceRed(this)),e)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(u);)h.redIAdd(u);for(var l=this.pow(h,i),f=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=s;0!==d.cmp(a);){for(var y=d,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(l,new o(1).iushln(p-g-1));f=f.redMul(m),l=m.redSqr(),d=d.redMul(l),p=g}return f},I.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},I.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],h=u-1;h>=0;h--){var l=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,I),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},13858:(e,t,r)=>{"use strict";var n=r(52940),i=/[\/\?<>\\:\*\|"]/g,o=/[\x00-\x1f\x80-\x9f]/g,s=/^\.+$/,a=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,u=/[\. ]+$/;function c(e,t){if("string"!==typeof e)throw new Error("Input must be string");var r=e.replace(i,t).replace(o,t).replace(s,t).replace(a,t).replace(u,t);return n(r,255)}e.exports=function(e,t){var r=t&&t.replacement||"",n=c(e,r);return""===r?n:c(n,"")}},44846:(e,t,r)=>{e.exports=r(12660)(r(90040))},90040:(e,t,r)=>{const n=new(0,r(67172).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function s(e){const t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){let r=new o(t);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let s=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===e!==s.isOdd()&&(s=s.redNeg()),n.keyPair({pub:{x:r,y:s}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){let s=new o(t),a=new o(r);if(s.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(s=s.toRed(i.red),a=a.toRed(i.red),(6===e||7===e)&&a.isOdd()!==(7===e))return null;const u=s.redSqr().redIMul(s);return a.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:a}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function a(e,t){const r=t.encode(null,33===e.length);for(let n=0;n<e.length;++n)e[n]=r[n]}e.exports={contextRandomize:()=>0,privateKeyVerify(e){const t=new o(e);return t.cmp(i.n)<0&&!t.isZero()?0:1},privateKeyNegate(e){const t=new o(e),r=i.n.sub(t).umod(i.n).toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakAdd(e,t){const r=new o(t);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(e)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},privateKeyTweakMul(e,t){let r=new o(t);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(e)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},publicKeyVerify:e=>null===s(e)?1:0,publicKeyCreate(e,t){const r=new o(t);if(r.cmp(i.n)>=0||r.isZero())return 1;return a(e,n.keyFromPrivate(t).getPublic()),0},publicKeyConvert(e,t){const r=s(t);if(null===r)return 1;return a(e,r.getPublic()),0},publicKeyNegate(e,t){const r=s(t);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),a(e,n),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let i=0;i<t.length;++i)if(r[i]=s(t[i]),null===r[i])return 1;let n=r[0].getPublic();for(let i=1;i<r.length;++i)n=n.add(r[i].pub);return n.isInfinity()?2:(a(e,n),0)},publicKeyTweakAdd(e,t,r){const n=s(t);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(a(e,u),0)},publicKeyTweakMul(e,t,r){const n=s(t);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0||r.isZero())return 2;return a(e,n.getPublic().mul(r)),0},signatureNormalize(e){const t=new o(e.subarray(0,32)),r=new o(e.subarray(32,64));return t.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&e.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const r=t.subarray(0,32),n=t.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:s}=e;let a=s.subarray(4,37);a[0]=0,a.set(r,1);let u=33,c=0;for(;u>1&&0===a[c]&&!(128&a[c+1]);--u,++c);if(a=a.subarray(c),128&a[0])return 1;if(u>1&&0===a[0]&&!(128&a[1]))return 1;let h=s.subarray(39,72);h[0]=0,h.set(n,1);let l=33,f=0;for(;l>1&&0===h[f]&&!(128&h[f+1]);--l,++f);return h=h.subarray(f),128&h[0]||l>1&&0===h[0]&&!(128&h[1])?1:(e.outputlen=6+u+l,s[0]=48,s[1]=e.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+u]=2,s[5+u]=h.length,s.set(h,6+u),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const r=t[3];if(0===r)return 1;if(5+r>=t.length)return 1;if(2!==t[4+r])return 1;const n=t[5+r];if(0===n)return 1;if(6+r+n!==t.length)return 1;if(128&t[4])return 1;if(r>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[r+6])return 1;if(n>1&&0===t[r+6]&&!(128&t[r+7]))return 1;let s=t.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=t.subarray(6+r);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let u=new o(s);u.cmp(i.n)>=0&&(u=new o(0));let c=new o(t.subarray(6+r));return c.cmp(i.n)>=0&&(c=new o(0)),e.set(u.toArrayLike(Uint8Array,"be",32),0),e.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,s,a){if(a){const e=a;a=n=>{const i=e(t,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let c;try{c=n.sign(t,r,{canonical:!0,k:a,pers:s})}catch(h){return 1}return e.signature.set(c.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(c.s.toArrayLike(Uint8Array,"be",32),32),e.recid=c.recoveryParam,0},ecdsaVerify(e,t,r){const a={r:e.subarray(0,32),s:e.subarray(32,64)},u=new o(a.r),c=new o(a.s);if(u.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(1===c.cmp(n.nh)||u.isZero()||c.isZero())return 3;const h=s(r);if(null===h)return 2;const l=h.getPublic();return n.verify(t,a,l)?0:3},ecdsaRecover(e,t,r,s){const u={r:t.slice(0,32),s:t.slice(32,64)},c=new o(u.r),h=new o(u.s);if(c.cmp(i.n)>=0||h.cmp(i.n)>=0)return 1;if(c.isZero()||h.isZero())return 2;let l;try{l=n.recoverPubKey(s,u,r)}catch(f){return 2}return a(e,l),0},ecdh(e,t,r,a,u,c,h){const l=s(t);if(null===l)return 1;const f=new o(r);if(f.cmp(i.n)>=0||f.isZero())return 2;const d=l.getPublic().mul(f);if(void 0===u){const t=d.encode(null,!0),r=n.hash().update(t).digest();for(let n=0;n<32;++n)e[n]=r[n]}else{c||(c=new Uint8Array(32));const t=d.getX().toArray("be",32);for(let e=0;e<32;++e)c[e]=t[e];h||(h=new Uint8Array(32));const r=d.getY().toArray("be",32);for(let e=0;e<32;++e)h[e]=r[e];const n=u(c,h,a);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}}},12660:e=>{const t="Impossible case. Please create issue.",r="The tweak was out of range or the resulted private key is invalid",n="The tweak was out of range or equal to zero",i="Unknow error on context randomization",o="Private Key is invalid",s="Public Key could not be parsed",a="Public Key serialization error",u="The sum of the public keys is not valid",c="Signature could not be parsed",h="The nonce generation function failed, or the private key was invalid",l="Public key could not be recover",f="Scalar was invalid (zero or overflow)";function d(e,t){if(!e)throw new Error(t)}function p(e,t,r){if(d(t instanceof Uint8Array,"Expected ".concat(e," to be an Uint8Array")),void 0!==r)if(Array.isArray(r)){const n=r.join(", "),i="Expected ".concat(e," to be an Uint8Array with length [").concat(n,"]");d(r.includes(t.length),i)}else{const n="Expected ".concat(e," to be an Uint8Array with length ").concat(r);d(t.length===r,n)}}function y(e){d("Boolean"===m(e),"Expected compressed to be a Boolean")}function g(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>new Uint8Array(e),t=arguments.length>1?arguments[1]:void 0;return"function"===typeof e&&(e=e(t)),p("output",e,t),e}function m(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=e=>({contextRandomize(t){if(d(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&p("seed",t,32),1===e.contextRandomize(t))throw new Error(i)},privateKeyVerify:t=>(p("private key",t,32),0===e.privateKeyVerify(t)),privateKeyNegate(r){switch(p("private key",r,32),e.privateKeyNegate(r)){case 0:return r;case 1:throw new Error(t)}},privateKeyTweakAdd(t,n){switch(p("private key",t,32),p("tweak",n,32),e.privateKeyTweakAdd(t,n)){case 0:return t;case 1:throw new Error(r)}},privateKeyTweakMul(t,r){switch(p("private key",t,32),p("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(n)}},publicKeyVerify:t=>(p("public key",t,[33,65]),0===e.publicKeyVerify(t)),publicKeyCreate(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(p("private key",t,32),y(r),n=g(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(a)}},publicKeyConvert(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(p("public key",t,[33,65]),y(r),n=g(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(a)}},publicKeyNegate(r){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;switch(p("public key",r,[33,65]),y(n),i=g(i,n?33:65),e.publicKeyNegate(i,r)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(t);case 3:throw new Error(a)}},publicKeyCombine(t){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;d(Array.isArray(t),"Expected public keys to be an Array"),d(t.length>0,"Expected public keys array will have more than zero items");for(const e of t)p("public key",e,[33,65]);switch(y(r),n=g(n,r?33:65),e.publicKeyCombine(n,t)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(u);case 3:throw new Error(a)}},publicKeyTweakAdd(t,n){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0;switch(p("public key",t,[33,65]),p("tweak",n,32),y(i),o=g(o,i?33:65),e.publicKeyTweakAdd(o,t,n)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(r)}},publicKeyTweakMul(t,r){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0;switch(p("public key",t,[33,65]),p("tweak",r,32),y(i),o=g(o,i?33:65),e.publicKeyTweakMul(o,t,r)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(n)}},signatureNormalize(t){switch(p("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(c)}},signatureExport(r,n){p("signature",r,64);const i={output:n=g(n,72),outputlen:72};switch(e.signatureExport(i,r)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(c);case 2:throw new Error(t)}},signatureImport(r,n){switch(p("signature",r),n=g(n,64),e.signatureImport(n,r)){case 0:return n;case 1:throw new Error(c);case 2:throw new Error(t)}},ecdsaSign(r,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;p("message",r,32),p("private key",n,32),d("Object"===m(i),"Expected options to be an Object"),void 0!==i.data&&p("options.data",i.data),void 0!==i.noncefn&&d("Function"===m(i.noncefn),"Expected options.noncefn to be a Function"),o=g(o,64);const s={signature:o,recid:null};switch(e.ecdsaSign(s,r,n,i.data,i.noncefn)){case 0:return s;case 1:throw new Error(h);case 2:throw new Error(t)}},ecdsaVerify(t,r,n){switch(p("signature",t,64),p("message",r,32),p("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(c);case 2:throw new Error(s)}},ecdsaRecover(r,n,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4?arguments[4]:void 0;switch(p("signature",r,64),d("Number"===m(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),p("message",i,32),y(o),s=g(s,o?33:65),e.ecdsaRecover(s,r,n,i)){case 0:return s;case 1:throw new Error(c);case 2:throw new Error(l);case 3:throw new Error(t)}},ecdh(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;switch(p("public key",t,[33,65]),p("private key",r,32),d("Object"===m(n),"Expected options to be an Object"),void 0!==n.data&&p("options.data",n.data),void 0!==n.hashfn?(d("Function"===m(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&p("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&p("options.ybuf",n.ybuf,32),p("output",i)):i=g(i,32),e.ecdh(i,t,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(f)}}})},22798:e=>{"use strict";const t=new Map;e.exports={setDelayedInterval:function(e,r,n){n=n||r;const i="".concat(Date.now(),":").concat(Math.floor(1e6*Math.random())),o=setTimeout((()=>{!async function(e,r,n){for(;t.get(n);){try{await e()}catch(i){setTimeout((()=>{throw i}),1);break}if(!t.get(n))break;await new Promise((e=>{const i=setTimeout(e,r);t.set(n,i)}))}}(e,r,i)}),n);return t.set(i,o),i},clearDelayedInterval:function(e){const r=t.get(e);r&&(clearTimeout(r),t.delete(e))}}},38976:(e,t,r)=>{"use strict";const n=r(46787);e.exports=function e(t){if(!(this instanceof e))return new e(t);const r=(t=t||{}).validity||30,i=new Map,o=n((()=>{i.forEach(((e,t)=>{const n=e.validity||r;(function(e){const t=(new Date).getTime()-e.getTime();return Math.floor(t/1e3)})(e.timestamp)>n&&i.delete(t)}))}),200);this.put=(e,t,r)=>{this.has(e)||i.set(e,{value:t,timestamp:new Date,validity:r}),o()},this.get=e=>{if(i.has(e))return i.get(e).value;throw new Error("key does not exist")},this.has=e=>i.has(e)}},80702:(e,t,r)=>{"use strict";const{AbortController:n}="undefined"!==typeof self?self:"undefined"!==typeof window?window:r(90834),i=r(78687);class o extends n{constructor(e){super(),this._ms=e,this._timer=i((()=>this.abort()),e),Object.setPrototypeOf(this,o.prototype)}abort(){return this._timer.clear(),super.abort()}clear(){this._timer.clear()}reset(){this._timer.clear(),this._timer=i((()=>this.abort()),this._ms)}}e.exports=o,e.exports.TimeoutController=o},78687:(e,t,r)=>{"use strict";var n=r(97607);function i(e,t,r){var i=this;this._started=n(),this._rescheduled=0,this._scheduled=t,this._args=r,this._timer=setTimeout((function t(){i._rescheduled>0?(i._scheduled=i._rescheduled-(n()-i._started),i._timer=setTimeout(t,i._scheduled),i._rescheduled=0):e.apply(null,i._args)}),t)}i.prototype.reschedule=function(e){var t=n();return!(t+e-(this._started+this._scheduled)<0)&&(this._started=t,this._rescheduled=e,!0)},i.prototype.clear=function(){clearTimeout(this._timer)},e.exports=function(){if("function"!==typeof arguments[0])throw new Error("callback needed");if("number"!==typeof arguments[1])throw new Error("timeout needed");var e;if(arguments.length>0){e=new Array(arguments.length-2);for(var t=0;t<e.length;t++)e[t]=arguments[t+2]}return new i(arguments[0],arguments[1],e)}},97607:e=>{"use strict";e.exports=function(){return Date.now()}},52940:(e,t,r)=>{"use strict";var n=r(59675),i=r(41590);e.exports=n.bind(null,i)},59675:e=>{"use strict";function t(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}e.exports=function(e,n,i){if("string"!==typeof n)throw new Error("Input must be string");for(var o,s,a=n.length,u=0,c=0;c<a;c+=1){if(o=n.charCodeAt(c),s=n[c],t(o)&&r(n.charCodeAt(c+1))&&(s+=n[c+=1]),(u+=e(s))===i)return n.slice(0,c+1);if(u>i)return n.slice(0,c-s.length+1)}return n}},6113:(e,t,r)=>{"use strict";const{encoding:n}=r(99149),i=new TextEncoder;function o(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";return"utf8"===t||"utf-8"===t?i.encode(e):"ascii"===t?o(e):n(t).decode(e)}},94670:(e,t,r)=>{"use strict";const{encoding:n}=r(99149),i=new TextDecoder("utf8");function o(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}e.exports=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";return"utf8"===t||"utf-8"===t?i.decode(e):"ascii"===t?o(e):n(t).encode(e)}},41590:e=>{"use strict";function t(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}e.exports=function(e){if("string"!==typeof e)throw new Error("Input must be string");for(var n=e.length,i=0,o=null,s=null,a=0;a<n;a++)r(o=e.charCodeAt(a))?null!=s&&t(s)?i+=1:i+=3:o<=127?i+=1:o>=128&&o<=2047?i+=2:o>=2048&&o<=65535&&(i+=3),s=o;return i}},2579:e=>{e.exports=function(e){return e&&"object"===typeof e&&"function"===typeof e.copy&&"function"===typeof e.fill&&"function"===typeof e.readUInt8}},49075:(e,t,r)=>{"use strict";var n=r(18348),i=r(51403),o=r(25182),s=r(85313);function a(e){return e.call.bind(e)}var u="undefined"!==typeof BigInt,c="undefined"!==typeof Symbol,h=a(Object.prototype.toString),l=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(u)var p=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(e,t){if("object"!==typeof e)return!1;try{return t(e),!0}catch(r){return!1}}function m(e){return"[object Map]"===h(e)}function b(e){return"[object Set]"===h(e)}function v(e){return"[object WeakMap]"===h(e)}function w(e){return"[object WeakSet]"===h(e)}function _(e){return"[object ArrayBuffer]"===h(e)}function E(e){return"undefined"!==typeof ArrayBuffer&&(_.working?_(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===h(e)}function M(e){return"undefined"!==typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!==typeof Promise&&e instanceof Promise||null!==e&&"object"===typeof e&&"function"===typeof e.then&&"function"===typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||M(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},m.working="undefined"!==typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!==typeof Map&&(m.working?m(e):e instanceof Map)},b.working="undefined"!==typeof Set&&b(new Set),t.isSet=function(e){return"undefined"!==typeof Set&&(b.working?b(e):e instanceof Set)},v.working="undefined"!==typeof WeakMap&&v(new WeakMap),t.isWeakMap=function(e){return"undefined"!==typeof WeakMap&&(v.working?v(e):e instanceof WeakMap)},w.working="undefined"!==typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},_.working="undefined"!==typeof ArrayBuffer&&_(new ArrayBuffer),t.isArrayBuffer=E,S.working="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=M;var A="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function I(e){return"[object SharedArrayBuffer]"===h(e)}function k(e){return"undefined"!==typeof A&&("undefined"===typeof I.working&&(I.working=I(new A)),I.working?I(e):e instanceof A)}function T(e){return g(e,l)}function R(e){return g(e,f)}function P(e){return g(e,d)}function C(e){return u&&g(e,p)}function O(e){return c&&g(e,y)}t.isSharedArrayBuffer=k,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===h(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===h(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===h(e)},t.isGeneratorObject=function(e){return"[object Generator]"===h(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===h(e)},t.isNumberObject=T,t.isStringObject=R,t.isBooleanObject=P,t.isBigIntObject=C,t.isSymbolObject=O,t.isBoxedPrimitive=function(e){return T(e)||R(e)||P(e)||C(e)||O(e)},t.isAnyArrayBuffer=function(e){return"undefined"!==typeof Uint8Array&&(E(e)||k(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},40272:(e,t,r)=>{var n=r(21964),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},o=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(c(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(e).replace(o,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}})),a=n[r];r<i;a=n[++r])m(a)||!E(a)?s+=" "+a:s+=" "+c(a);return s},t.deprecate=function(e,r){if("undefined"!==typeof n&&!0===n.noDeprecation)return e;if("undefined"===typeof n)return function(){return t.deprecate(e,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}};var s={},a=/^$/;if({NODE_ENV:"production",PUBLIC_URL:"/js-waku",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG){var u={NODE_ENV:"production",PUBLIC_URL:"/js-waku",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+u+"$","i")}function c(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),f(n,e,n.depth)}function h(e,t){var r=c.styles[t];return r?"\x1b["+c.colors[r][0]+"m"+e+"\x1b["+c.colors[r][1]+"m":e}function l(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return v(i)||(i=f(e,i,n)),i}var o=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(b(t))return e.stylize(""+t,"number");if(g(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),M(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return d(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return e.stylize(Date.prototype.toString.call(r),"date");if(M(r))return d(r)}var c,h="",l=!1,E=["{","}"];(y(r)&&(l=!0,E=["[","]"]),A(r))&&(h=" [Function"+(r.name?": "+r.name:"")+"]");return _(r)&&(h=" "+RegExp.prototype.toString.call(r)),S(r)&&(h=" "+Date.prototype.toUTCString.call(r)),M(r)&&(h=" "+d(r)),0!==s.length||l&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=l?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)P(t,String(s))?o.push(p(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(p(e,t,r,n,i,!0))})),o}(e,r,n,a,s):s.map((function(t){return p(e,r,n,a,t,l)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,h,E)):E[0]+h+E[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),P(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=m(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function y(e){return Array.isArray(e)}function g(e){return"boolean"===typeof e}function m(e){return null===e}function b(e){return"number"===typeof e}function v(e){return"string"===typeof e}function w(e){return void 0===e}function _(e){return E(e)&&"[object RegExp]"===I(e)}function E(e){return"object"===typeof e&&null!==e}function S(e){return E(e)&&"[object Date]"===I(e)}function M(e){return E(e)&&("[object Error]"===I(e)||e instanceof Error)}function A(e){return"function"===typeof e}function I(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(a.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(49075),t.isArray=y,t.isBoolean=g,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=v,t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=w,t.isRegExp=_,t.types.isRegExp=_,t.isObject=E,t.isDate=S,t.types.isDate=S,t.isError=M,t.types.isNativeError=M,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=r(2579);var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var e=new Date,t=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":");return[e.getDate(),T[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",R(),t.format.apply(t,arguments))},t.inherits=r(49073),t._extend=function(e,t){if(!t||!E(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var C="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');if(C&&e[C]){var t;if("function"!==typeof(t=e[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(s){r(s)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),C&&Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=C,t.callbackify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!==typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(s.bind(null,null,e))}),(function(e){n.nextTick(O.bind(null,e,s))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},48061:(e,t,r)=>{"use strict";var n;r.r(t),r.d(t,{NIL:()=>O,parse:()=>g,stringify:()=>h,v1:()=>y,v3:()=>I,v4:()=>k,v5:()=>C,validate:()=>a,version:()=>x});var i=new Uint8Array(16);function o(){if(!n&&!(n="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)}const s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const a=function(e){return"string"===typeof e&&s.test(e)};for(var u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));const h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!a(r))throw TypeError("Stringified UUID is invalid");return r};var l,f,d=0,p=0;const y=function(e,t,r){var n=t&&r||0,i=t||new Array(16),s=(e=e||{}).node||l,a=void 0!==e.clockseq?e.clockseq:f;if(null==s||null==a){var u=e.random||(e.rng||o)();null==s&&(s=l=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==a&&(a=f=16383&(u[6]<<8|u[7]))}var c=void 0!==e.msecs?e.msecs:Date.now(),y=void 0!==e.nsecs?e.nsecs:p+1,g=c-d+(y-p)/1e4;if(g<0&&void 0===e.clockseq&&(a=a+1&16383),(g<0||c>d)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=c,p=y,f=a;var m=(1e4*(268435455&(c+=122192928e5))+y)%4294967296;i[n++]=m>>>24&255,i[n++]=m>>>16&255,i[n++]=m>>>8&255,i[n++]=255&m;var b=c/4294967296*1e4&268435455;i[n++]=b>>>8&255,i[n++]=255&b,i[n++]=b>>>24&15|16,i[n++]=b>>>16&255,i[n++]=a>>>8|128,i[n++]=255&a;for(var v=0;v<6;++v)i[n+v]=s[v];return t||h(i)};const g=function(e){if(!a(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function m(e,t,r){function n(e,n,i,o){if("string"===typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"===typeof n&&(n=g(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+e.length);if(s.set(n),s.set(e,n.length),(s=r(s))[6]=15&s[6]|t,s[8]=63&s[8]|128,i){o=o||0;for(var a=0;a<16;++a)i[o+a]=s[a];return i}return h(s)}try{n.name=e}catch(i){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function b(e){return 14+(e+64>>>9<<4)+1}function v(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function w(e,t,r,n,i,o){return v((s=v(v(t,e),v(n,o)))<<(a=i)|s>>>32-a,r);var s,a}function _(e,t,r,n,i,o,s){return w(t&r|~t&n,e,t,i,o,s)}function E(e,t,r,n,i,o,s){return w(t&n|r&~n,e,t,i,o,s)}function S(e,t,r,n,i,o,s){return w(t^r^n,e,t,i,o,s)}function M(e,t,r,n,i,o,s){return w(r^(t|~n),e,t,i,o,s)}const A=function(e){if("string"===typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){for(var t=[],r=32*e.length,n="0123456789abcdef",i=0;i<r;i+=8){var o=e[i>>5]>>>i%32&255,s=parseInt(n.charAt(o>>>4&15)+n.charAt(15&o),16);t.push(s)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[b(t)-1]=t;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,s=0;s<e.length;s+=16){var a=r,u=n,c=i,h=o;r=_(r,n,i,o,e[s],7,-680876936),o=_(o,r,n,i,e[s+1],12,-389564586),i=_(i,o,r,n,e[s+2],17,606105819),n=_(n,i,o,r,e[s+3],22,-1044525330),r=_(r,n,i,o,e[s+4],7,-176418897),o=_(o,r,n,i,e[s+5],12,1200080426),i=_(i,o,r,n,e[s+6],17,-1473231341),n=_(n,i,o,r,e[s+7],22,-45705983),r=_(r,n,i,o,e[s+8],7,1770035416),o=_(o,r,n,i,e[s+9],12,-1958414417),i=_(i,o,r,n,e[s+10],17,-42063),n=_(n,i,o,r,e[s+11],22,-1990404162),r=_(r,n,i,o,e[s+12],7,1804603682),o=_(o,r,n,i,e[s+13],12,-40341101),i=_(i,o,r,n,e[s+14],17,-1502002290),r=E(r,n=_(n,i,o,r,e[s+15],22,1236535329),i,o,e[s+1],5,-165796510),o=E(o,r,n,i,e[s+6],9,-1069501632),i=E(i,o,r,n,e[s+11],14,643717713),n=E(n,i,o,r,e[s],20,-373897302),r=E(r,n,i,o,e[s+5],5,-701558691),o=E(o,r,n,i,e[s+10],9,38016083),i=E(i,o,r,n,e[s+15],14,-660478335),n=E(n,i,o,r,e[s+4],20,-405537848),r=E(r,n,i,o,e[s+9],5,568446438),o=E(o,r,n,i,e[s+14],9,-1019803690),i=E(i,o,r,n,e[s+3],14,-187363961),n=E(n,i,o,r,e[s+8],20,1163531501),r=E(r,n,i,o,e[s+13],5,-1444681467),o=E(o,r,n,i,e[s+2],9,-51403784),i=E(i,o,r,n,e[s+7],14,1735328473),r=S(r,n=E(n,i,o,r,e[s+12],20,-1926607734),i,o,e[s+5],4,-378558),o=S(o,r,n,i,e[s+8],11,-2022574463),i=S(i,o,r,n,e[s+11],16,1839030562),n=S(n,i,o,r,e[s+14],23,-35309556),r=S(r,n,i,o,e[s+1],4,-1530992060),o=S(o,r,n,i,e[s+4],11,1272893353),i=S(i,o,r,n,e[s+7],16,-155497632),n=S(n,i,o,r,e[s+10],23,-1094730640),r=S(r,n,i,o,e[s+13],4,681279174),o=S(o,r,n,i,e[s],11,-358537222),i=S(i,o,r,n,e[s+3],16,-722521979),n=S(n,i,o,r,e[s+6],23,76029189),r=S(r,n,i,o,e[s+9],4,-640364487),o=S(o,r,n,i,e[s+12],11,-421815835),i=S(i,o,r,n,e[s+15],16,530742520),r=M(r,n=S(n,i,o,r,e[s+2],23,-995338651),i,o,e[s],6,-198630844),o=M(o,r,n,i,e[s+7],10,1126891415),i=M(i,o,r,n,e[s+14],15,-1416354905),n=M(n,i,o,r,e[s+5],21,-57434055),r=M(r,n,i,o,e[s+12],6,1700485571),o=M(o,r,n,i,e[s+3],10,-1894986606),i=M(i,o,r,n,e[s+10],15,-1051523),n=M(n,i,o,r,e[s+1],21,-2054922799),r=M(r,n,i,o,e[s+8],6,1873313359),o=M(o,r,n,i,e[s+15],10,-30611744),i=M(i,o,r,n,e[s+6],15,-1560198380),n=M(n,i,o,r,e[s+13],21,1309151649),r=M(r,n,i,o,e[s+4],6,-145523070),o=M(o,r,n,i,e[s+11],10,-1120210379),i=M(i,o,r,n,e[s+2],15,718787259),n=M(n,i,o,r,e[s+9],21,-343485551),r=v(r,a),n=v(n,u),i=v(i,c),o=v(o,h)}return[r,n,i,o]}(function(e){if(0===e.length)return[];for(var t=8*e.length,r=new Uint32Array(b(t)),n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))};const I=m("v3",48,A);const k=function(e,t,r){var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return h(n)};function T(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function R(e,t){return e<<t|e>>>32-t}const P=function(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"===typeof e){var n=unescape(encodeURIComponent(e));e=[];for(var i=0;i<n.length;++i)e.push(n.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var o=e.length/4+2,s=Math.ceil(o/16),a=new Array(s),u=0;u<s;++u){for(var c=new Uint32Array(16),h=0;h<16;++h)c[h]=e[64*u+4*h]<<24|e[64*u+4*h+1]<<16|e[64*u+4*h+2]<<8|e[64*u+4*h+3];a[u]=c}a[s-1][14]=8*(e.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(e.length-1)&4294967295;for(var l=0;l<s;++l){for(var f=new Uint32Array(80),d=0;d<16;++d)f[d]=a[l][d];for(var p=16;p<80;++p)f[p]=R(f[p-3]^f[p-8]^f[p-14]^f[p-16],1);for(var y=r[0],g=r[1],m=r[2],b=r[3],v=r[4],w=0;w<80;++w){var _=Math.floor(w/20),E=R(y,5)+T(_,g,m,b)+v+t[_]+f[w]>>>0;v=b,b=m,m=R(g,30)>>>0,g=y,y=E}r[0]=r[0]+y>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+m>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+v>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]};const C=m("v5",80,P),O="00000000-0000-0000-0000-000000000000";const x=function(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}},18061:e=>{e.exports=function e(t,r){var n,i=0,o=0,s=r=r||0,a=t.length;do{if(s>=a||o>49)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return e.bytes=s-r,i}},30648:e=>{e.exports=function e(r,n,i){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");n=n||[];var o=i=i||0;for(;r>=t;)n[i++]=255&r|128,r/=128;for(;-128&r;)n[i++]=255&r|128,r>>>=7;return n[i]=0|r,e.bytes=i-o+1,n};var t=Math.pow(2,31)},16980:(e,t,r)=>{e.exports={encode:r(30648),decode:r(18061),encodingLength:r(27914)}},27914:e=>{var t=Math.pow(2,7),r=Math.pow(2,14),n=Math.pow(2,21),i=Math.pow(2,28),o=Math.pow(2,35),s=Math.pow(2,42),a=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e<t?1:e<r?2:e<n?3:e<i?4:e<o?5:e<s?6:e<a?7:e<u?8:e<c?9:10}},15551:(e,t,r)=>{"use strict";var n=r(21964);const i=r(84137),o="object"===typeof window&&"object"===typeof document&&9===document.nodeType,s=i(),a=o&&!s,u=s&&!o,c=s&&o,h="undefined"!==typeof n&&"undefined"!==typeof n.release&&"node"===n.release.name&&!s,l="function"===typeof importScripts&&"undefined"!==typeof self&&"undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,f="undefined"!==typeof n&&!1;e.exports={isTest:f,isElectron:s,isElectronMain:u,isElectronRenderer:c,isNode:h,isBrowser:a,isWebWorker:l,isEnvWithDom:o}},25182:(e,t,r)=>{"use strict";var n=r(65060),i=r(62393),o=r(28136),s=o("Object.prototype.toString"),a=r(4931)()&&"symbol"===typeof Symbol.toStringTag,u=i(),c=o("String.prototype.slice"),h={},l=r(4431),f=Object.getPrototypeOf;a&&l&&f&&n(u,(function(e){if("function"===typeof r.g[e]){var t=new r.g[e];if(!(Symbol.toStringTag in t))throw new EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var n=f(t),i=l(n,Symbol.toStringTag);if(!i){var o=f(n);i=l(o,Symbol.toStringTag)}h[e]=i.get}}));var d=r(85313);e.exports=function(e){return!!d(e)&&(a?function(e){var t=!1;return n(h,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(o){}})),t}(e):c(s(e),8,-1))}},80950:()=>{},46601:()=>{},89214:()=>{},8623:()=>{},7748:()=>{},85568:()=>{},56619:()=>{},77108:()=>{},52361:()=>{},94616:()=>{},10868:()=>{},77695:()=>{},75477:()=>{},33196:()=>{},38087:()=>{},67129:()=>{},15215:()=>{},65437:()=>{},47573:()=>{},95942:()=>{},72464:()=>{},62393:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"===typeof r.g[n[t]]&&(e[e.length]=n[t]);return e}},4431:(e,t,r)=>{"use strict";var n=r(66953)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(i){n=null}e.exports=n},45938:(e,t,r)=>{"use strict";function n(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}r.r(t),r.d(t,{concat:()=>n})},26874:(e,t,r)=>{"use strict";function n(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}r.r(t),r.d(t,{equals:()=>n})},75528:(e,t,r)=>{"use strict";r.r(t),r.d(t,{fromString:()=>i});var n=r(56779);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},6398:(e,t,r)=>{"use strict";r.r(t),r.d(t,{toString:()=>i});var n=r(56779);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},56779:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(97392);function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const o=i("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),s=i("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),a={utf8:o,"utf-8":o,hex:n.gh.base16,latin1:s,ascii:s,binary:s,...n.gh}},25215:(e,t,r)=>{"use strict";function n(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}r.r(t),r.d(t,{concat:()=>n})},69581:(e,t,r)=>{"use strict";function n(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}r.r(t),r.d(t,{equals:()=>n})},73624:(e,t,r)=>{"use strict";r.r(t),r.d(t,{fromString:()=>i});var n=r(68625);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},63951:(e,t,r)=>{"use strict";r.r(t),r.d(t,{toString:()=>i});var n=r(68625);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},68625:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(97392);function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const o=i("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),s=i("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),a={utf8:o,"utf-8":o,hex:n.gh.base16,latin1:s,ascii:s,binary:s,...n.gh}},8034:(e,t,r)=>{"use strict";function n(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}r.r(t),r.d(t,{concat:()=>n})},80215:(e,t,r)=>{"use strict";function n(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}r.r(t),r.d(t,{equals:()=>n})},79740:(e,t,r)=>{"use strict";r.r(t),r.d(t,{fromString:()=>i});var n=r(28694);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},42531:(e,t,r)=>{"use strict";r.r(t),r.d(t,{toString:()=>i});var n=r(28694);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},28694:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(97392);function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const o=i("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),s=i("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),a={utf8:o,"utf-8":o,hex:n.gh.base16,latin1:s,ascii:s,binary:s,...n.gh}},41158:(e,t,r)=>{"use strict";function n(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}r.r(t),r.d(t,{concat:()=>n})},8552:(e,t,r)=>{"use strict";function n(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}r.r(t),r.d(t,{equals:()=>n})},16406:(e,t,r)=>{"use strict";r.r(t),r.d(t,{fromString:()=>i});var n=r(19388);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},10157:(e,t,r)=>{"use strict";r.r(t),r.d(t,{toString:()=>i});var n=r(19388);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},19388:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(97392);function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const o=i("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),s=i("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),a={utf8:o,"utf-8":o,hex:n.gh.base16,latin1:s,ascii:s,binary:s,...n.gh}},83122:(e,t,r)=>{"use strict";function n(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}r.r(t),r.d(t,{concat:()=>n})},56213:(e,t,r)=>{"use strict";function n(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}r.r(t),r.d(t,{equals:()=>n})},98897:(e,t,r)=>{"use strict";r.r(t),r.d(t,{fromString:()=>i});var n=r(77513);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},60709:(e,t,r)=>{"use strict";r.r(t),r.d(t,{toString:()=>i});var n=r(77513);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},77513:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(97392);function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const o=i("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),s=i("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),a={utf8:o,"utf-8":o,hex:n.gh.base16,latin1:s,ascii:s,binary:s,...n.gh}},62734:(e,t,r)=>{"use strict";function n(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}r.r(t),r.d(t,{concat:()=>n})},3034:(e,t,r)=>{"use strict";function n(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}r.r(t),r.d(t,{equals:()=>n})},49667:(e,t,r)=>{"use strict";r.r(t),r.d(t,{fromString:()=>i});var n=r(47558);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},27578:(e,t,r)=>{"use strict";r.r(t),r.d(t,{toString:()=>i});var n=r(47558);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},47558:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(97392);function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const o=i("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),s=i("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),a={utf8:o,"utf-8":o,hex:n.gh.base16,latin1:s,ascii:s,binary:s,...n.gh}},91203:(e,t,r)=>{"use strict";r.d(t,{kU:()=>h,Dp:()=>c,ET:()=>l});const n=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==r[s])throw new TypeError(o+" is ambiguous");r[s]=i}var a=e.length,u=e.charAt(0),c=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function l(e){if("string"!==typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,i=0;e[t]===u;)n++,t++;for(var o=(e.length-t)*c+1>>>0,s=new Uint8Array(o);e[t];){var h=r[e.charCodeAt(t)];if(255===h)return;for(var l=0,f=o-1;(0!==h||l<i)&&-1!==f;f--,l++)h+=a*s[f]>>>0,s[f]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");i=l,t++}if(" "!==e[t]){for(var d=o-i;d!==o&&0===s[d];)d++;for(var p=new Uint8Array(n+(o-d)),y=n;d!==o;)p[y++]=s[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*h+1>>>0,c=new Uint8Array(s);i!==o;){for(var l=t[i],f=0,d=s-1;(0!==l||f<n)&&-1!==d;d--,f++)l+=256*c[d]>>>0,c[d]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");n=f,i++}for(var p=s-n;p!==s&&0===c[p];)p++;for(var y=u.repeat(r);p<s;++p)y+=e.charAt(c[p]);return y},decodeUnsafe:l,decode:function(e){var r=l(e);if(r)return r;throw new Error("Non-".concat(t," character"))}}};var i=r(13322);class o{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(e));throw Error("Unknown type, must be binary type")}}class s{constructor(e,t,r){this.name=e,this.prefix=t,this.baseDecode=r}decode(e){if("string"===typeof e){if(e[0]===this.prefix)return this.baseDecode(e.slice(1));throw Error("Unable to decode multibase string ".concat(JSON.stringify(e),", ").concat(this.name," decoder only supports inputs prefixed with ").concat(this.prefix))}throw Error("Can only multibase decode strings")}or(e){const t={[this.prefix]:this,...e.decoders||{[e.prefix]:e}};return new a(t)}}class a{constructor(e){this.decoders=e}or(e){const t=e.decoders||{[e.prefix]:e};return new a({...this.decoders,...t})}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(e),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}class u{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new o(e,t,r),this.decoder=new s(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const c=e=>{let{name:t,prefix:r,encode:n,decode:i}=e;return new u(t,r,n,i)},h=e=>{let{prefix:t,name:r,alphabet:o}=e;const{encode:s,decode:a}=n(o,r);return c({prefix:t,name:r,encode:s,decode:e=>(0,i.oQ)(a(e))})},l=e=>{let{name:t,prefix:r,bitsPerChar:n,alphabet:i}=e;return c({prefix:r,name:t,encode:e=>((e,t,r)=>{const n="="===t[t.length-1],i=(1<<r)-1;let o="",s=0,a=0;for(let u=0;u<e.length;++u)for(a=a<<8|e[u],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o})(e,i,n),decode:e=>((e,t,r,n)=>{const i={};for(let h=0;h<t.length;++h)i[t[h]]=h;let o=e.length;for(;"="===e[o-1];)--o;const s=new Uint8Array(o*r/8|0);let a=0,u=0,c=0;for(let h=0;h<o;++h){const t=i[e[h]];if(void 0===t)throw new SyntaxError("Non-".concat(n," character"));u=u<<r|t,a+=r,a>=8&&(a-=8,s[c++]=255&u>>a)}if(a>=r||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s})(e,i,n,t)})}},9092:(e,t,r)=>{"use strict";r.r(t),r.d(t,{base16:()=>i,base16upper:()=>o});var n=r(91203);const i=(0,n.ET)({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),o=(0,n.ET)({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})},36206:(e,t,r)=>{"use strict";r.r(t),r.d(t,{base32:()=>i,base32upper:()=>o,base32pad:()=>s,base32padupper:()=>a,base32hex:()=>u,base32hexupper:()=>c,base32hexpad:()=>h,base32hexpadupper:()=>l,base32z:()=>f});var n=r(91203);const i=(0,n.ET)({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),o=(0,n.ET)({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),s=(0,n.ET)({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),a=(0,n.ET)({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),u=(0,n.ET)({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),c=(0,n.ET)({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),h=(0,n.ET)({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),l=(0,n.ET)({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),f=(0,n.ET)({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})},29936:(e,t,r)=>{"use strict";r.r(t),r.d(t,{base36:()=>i,base36upper:()=>o});var n=r(91203);const i=(0,n.kU)({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),o=(0,n.kU)({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})},59376:(e,t,r)=>{"use strict";r.r(t),r.d(t,{base58btc:()=>i,base58flickr:()=>o});var n=r(91203);const i=(0,n.kU)({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),o=(0,n.kU)({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})},86443:(e,t,r)=>{"use strict";r.r(t),r.d(t,{base64:()=>i,base64pad:()=>o,base64url:()=>s,base64urlpad:()=>a});var n=r(91203);const i=(0,n.ET)({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),o=(0,n.ET)({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),s=(0,n.ET)({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),a=(0,n.ET)({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})},97392:(e,t,r)=>{"use strict";r.d(t,{gh:()=>C});var n={};r.r(n),r.d(n,{identity:()=>l});var i={};r.r(i),r.d(i,{base2:()=>f});var o={};r.r(o),r.d(o,{base8:()=>d});var s={};r.r(s),r.d(s,{base10:()=>p});var a={};r.r(a),r.d(a,{code:()=>M,decode:()=>I,encode:()=>A,name:()=>S});var u={};r.r(u),r.d(u,{code:()=>T,decode:()=>P,encode:()=>R,name:()=>k});var c=r(91203),h=r(13322);const l=(0,c.Dp)({prefix:"\0",name:"identity",encode:e=>(0,h.BB)(e),decode:e=>(0,h.mL)(e)}),f=(0,c.ET)({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),d=(0,c.ET)({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),p=(0,c.kU)({prefix:"9",name:"base10",alphabet:"0123456789"});var y=r(9092),g=r(36206),m=r(29936),b=r(59376),v=r(86443),w=r(27678),_=r(4991);const E=e=>(0,h.oQ)(e),{name:S,code:M,encode:A,decode:I}={name:"raw",code:85,decode:E,encode:E},{name:k,code:T,encode:R,decode:P}={name:"json",code:512,encode:e=>(new TextEncoder).encode(JSON.stringify(e)),decode:e=>JSON.parse((new TextDecoder).decode(e))};r(91759),r(41339),r(19594),r(27893);const C={...n,...i,...o,...s,...y,...g,...m,...b,...v}},13322:(e,t,r)=>{"use strict";r.d(t,{fS:()=>n,oQ:()=>i,mL:()=>o,BB:()=>s});new Uint8Array(0);const n=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},i=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},o=e=>(new TextEncoder).encode(e),s=e=>(new TextDecoder).decode(e)},91759:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CID:()=>u});var n=r(41339),i=r(27893),o=r(59376),s=r(36206),a=r(13322);class u{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:m,byteLength:m,code:g,version:g,multihash:g,bytes:g,_baseCache:m,asCID:m})}toV0(){if(0===this.version)return this;{const{code:e,multihash:t}=this;if(e!==f)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==d)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return u.createV0(t)}}toV1(){switch(this.version){case 0:{const{code:e,digest:t}=this.multihash,r=i.create(e,t);return u.createV1(this.code,r)}case 1:return this;default:throw Error("Can not convert CID version ".concat(this.version," to version 0. This is a bug please report"))}}equals(e){return e&&this.code===e.code&&this.version===e.version&&i.equals(this.multihash,e.multihash)}toString(e){const{bytes:t,version:r,_baseCache:n}=this;return 0===r?h(t,n,e||o.base58btc.encoder):l(t,n,e||s.base32.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return b(/^0\.0/,v),!(!e||!e[y]&&e.asCID!==e)}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof u)return e;if(null!=e&&e.asCID===e){const{version:t,code:r,multihash:n,bytes:i}=e;return new u(t,r,n,i||p(t,r,n.bytes))}if(null!=e&&!0===e[y]){const{version:t,multihash:r,code:n}=e,o=i.decode(r);return u.create(t,n,o)}return null}static create(e,t,r){if("number"!==typeof t)throw new Error("String codecs are no longer supported");switch(e){case 0:if(t!==f)throw new Error("Version 0 CID must use dag-pb (code: ".concat(f,") block encoding"));return new u(e,t,r,r.bytes);case 1:{const n=p(e,t,r.bytes);return new u(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return u.create(0,f,e)}static createV1(e,t){return u.create(1,e,t)}static decode(e){const[t,r]=u.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){const t=u.inspectBytes(e),r=t.size-t.multihashSize,n=(0,a.oQ)(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");const o=n.subarray(t.multihashSize-t.digestSize),s=new i.Digest(t.multihashCode,t.digestSize,o,n);return[0===t.version?u.createV0(s):u.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0;const r=()=>{const[r,i]=n.Jx(e.subarray(t));return t+=i,r};let i=r(),o=f;if(18===i?(i=0,t=0):1===i&&(o=r()),0!==i&&1!==i)throw new RangeError("Invalid CID version ".concat(i));const s=t,a=r(),u=r(),c=t+u;return{version:i,codec:o,multihashCode:a,digestSize:u,multihashSize:c-s,size:c}}static parse(e,t){const[r,n]=c(e,t),i=u.decode(n);return i._baseCache.set(r,e),i}}const c=(e,t)=>{switch(e[0]){case"Q":{const r=t||o.base58btc;return[o.base58btc.prefix,r.decode("".concat(o.base58btc.prefix).concat(e))]}case o.base58btc.prefix:{const r=t||o.base58btc;return[o.base58btc.prefix,r.decode(e)]}case s.base32.prefix:{const r=t||s.base32;return[s.base32.prefix,r.decode(e)]}default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},h=(e,t,r)=>{const{prefix:n}=r;if(n!==o.base58btc.prefix)throw Error("Cannot string encode V0 in ".concat(r.name," encoding"));const i=t.get(n);if(null==i){const i=r.encode(e).slice(1);return t.set(n,i),i}return i},l=(e,t,r)=>{const{prefix:n}=r,i=t.get(n);if(null==i){const i=r.encode(e);return t.set(n,i),i}return i},f=112,d=18,p=(e,t,r)=>{const i=n.P$(e),o=i+n.P$(t),s=new Uint8Array(o+r.byteLength);return n.mL(e,s,0),n.mL(t,s,i),s.set(r,o),s},y=Symbol.for("@ipld/js-cid/CID"),g={writable:!1,configurable:!1,enumerable:!0},m={writable:!1,enumerable:!1,configurable:!1},b=(e,t)=>{if(!e.test("0.0.0-dev"))throw new Error(t);console.warn(t)},v="CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n"},27893:(e,t,r)=>{"use strict";r.r(t),r.d(t,{create:()=>o,decode:()=>s,equals:()=>a,Digest:()=>u});var n=r(13322),i=r(41339);const o=(e,t)=>{const r=t.byteLength,n=i.P$(e),o=n+i.P$(r),s=new Uint8Array(o+r);return i.mL(e,s,0),i.mL(r,s,n),s.set(t,o),new u(e,r,t,s)},s=e=>{const t=(0,n.oQ)(e),[r,o]=i.Jx(t),[s,a]=i.Jx(t.subarray(o)),c=t.subarray(o+a);if(c.byteLength!==s)throw new Error("Incorrect length");return new u(r,s,c,t)},a=(e,t)=>e===t||e.code===t.code&&e.size===t.size&&(0,n.fS)(e.bytes,t.bytes);class u{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}},19594:(e,t,r)=>{"use strict";r.d(t,{D:()=>i});var n=r(27893);const i=e=>{let{name:t,code:r,encode:n}=e;return new o(t,r,n)};class o{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}async digest(e){if(e instanceof Uint8Array){const t=await this.encode(e);return n.create(this.code,t)}throw Error("Unknown type, must be binary type")}}},4991:(e,t,r)=>{"use strict";r.r(t),r.d(t,{identity:()=>o});var n=r(19594),i=r(13322);const o=(0,n.D)({name:"identity",code:0,encode:e=>(0,i.oQ)(e)})},27678:(e,t,r)=>{"use strict";r.r(t),r.d(t,{sha256:()=>o,sha512:()=>s});var n=r(19594);const i=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),o=(0,n.D)({name:"sha2-256",code:18,encode:i("SHA-256")}),s=(0,n.D)({name:"sha2-512",code:19,encode:i("SHA-512")})},41339:(e,t,r)=>{"use strict";r.d(t,{Jx:()=>g,mL:()=>m,P$:()=>b});var n=function e(t,r,n){r=r||[];var o=n=n||0;for(;t>=i;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-o+1,r},i=Math.pow(2,31);var o=function e(t,r){var n,i=0,o=0,s=r=r||0,a=t.length;do{if(s>=a)throw e.bytes=0,new RangeError("Could not decode varint");n=t[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return e.bytes=s-r,i};var s=Math.pow(2,7),a=Math.pow(2,14),u=Math.pow(2,21),c=Math.pow(2,28),h=Math.pow(2,35),l=Math.pow(2,42),f=Math.pow(2,49),d=Math.pow(2,56),p=Math.pow(2,63);const y={encode:n,decode:o,encodingLength:function(e){return e<s?1:e<a?2:e<u?3:e<c?4:e<h?5:e<l?6:e<f?7:e<d?8:e<p?9:10}},g=e=>[y.decode(e),y.decode.bytes],m=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return y.encode(e,t,r),t},b=e=>y.encodingLength(e)},319:(e,t,r)=>{"use strict";function n(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}r.r(t),r.d(t,{concat:()=>n})},13763:(e,t,r)=>{"use strict";r.r(t),r.d(t,{fromString:()=>i});var n=r(13511);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},69025:(e,t,r)=>{"use strict";r.r(t),r.d(t,{toString:()=>i});var n=r(13511);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},13511:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(97392);function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const o=i("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),s=i("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),a={utf8:o,"utf-8":o,hex:n.gh.base16,latin1:s,ascii:s,binary:s,...n.gh}},85374:(e,t,r)=>{"use strict";r.r(t),r.d(t,{customAlphabet:()=>s,customRandom:()=>o,nanoid:()=>a,random:()=>i,urlAlphabet:()=>n});let n="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";let i=e=>crypto.getRandomValues(new Uint8Array(e)),o=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return()=>{let o="";for(;;){let s=r(i),a=i;for(;a--;)if(o+=e[s[a]&n]||"",o.length===t)return o}}},s=(e,t)=>o(e,t,i),a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21,t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let n=63&r[e];t+=n<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n<63?"_":"-"}return t}},34569:(e,t,r)=>{"use strict";function n(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}r.r(t),r.d(t,{equals:()=>n})},29285:(e,t,r)=>{"use strict";r.r(t),r.d(t,{fromString:()=>i});var n=r(38362);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.decoder.decode("".concat(r.prefix).concat(e))}},32995:(e,t,r)=>{"use strict";r.r(t),r.d(t,{toString:()=>i});var n=r(38362);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";const r=n.Z[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return r.encoder.encode(e).substring(1)}},38362:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(97392);function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const o=i("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),s=i("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),a={utf8:o,"utf-8":o,hex:n.gh.base16,latin1:s,ascii:s,binary:s,...n.gh}},44946:e=>{"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},75207:e=>{"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},1308:e=>{"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},29799:e=>{"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},18597:e=>{"use strict";e.exports={i8:"6.5.4"}},22562:e=>{"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},19521:e=>{"use strict";e.exports=JSON.parse('{"name":"axios","version":"0.21.2","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},56640:e=>{"use strict";e.exports=JSON.parse('{"cloudflare":{"host":"cloudflare-dns.com","docs":"https://developers.cloudflare.com/1.1.1.1/dns-over-https","cors":true},"cloudflareFamily":{"host":"family.cloudflare-dns.com","docs":"https://developers.cloudflare.com/1.1.1.1/1.1.1.1-for-families/setup-instructions/dns-over-https","cors":true,"filter":true},"cloudflareSecurity":{"host":"security.cloudflare-dns.com","docs":"https://developers.cloudflare.com/1.1.1.1/1.1.1.1-for-families/setup-instructions/dns-over-https","cors":true,"filter":true},"cloudflareEth":{"host":"eth.resolver.cloudflare-eth.com","docs":"https://www.cloudflare.com/distributed-web-gateway/#ethereum-gateway","cors":true,"filter":true},"aAndA":{"host":"dns.aa.net.uk","docs":"https://www.aa.net.uk/legal/dohdot-disclaimer/","filter":true},"usablePrivacy":{"host":"adfree.usableprivacy.net","docs":"https://docs.usableprivacy.com","filter":true},"adguard":{"host":"dns.adguard.com","docs":"https://adguard.com/en/adguard-dns/overview.html","filter":true},"adguardFamily":{"host":"dns-family.adguard.com","docs":"https://adguard.com/en/adguard-dns/overview.html","filter":true},"adguardUnfiltered":{"host":"dns-unfiltered.adguard.com","docs":"https://adguard.com/en/adguard-dns/overview.html"},"ahadnsIn":{"host":"doh.in.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"India"},"ahadnsIt":{"host":"doh.it.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Italy"},"ahadnsEs":{"host":"doh.es.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Spain"},"ahadnsNo":{"host":"doh.no.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Norway"},"ahadnsNl":{"host":"doh.nl.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Netherlands"},"ahadnsPl":{"host":"doh.pl.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Poland"},"ahadnsNy":{"host":"doh.ny.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"New York"},"ahadnsChi":{"host":"doh.chi.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Chicago"},"ahadnsAu":{"host":"doh.au.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Australia"},"ahadnsLa":{"host":"doh.la.ahadns.net","docs":"https://ahadns.com/dns-over-https/","cors":true,"filter":true,"location":"Los Angeles"},"alidns":{"host":"dns.alidns.com","docs":"https://alidns.com/knowledge?type=SETTING_DOCS#umpt6","cors":true,"filter":true,"location":"China"},"amsNl":{"host":"dnsnl.alekberg.net","docs":"https://alekberg.net/doh","location":"Amsterdam"},"amsSe":{"host":"dnsse.alekberg.net","docs":"https://alekberg.net/doh","location":"Sweden"},"amsEs":{"host":"dnses.alekberg.net","docs":"https://alekberg.net/doh","location":"Spain"},"arapurayil":{"host":"dns.arapurayil.com","docs":"https://www.dns.arapurayil.com/","filter":true},"digitaleGesellschaft":{"host":"dns.digitale-gesellschaft.ch","docs":"https://www.digitale-gesellschaft.ch/dns","cors":true,"location":"Switzerland"},"dnsForFamily":{"host":"dns-doh.dnsforfamily.com","docs":"https://dnsforfamily.com/","filter":true},"dnsHome":{"host":"dns.dnshome.de","docs":"https://www.dnshome.de/doh-dot-public-resolver.php","location":"Germany"},"blahDnsCh":{"host":"doh-ch.blahdns.com","docs":"https://blahdns.com/","cors":true,"filter":true,"location":"Switzerland"},"blahDnsJp":{"host":"doh-jp.blahdns.com","docs":"https://blahdns.com/","cors":true,"filter":true,"location":"Japan"},"blahDnsDe":{"host":"doh-de.blahdns.com","docs":"https://blahdns.com/","cors":true,"filter":true,"location":"Germany"},"blahDnsFi":{"host":"doh-fi.blahdns.com","docs":"https://blahdns.com/","cors":true,"filter":true,"location":"Finland"},"cleanBrowsingSecurity":{"host":"doh.cleanbrowsing.org","docs":"https://cleanbrowsing.org/guides/dnsoverhttps","path":"/doh/security-filter/","cors":true,"filter":true},"cleanBrowsingFamily":{"host":"doh.cleanbrowsing.org","docs":"https://cleanbrowsing.org/guides/dnsoverhttps","path":"/doh/family-filter/","cors":true,"filter":true},"cleanBrowsingAdult":{"host":"doh.cleanbrowsing.org","docs":"https://cleanbrowsing.org/guides/dnsoverhttps","path":"/doh/adult-filter/","cors":true,"filter":true},"appliedPrivacy":{"host":"doh.applied-privacy.net","docs":"https://applied-privacy.net/services/dns/","path":"/query","location":"Austria"},"ffmuc":{"host":"doh.ffmuc.net","docs":"https://ffmuc.net/wiki/doku.php?id=knb:dohdot","location":"Germany"},"tiarap":{"host":"doh.tiar.app","docs":"https://tiarap.org/","filter":true},"tiarapJp":{"host":"jp.tiar.app","docs":"https://jp.tiar.app/","filter":true,"location":"Japan"},"google":{"host":"dns.google","docs":"https://developers.google.com/speed/public-dns/docs/doh/","cors":true},"he":{"host":"ordns.he.net","docs":"https://dns.he.net/","log":true},"iij":{"host":"public.dns.iij.jp","docs":"https://public.dns.iij.jp/","filter":true,"log":true,"location":"Japan"},"libredns":{"host":"doh.libredns.gr","docs":"https://libredns.gr/","location":"Germany"},"librednsAds":{"host":"doh.libredns.gr","docs":"https://libredns.gr/","path":"/ads","filter":true,"location":"Germany"},"njalla":{"host":"dns.njal.la","docs":"https://dns.njal.la/","location":"Sweden"},"opendns":{"host":"doh.opendns.com","docs":"https://support.opendns.com/hc/en-us/articles/360038086532-Using-DNS-over-HTTPS-DoH-with-OpenDNS"},"opendnsFamily":{"host":"doh.familyshield.opendns.com","docs":"https://support.opendns.com/hc/en-us/articles/360038086532-Using-DNS-over-HTTPS-DoH-with-OpenDNS","filter":true},"sebyVultr":{"host":"doh.seby.io","docs":"https://dns.seby.io/","port":8443,"cors":true,"filter":true,"location":"Sydney"},"sebyOVH":{"host":"doh-2.seby.io","docs":"https://dns.seby.io/","cors":true,"filter":true,"location":"Sydney"},"quad9":{"host":"dns10.quad9.net","docs":"https://quad9.net/service/service-addresses-and-features"},"quad9Ads":{"host":"dns.quad9.net","docs":"https://quad9.net/service/service-addresses-and-features","filter":true},"switchCh":{"host":"dns.switch.ch","docs":"https://www.switch.ch/security/info/public-dns/","filter":true,"location":"Switzerland"},"yepdns":{"host":"sg.yepdns.com","docs":"https://get.yepdns.com/","filter":true,"location":"Singapore"},"lavaDnsEU1":{"host":"eu1.dns.lavate.ch","docs":"https://dns.lavate.ch/","location":"Helsinki"},"controlId":{"host":"freedns.controld.com","docs":"https://controld.com/","path":"/p0"},"controlIdMw":{"host":"freedns.controld.com","docs":"https://controld.com/","path":"/p1","filter":true},"controlIdAds":{"host":"freedns.controld.com","docs":"https://controld.com/","path":"/p2","filter":true},"controlIdSoc":{"host":"freedns.controld.com","docs":"https://controld.com/","path":"/p3","filter":true},"uncensoredAny":{"host":"anycast.censurfridns.dk","docs":"https://blog.uncensoreddns.org/"},"uncensoredUni":{"host":"unicast.censurfridns.dk","docs":"https://blog.uncensoreddns.org/","location":"Copenhagen"},"dnssbGlobal":{"host":"doh.dns.sb","docs":"https://dns.sb/doh/","cors":true},"dbssbDeDus":{"host":"de-dus.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"D\xfcsseldorf"},"dnssbDeFra":{"host":"de-fra.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Frankfurt"},"dnssbNlAms":{"host":"nl-ams.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Amsterdam"},"dnssbNlAms2":{"host":"nl-ams2.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Amsterdam"},"dnssbEeTll":{"host":"ee-tll.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Tallinn"},"dnssbJpKix":{"host":"jp-kix.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Osaka"},"dnssbHkHkg":{"host":"hk-hkg.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Hong Kong"},"dnssbAuSyd":{"host":"au-syd.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Sydney"},"dnssbUsChi":{"host":"us-chi.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Chicago"},"dnssbInBlr":{"host":"in-blr.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Bengaluru"},"dnssbSgSin":{"host":"sg-sin.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Singapore"},"dnssbKrSel":{"host":"kr-sel.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Seoul"},"dnssbRuMow":{"host":"ru-mow.doh.sb","docs":"https://dns.sb/doh/","cors":true,"location":"Moscow"},"ethlink":{"host":"eth.link","docs":"https://eth.link/","cors":true},"handshake":{"host":"query.hdns.io","docs":"https://docs.namebase.io/guides-1/resolving-handshake-1/hdns.io#dns-over-https-doh","cors":true}}')},40763:e=>{"use strict";e.exports={i8:"6.5.4"}},5398:e=>{"use strict";e.exports=JSON.parse('{"name":"libp2p","version":"0.32.4","description":"JavaScript implementation of libp2p, a modular peer to peer network stack","leadMaintainer":"Jacob Heun <jacobheun@gmail.com>","main":"src/index.js","types":"dist/src/index.d.ts","typesVersions":{"*":{"src/*":["dist/src/*","dist/src/*/index"]}},"files":["dist","src"],"scripts":{"lint":"aegir lint","build":"aegir build","build:proto":"npm run build:proto:circuit && npm run build:proto:identify && npm run build:proto:plaintext && npm run build:proto:address-book && npm run build:proto:proto-book && npm run build:proto:peer-record && npm run build:proto:envelope","build:proto:circuit":"pbjs -t static-module -w commonjs -r libp2p-circuit --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/circuit/protocol/index.js ./src/circuit/protocol/index.proto","build:proto:identify":"pbjs -t static-module -w commonjs -r libp2p-identify --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/identify/message.js ./src/identify/message.proto","build:proto:plaintext":"pbjs -t static-module -w commonjs -r libp2p-plaintext --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/insecure/proto.js ./src/insecure/proto.proto","build:proto:address-book":"pbjs -t static-module -w commonjs -r libp2p-address-book --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/peer-store/persistent/pb/address-book.js ./src/peer-store/persistent/pb/address-book.proto","build:proto:proto-book":"pbjs -t static-module -w commonjs -r libp2p-proto-book --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/peer-store/persistent/pb/proto-book.js ./src/peer-store/persistent/pb/proto-book.proto","build:proto:peer-record":"pbjs -t static-module -w commonjs -r libp2p-peer-record --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/record/peer-record/peer-record.js ./src/record/peer-record/peer-record.proto","build:proto:envelope":"pbjs -t static-module -w commonjs -r libp2p-envelope --force-number --no-verify --no-delimited --no-create --no-beautify --no-defaults --lint eslint-disable -o src/record/envelope/envelope.js ./src/record/envelope/envelope.proto","build:proto-types":"npm run build:proto-types:circuit && npm run build:proto-types:identify && npm run build:proto-types:plaintext && npm run build:proto-types:address-book && npm run build:proto-types:proto-book && npm run build:proto-types:peer-record && npm run build:proto-types:envelope","build:proto-types:circuit":"pbts -o src/circuit/protocol/index.d.ts src/circuit/protocol/index.js","build:proto-types:identify":"pbts -o src/identify/message.d.ts src/identify/message.js","build:proto-types:plaintext":"pbts -o src/insecure/proto.d.ts src/insecure/proto.js","build:proto-types:address-book":"pbts -o src/peer-store/persistent/pb/address-book.d.ts src/peer-store/persistent/pb/address-book.js","build:proto-types:proto-book":"pbts -o src/peer-store/persistent/pb/proto-book.d.ts src/peer-store/persistent/pb/proto-book.js","build:proto-types:peer-record":"pbts -o src/record/peer-record/peer-record.d.ts src/record/peer-record/peer-record.js","build:proto-types:envelope":"pbts -o src/record/envelope/envelope.d.ts src/record/envelope/envelope.js","test":"aegir test","test:ts":"aegir build --no-bundle && npm run test --prefix test/ts-use","test:node":"aegir test -t node -f \\"./test/**/*.{node,spec}.js\\"","test:browser":"aegir test -t browser","test:examples":"cd examples && npm run test:all","prepare":"aegir build --no-bundle","release":"aegir release -t node -t browser","release-minor":"aegir release --type minor -t node -t browser","release-major":"aegir release --type major -t node -t browser","coverage":"nyc --reporter=text --reporter=lcov npm run test:node"},"repository":{"type":"git","url":"https://github.com/libp2p/js-libp2p.git"},"keywords":["libp2p","network","p2p","peer","peer-to-peer","IPFS"],"bugs":{"url":"https://github.com/libp2p/js-libp2p/issues"},"homepage":"https://libp2p.io","license":"MIT","engines":{"node":">=14.0.0"},"browser":{"@motrix/nat-api":false},"eslintConfig":{"extends":"ipfs","ignorePatterns":["!.aegir.js","test/ts-use"]},"dependencies":{"@motrix/nat-api":"^0.3.1","@vascosantos/moving-average":"^1.1.0","abort-controller":"^3.0.0","aggregate-error":"^3.1.0","any-signal":"^2.1.1","bignumber.js":"^9.0.1","class-is":"^1.1.0","debug":"^4.3.1","err-code":"^3.0.0","es6-promisify":"^6.1.1","events":"^3.3.0","hashlru":"^2.3.0","interface-datastore":"^5.1.1","it-all":"^1.0.4","it-buffer":"^0.1.2","it-drain":"^1.0.3","it-filter":"^1.0.1","it-first":"^1.0.4","it-handshake":"^2.0.0","it-length-prefixed":"^5.0.2","it-map":"^1.0.4","it-merge":"^1.0.0","it-pipe":"^1.1.0","it-take":"^1.0.0","libp2p-crypto":"^0.19.4","libp2p-interfaces":"^1.0.0","libp2p-utils":"^0.4.0","mafmt":"^10.0.0","merge-options":"^3.0.4","multiaddr":"^10.0.0","multiformats":"^9.0.0","multistream-select":"^2.0.0","mutable-proxy":"^1.0.0","node-forge":"^0.10.0","p-any":"^3.0.0","p-fifo":"^1.0.0","p-retry":"^4.4.0","p-settle":"^4.1.1","peer-id":"^0.15.0","private-ip":"^2.1.0","protobufjs":"^6.10.2","retimer":"^3.0.0","sanitize-filename":"^1.6.3","set-delayed-interval":"^1.0.0","streaming-iterables":"^6.0.0","timeout-abort-controller":"^1.1.1","uint8arrays":"^3.0.0","varint":"^6.0.0","wherearewe":"^1.0.0","xsalsa20":"^1.1.0"},"devDependencies":{"@chainsafe/libp2p-noise":"^4.0.0","@nodeutils/defaults-deep":"^1.1.0","@types/es6-promisify":"^6.0.0","@types/node":"^16.0.1","@types/node-forge":"^0.10.1","@types/varint":"^6.0.0","abortable-iterator":"^3.0.0","aegir":"^33.1.1","buffer":"^6.0.3","delay":"^5.0.0","interop-libp2p":"^0.4.0","into-stream":"^6.0.0","ipfs-http-client":"^50.1.1","it-concat":"^2.0.0","it-pair":"^1.0.0","it-pushable":"^1.4.0","libp2p":".","libp2p-bootstrap":"^0.13.0","libp2p-delegated-content-routing":"^0.11.0","libp2p-delegated-peer-routing":"^0.10.0","libp2p-floodsub":"^0.27.0","libp2p-gossipsub":"^0.11.0","libp2p-interfaces-compliance-tests":"^1.0.0","libp2p-kad-dht":"^0.23.0","libp2p-mdns":"^0.17.0","libp2p-mplex":"^0.10.1","libp2p-tcp":"^0.17.0","libp2p-webrtc-star":"^0.23.0","libp2p-websockets":"^0.16.0","nock":"^13.0.3","p-defer":"^3.0.0","p-times":"^3.0.0","p-wait-for":"^3.2.0","rimraf":"^3.0.2","sinon":"^11.1.1","util":"^0.12.3"},"contributors":["Vasco Santos <vasco.santos@moxy.studio>","David Dias <daviddias.p@gmail.com>","Jacob Heun <jacobheun@gmail.com>","Alex Potsides <alex@achingbrain.net>","Alan Shaw <alan@tableflip.io>","Cayman <caymannava@gmail.com>","Pedro Teixeira <i@pgte.me>","Friedel Ziegelmayer <dignifiedquire@gmail.com>","Maciej Kr\xfcger <mkg20001@gmail.com>","Hugo Dias <mail@hugodias.me>","Volker Mische <volker.mische@gmail.com>","Chris Dostert <chrisdostert@users.noreply.github.com>","dirkmc <dirkmdev@gmail.com>","Richard Littauer <richard.littauer@gmail.com>","zeim839 <50573884+zeim839@users.noreply.github.com>","Ryan Bell <ryan@piing.net>","a1300 <matthias-knopp@gmx.net>","\u1d20\u026a\u1d04\u1d1b\u1d0f\u0280 \u0299\u1d0a\u1d07\u029f\u1d0b\u029c\u1d0f\u029f\u1d0d <victorbjelkholm@gmail.com>","Andrew Nesbitt <andrewnez@gmail.com>","Elven <mon.samuel@qq.com>","Franck Royer <franck@royer.one>","Giovanni T. Parra <fiatjaf@gmail.com>","Samlior <samlior@foxmail.com>","Thomas Eizinger <thomas@eizinger.io>","acolytec3 <17355484+acolytec3@users.noreply.github.com>","Didrik Nordstr\xf6m <didrik@betamos.se>","Irakli Gozalishvili <rfobic@gmail.com>","Joel Gustafson <joelg@mit.edu>","John Rees <johnrees@users.noreply.github.com>","Jo\xe3o Santos <joaosantos15@users.noreply.github.com>","Julien Bouquillon <contact@revolunet.com>","Kevin Kwok <antimatter15@gmail.com>","Kevin Lacker <lacker@gmail.com>","Lars Gierth <lgierth@users.noreply.github.com>","Ethan Lam <elmemphis2000@gmail.com>","Marcin Tojek <mtojek@users.noreply.github.com>","Michael Burns <5170+mburns@users.noreply.github.com>","Miguel Mota <miguelmota2@gmail.com>","Nuno Nogueira <nunofmn@gmail.com>","Dmitriy Ryajov <dryajov@gmail.com>","Philipp Muens <raute1337@gmx.de>","RasmusErik Voel Jensen <github@solsort.com>","Diogo Silva <fsdiogo@gmail.com>","Robert Kiel <robert.kiel@hoprnet.org>","phillmac <phillmac@users.noreply.github.com>","robertkiel <robert.kiel@validitylabs.org>","Smite Chow <xiaopengyou@live.com>","Soeren <nikorpoulsen@gmail.com>","S\xf6nke Hahn <soenkehahn@gmail.com>","TJKoury <TJKoury@gmail.com>","shresthagrawal <34920931+shresthagrawal@users.noreply.github.com>","Tiago Alves <alvesjtiago@gmail.com>","Daijiro Wachi <daijiro.wachi@gmail.com>","Yusef Napora <yusef@napora.org>","Zane Starr <zcstarr@gmail.com>","swedneck <40505480+swedneck@users.noreply.github.com>","Aleksei <vozhdb@gmail.com>","Cindy Wu <ciindy.wu@gmail.com>","Aditya Bose <13054902+adbose@users.noreply.github.com>","Chris Bratlien <chrisbratlien@gmail.com>","ebinks <elizabethjbinks@gmail.com>","greenSnot <greenSnot@users.noreply.github.com>","Bernd Strehl <bernd.strehl@gmail.com>","Francis Gulotta <wizard@roborooter.com>","isan_rivkin <isanrivkin@gmail.com>","Florian-Merle <florian.david.merle@gmail.com>","mayerwin <mayerwin@users.noreply.github.com>","Guy Sviry <32539816+guysv@users.noreply.github.com>","Henrique Dias <hacdias@gmail.com>","mcclure <andi.m.mcclure@gmail.com>","Felipe Martins <felipebrasil93@gmail.com>","Fei Liu <liu.feiwood@gmail.com>"]}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(72791),t=__webpack_require__(54164),r=__webpack_require__(5345),n=__webpack_require__(57604),i=__webpack_require__(96732),o=__webpack_require__.n(i);function s(e,t,r){let i=[];const s=function(e){return e.trim().replaceAll(/\s\s+/g," ").split(" ")}(e),a=s.shift();switch(a){case"/help":["/nick <nickname>: set a new nickname","/info: some information about the node","/connect <Multiaddr>: connect to the given peer","/help: Display this help"].map((e=>i.push(e)));break;case"/nick":(function(e,t){return e?(t(e),["New nick: ".concat(e)]):["No nick provided"]})(s.shift(),r).map((e=>i.push(e)));break;case"/info":(function(e){return e?["PeerId: ".concat(e.libp2p.peerId.toB58String())]:["Waku node is starting"]})(t).map((e=>i.push(e)));break;case"/connect":(function(e,t){if(!t)return["Waku node is starting"];if(!e)return["No peer provided"];try{const r=(0,n.multiaddr)(e),i=r.getPeerId();return i?(t.addPeerToAddressBook(o().createFromB58String(i),[r]),["".concat(i,": ").concat(r.toString()," added to address book, autodial in progress")]):["Peer Id needed to dial"]}catch(r){return["Invalid multiaddr: "+r]}})(s.shift(),t).map((e=>i.push(e)));break;case"/peers":(function(e){if(!e)return["Waku node is starting"];let t=[];return e.libp2p.peerStore.peers.forEach(((e,r)=>{t.push(r+":");let n=" addresses: [";e.addresses.forEach((e=>{let{multiaddr:t}=e;n+=" "+t.toString()+","})),n=n.replace(/,$/,""),n+="]",t.push(n);let i=" protocols: [";i+=e.protocols,i+="]",t.push(i)})),0===t.length&&t.push("Not connected to any peer."),t})(t).map((e=>i.push(e)));break;case"/connections":(function(e){if(!e)return["Waku node is starting"];let t=[];return e.libp2p.connections.forEach(((e,r)=>{t.push(r+":");let n=" connections: [";e.forEach((e=>{n+=JSON.stringify(e.stat),n+="; "+JSON.stringify(e.streams)})),n+="]",t.push(n)})),0===t.length&&t.push("Not connected to any peer."),t})(t).map((e=>i.push(e)));break;default:i.push("Unknown Command '".concat(a,"'"))}return{command:a,response:i}}function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}const u=function(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}};var c=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;const h=u((function(e){return c.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var l=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(n){0}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),f=Math.abs,d=String.fromCharCode,p=Object.assign;function y(e){return e.trim()}function g(e,t,r){return e.replace(t,r)}function m(e,t){return e.indexOf(t)}function b(e,t){return 0|e.charCodeAt(t)}function v(e,t,r){return e.slice(t,r)}function w(e){return e.length}function _(e){return e.length}function E(e,t){return t.push(e),e}var S=1,M=1,A=0,I=0,k=0,T="";function R(e,t,r,n,i,o,s){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:S,column:M,length:s,return:""}}function P(e,t){return p(R("",null,null,"",null,null,0),e,{length:-e.length},t)}function C(){return k=I>0?b(T,--I):0,M--,10===k&&(M=1,S--),k}function O(){return k=I<A?b(T,I++):0,M++,10===k&&(M=1,S++),k}function x(){return b(T,I)}function B(){return I}function D(e,t){return v(T,e,t)}function N(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function L(e){return S=M=1,A=w(T=e),I=0,[]}function K(e){return T="",e}function U(e){return y(D(I-1,F(91===e?e+2:40===e?e+1:e)))}function j(e){for(;(k=x())&&k<33;)O();return N(e)>2||N(k)>3?"":" "}function q(e,t){for(;--t&&O()&&!(k<48||k>102||k>57&&k<65||k>70&&k<97););return D(e,B()+(t<6&&32==x()&&32==O()))}function F(e){for(;O();)switch(k){case e:return I;case 34:case 39:34!==e&&39!==e&&F(k);break;case 40:41===e&&F(e);break;case 92:O()}return I}function z(e,t){for(;O()&&e+k!==57&&(e+k!==84||47!==x()););return"/*"+D(t,I-1)+"*"+d(47===e?e:O())}function V(e){for(;!N(x());)O();return D(e,I)}var H="-ms-",G="-moz-",W="-webkit-",Y="comm",Z="rule",X="decl",J="@keyframes";function Q(e,t){for(var r="",n=_(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function $(e,t,r,n){switch(e.type){case"@import":case X:return e.return=e.return||e.value;case Y:return"";case J:return e.return=e.value+"{"+Q(e.children,n)+"}";case Z:e.value=e.props.join(",")}return w(r=Q(e.children,n))?e.return=e.value+"{"+r+"}":""}function ee(e,t){switch(function(e,t){return(((t<<2^b(e,0))<<2^b(e,1))<<2^b(e,2))<<2^b(e,3)}(e,t)){case 5103:return W+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return W+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return W+e+G+e+H+e+e;case 6828:case 4268:return W+e+H+e+e;case 6165:return W+e+H+"flex-"+e+e;case 5187:return W+e+g(e,/(\w+).+(:[^]+)/,"-webkit-box-$1$2-ms-flex-$1$2")+e;case 5443:return W+e+H+"flex-item-"+g(e,/flex-|-self/,"")+e;case 4675:return W+e+H+"flex-line-pack"+g(e,/align-content|flex-|-self/,"")+e;case 5548:return W+e+H+g(e,"shrink","negative")+e;case 5292:return W+e+H+g(e,"basis","preferred-size")+e;case 6060:return W+"box-"+g(e,"-grow","")+W+e+H+g(e,"grow","positive")+e;case 4554:return W+g(e,/([^-])(transform)/g,"$1-webkit-$2")+e;case 6187:return g(g(g(e,/(zoom-|grab)/,W+"$1"),/(image-set)/,W+"$1"),e,"")+e;case 5495:case 3959:return g(e,/(image-set\([^]*)/,W+"$1$`$1");case 4968:return g(g(e,/(.+:)(flex-)?(.*)/,"-webkit-box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+W+e+e;case 4095:case 3583:case 4068:case 2532:return g(e,/(.+)-inline(.+)/,W+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(w(e)-1-t>6)switch(b(e,t+1)){case 109:if(45!==b(e,t+4))break;case 102:return g(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+G+(108==b(e,t+3)?"$3":"$2-$3"))+e;case 115:return~m(e,"stretch")?ee(g(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==b(e,t+1))break;case 6444:switch(b(e,w(e)-3-(~m(e,"!important")&&10))){case 107:return g(e,":",":"+W)+e;case 101:return g(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+W+(45===b(e,14)?"inline-":"")+"box$3$1"+W+"$2$3$1"+H+"$2box$3")+e}break;case 5936:switch(b(e,t+11)){case 114:return W+e+H+g(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return W+e+H+g(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return W+e+H+g(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return W+e+H+e+e}return e}function te(e){return K(re("",null,null,null,[""],e=L(e),0,[0],e))}function re(e,t,r,n,i,o,s,a,u){for(var c=0,h=0,l=s,f=0,p=0,y=0,b=1,v=1,_=1,S=0,M="",A=i,I=o,k=n,T=M;v;)switch(y=S,S=O()){case 40:if(108!=y&&58==T.charCodeAt(l-1)){-1!=m(T+=g(U(S),"&","&\f"),"&\f")&&(_=-1);break}case 34:case 39:case 91:T+=U(S);break;case 9:case 10:case 13:case 32:T+=j(y);break;case 92:T+=q(B()-1,7);continue;case 47:switch(x()){case 42:case 47:E(ie(z(O(),B()),t,r),u);break;default:T+="/"}break;case 123*b:a[c++]=w(T)*_;case 125*b:case 59:case 0:switch(S){case 0:case 125:v=0;case 59+h:p>0&&w(T)-l&&E(p>32?oe(T+";",n,r,l-1):oe(g(T," ","")+";",n,r,l-2),u);break;case 59:T+=";";default:if(E(k=ne(T,t,r,c,h,i,a,M,A=[],I=[],l),o),123===S)if(0===h)re(T,t,k,k,A,o,l,a,I);else switch(f){case 100:case 109:case 115:re(e,k,k,n&&E(ne(e,k,k,0,0,i,a,M,i,A=[],l),I),i,I,l,a,n?A:I);break;default:re(T,k,k,k,[""],I,0,a,I)}}c=h=p=0,b=_=1,M=T="",l=s;break;case 58:l=1+w(T),p=y;default:if(b<1)if(123==S)--b;else if(125==S&&0==b++&&125==C())continue;switch(T+=d(S),S*b){case 38:_=h>0?1:(T+="\f",-1);break;case 44:a[c++]=(w(T)-1)*_,_=1;break;case 64:45===x()&&(T+=U(O())),f=x(),h=l=w(M=T+=V(B())),S++;break;case 45:45===y&&2==w(T)&&(b=0)}}return o}function ne(e,t,r,n,i,o,s,a,u,c,h){for(var l=i-1,d=0===i?o:[""],p=_(d),m=0,b=0,w=0;m<n;++m)for(var E=0,S=v(e,l+1,l=f(b=s[m])),M=e;E<p;++E)(M=y(b>0?d[E]+" "+S:g(S,/&\f/g,d[E])))&&(u[w++]=M);return R(e,t,r,0===i?Z:a,u,c,h)}function ie(e,t,r){return R(e,t,r,Y,d(k),v(e,2,-2),0)}function oe(e,t,r,n){return R(e,t,r,X,v(e,0,n),v(e,n+1,-1),n)}var se=function(e,t,r){for(var n=0,i=0;n=i,i=x(),38===n&&12===i&&(t[r]=1),!N(i);)O();return D(e,I)},ae=function(e,t){return K(function(e,t){var r=-1,n=44;do{switch(N(n)){case 0:38===n&&12===x()&&(t[r]=1),e[r]+=se(I-1,t,r);break;case 2:e[r]+=U(n);break;case 4:if(44===n){e[++r]=58===x()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=d(n)}}while(n=O());return e}(L(e),t))},ue=new WeakMap,ce=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ue.get(r))&&!n){ue.set(e,!0);for(var i=[],o=ae(t,i),s=r.props,a=0,u=0;a<o.length;a++)for(var c=0;c<s.length;c++,u++)e.props[u]=i[a]?o[a].replace(/&\f/g,s[c]):s[c]+" "+o[a]}}},he=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},le=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case X:e.return=ee(e.value,e.length);break;case J:return Q([P(e,{value:g(e.value,"@","@"+W)})],n);case Z:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Q([P(e,{props:[g(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return Q([P(e,{props:[g(t,/:(plac\w+)/,":-webkit-input-$1")]}),P(e,{props:[g(t,/:(plac\w+)/,":-moz-$1")]}),P(e,{props:[g(t,/:(plac\w+)/,H+"input-$1")]})],n)}return""}))}}];const fe=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var n=e.stylisPlugins||le;var i,o,s={},a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)s[t[r]]=!0;a.push(e)}));var u,c,h=[$,(c=function(e){u.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],f=function(e){var t=_(e);return function(r,n,i,o){for(var s="",a=0;a<t;a++)s+=e[a](r,n,i,o)||"";return s}}([ce,he].concat(n,h));o=function(e,t,r,n){u=r,Q(te(e?e+"{"+t.styles+"}":t.styles),f),n&&(d.inserted[t.name]=!0)};var d={key:t,sheet:new l({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:o};return d.sheet.hydrate(a),d};const de=function(e){var t=new WeakMap;return function(r){if(t.has(r))return t.get(r);var n=e(r);return t.set(r,n),n}};function pe(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "})),n}var ye=function(e,t,r){var n=e.key+"-"+t.name;if(!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles),void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0);i=i.next}while(void 0!==i)}};const ge=function(e){for(var t,r=0,n=0,i=e.length;i>=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)};const me={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var be=/[A-Z]|^ms/g,ve=/_EMO_([^_]+?)_([^]*?)_EMO_/g,we=function(e){return 45===e.charCodeAt(1)},_e=function(e){return null!=e&&"boolean"!==typeof e},Ee=u((function(e){return we(e)?e:e.replace(be,"-$&").toLowerCase()})),Se=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(ve,(function(e,t,r){return Ae={name:t,styles:r,next:Ae},t}))}return 1===me[e]||we(e)||"number"!==typeof t||0===t?t:t+"px"};function Me(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return Ae={name:r.name,styles:r.styles,next:Ae},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)Ae={name:n.name,styles:n.styles,next:Ae},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=Me(e,t,r[i])+";";else for(var o in r){var s=r[o];if("object"!==typeof s)null!=t&&void 0!==t[s]?n+=o+"{"+t[s]+"}":_e(s)&&(n+=Ee(o)+":"+Se(o,s)+";");else if(!Array.isArray(s)||"string"!==typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=Me(e,t,s);switch(o){case"animation":case"animationName":n+=Ee(o)+":"+a+";";break;default:n+=o+"{"+a+"}"}}else for(var u=0;u<s.length;u++)_e(s[u])&&(n+=Ee(o)+":"+Se(o,s[u])+";")}return n}(e,t,r);case"function":if(void 0!==e){var i=Ae,o=r(e);return Ae=i,Me(e,t,o)}}if(null==t)return r;var s=t[r];return void 0!==s?s:r}var Ae,Ie=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var ke=function(e,t,r){if(1===e.length&&"object"===typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";Ae=void 0;var o=e[0];null==o||void 0===o.raw?(n=!1,i+=Me(r,t,o)):i+=o[0];for(var s=1;s<e.length;s++)i+=Me(r,t,e[s]),n&&(i+=o[s]);Ie.lastIndex=0;for(var a,u="";null!==(a=Ie.exec(i));)u+="-"+a[1];return{name:ge(i)+u,styles:i,next:Ae}},Te={}.hasOwnProperty,Re=(0,e.createContext)("undefined"!==typeof HTMLElement?fe({key:"css"}):null);Re.Provider;var Pe=function(t){return(0,e.forwardRef)((function(r,n){var i=(0,e.useContext)(Re);return t(r,i,n)}))},Ce=(0,e.createContext)({});var Oe=function(){return(0,e.useContext)(Ce)},xe=de((function(e){return de((function(t){return function(e,t){return"function"===typeof t?t(e):a({},e,t)}(e,t)}))})),Be=function(t){var r=(0,e.useContext)(Ce);return t.theme!==r&&(r=xe(r)(t.theme)),(0,e.createElement)(Ce.Provider,{value:r},t.children)};var De="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Ne=function(e,t){var r={};for(var n in t)Te.call(t,n)&&(r[n]=t[n]);return r[De]=e,r},Le=function(){return null},Ke=Pe((function(t,r,n){var i=t.css;"string"===typeof i&&void 0!==r.registered[i]&&(i=r.registered[i]);var o=t[De],s=[i],a="";"string"===typeof t.className?a=pe(r.registered,s,t.className):null!=t.className&&(a=t.className+" ");var u=ke(s,void 0,(0,e.useContext)(Ce));ye(r,u,"string"===typeof o);a+=r.key+"-"+u.name;var c={};for(var h in t)Te.call(t,h)&&"css"!==h&&h!==De&&(c[h]=t[h]);c.ref=n,c.className=a;var l=(0,e.createElement)(o,c),f=(0,e.createElement)(Le,null);return(0,e.createElement)(e.Fragment,null,f,l)}));var Ue=h,je=function(e){return"theme"!==e},qe=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?Ue:je},Fe=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!==typeof n&&r&&(n=e.__emotion_forwardProp),n},ze=function(){return null};const Ve=function t(r,n){var i,o,s=r.__emotion_real===r,u=s&&r.__emotion_base||r;void 0!==n&&(i=n.label,o=n.target);var c=Fe(r,n,s),h=c||qe(u),l=!h("as");return function(){var f=arguments,d=s&&void 0!==r.__emotion_styles?r.__emotion_styles.slice(0):[];if(void 0!==i&&d.push("label:"+i+";"),null==f[0]||void 0===f[0].raw)d.push.apply(d,f);else{0,d.push(f[0][0]);for(var p=f.length,y=1;y<p;y++)d.push(f[y],f[0][y])}var g=Pe((function(t,r,n){var i=l&&t.as||u,s="",a=[],f=t;if(null==t.theme){for(var p in f={},t)f[p]=t[p];f.theme=(0,e.useContext)(Ce)}"string"===typeof t.className?s=pe(r.registered,a,t.className):null!=t.className&&(s=t.className+" ");var y=ke(d.concat(a),r.registered,f);ye(r,y,"string"===typeof i);s+=r.key+"-"+y.name,void 0!==o&&(s+=" "+o);var g=l&&void 0===c?qe(i):h,m={};for(var b in t)l&&"as"===b||g(b)&&(m[b]=t[b]);m.className=s,m.ref=n;var v=(0,e.createElement)(i,m),w=(0,e.createElement)(ze,null);return(0,e.createElement)(e.Fragment,null,w,v)}));return g.displayName=void 0!==i?i:"Styled("+("string"===typeof u?u:u.displayName||u.name||"Component")+")",g.defaultProps=r.defaultProps,g.__emotion_real=g,g.__emotion_base=u,g.__emotion_styles=d,g.__emotion_forwardProp=c,Object.defineProperty(g,"toString",{value:function(){return"."+o}}),g.withComponent=function(e,r){return t(e,a({},n,r,{shouldForwardProp:Fe(g,r,!0)})).apply(void 0,d)},g}};var He=Ve.bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){He[e]=He(e)}));const Ge=He;var We={}.hasOwnProperty;function Ye(e,t){return We.call(t,e)}var Ze=Array.isArray;function Xe(e){return"object"===typeof e&&null!==e&&!Ze(e)}function Je(e,t){return Object.keys(t).reduce((function(r,n){return r[n]=e(t[n]),r}),{})}function Qe(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(e(n))return n}}function $e(e,t){for(var r=0;r<t.length;r++)if(e(t[r]))return r;return-1}function et(e){return e}function tt(e,t){return Object.keys(t).forEach((function(r){e(t[r],r)}))}function rt(e){return 0===(Ze(e)?e:Object.keys(e)).length}function nt(e,t){return Object.keys(t).reduce((function(r,n){return r[e(n)]=t[n],r}),{})}function it(e,t){if(rt(t))return e;var r={};return tt((function(n,i){if(Ye(i,t))if(Xe(e[i])&&Xe(t[i]))r[i]=it(e[i],t[i]);else if(Ze(e[i])&&Ze(t[i])){var o=Math.max(e[i].length,t[i].length);r[i]=new Array(o);for(var s=0;s<o;s++)s in t[i]?r[i][s]=t[i][s]:s in e[i]&&(r[i][s]=e[i][s])}else r[i]=t[i];else r[i]=e[i]}),e),tt((function(e,n){Ye(n,r)||(r[n]=t[n])}),t),r}function ot(e){var t,r,n=!1;return function(){return n&&(arguments.length<=0?void 0:arguments[0])===r?t:(n=!0,r=arguments.length<=0?void 0:arguments[0],t=e.apply(void 0,arguments))}}function st(){}function at(e,t){return Object.keys(t).reduce((function(r,n){return e(t[n],n)||(r[n]=t[n]),r}),{})}function ut(e){var t,r=!1;return function(){return r?t:(r=!0,t=e.apply(void 0,arguments))}}function ct(e,t){return Object.keys(t).reduce((function(r,n){return e(t[n],n)&&(r[n]=t[n]),r}),{})}var ht=/\s+$/;function lt(e){return e.replace(ht,"")}__webpack_require__(62110);var ft=function(t,r){var n=arguments;if(null==r||!Te.call(r,"css"))return e.createElement.apply(void 0,n);var i=n.length,o=new Array(i);o[0]=Ke,o[1]=Ne(t,r);for(var s=2;s<i;s++)o[s]=n[s];return e.createElement.apply(null,o)};function dt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return ke(t)}var pt=function e(t){for(var r=t.length,n=0,i="";n<r;n++){var o=t[n];if(null!=o){var s=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))s=e(o);else for(var a in s="",o)o[a]&&a&&(s&&(s+=" "),s+=a);break;default:s=o}s&&(i&&(i+=" "),i+=s)}}return i};function yt(e,t,r){var n=[],i=pe(e,n,r);return n.length<2?r:i+t(n)}var gt=function(){return null},mt=Pe((function(t,r){var n=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=ke(t,r.registered);return ye(r,i,!1),r.key+"-"+i.name},i={css:n,cx:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return yt(r.registered,n,pt(t))},theme:(0,e.useContext)(Ce)},o=t.children(i);var s=(0,e.createElement)(gt,null);return(0,e.createElement)(e.Fragment,null,s,o)}));function bt(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}var vt=__webpack_require__(52007);function wt(e,t){return wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},wt(e,t)}function _t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,wt(e,t)}const Et=!1,St=e.createContext(null);var Mt="unmounted",At="exited",It="entering",kt="entered",Tt="exiting",Rt=function(r){function n(e,t){var n;n=r.call(this,e,t)||this;var i,o=t&&!t.isMounting?e.enter:e.appear;return n.appearStatus=null,e.in?o?(i=At,n.appearStatus=It):i=kt:i=e.unmountOnExit||e.mountOnEnter?Mt:At,n.state={status:i},n.nextCallback=null,n}_t(n,r),n.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Mt?{status:At}:null};var i=n.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==It&&r!==kt&&(t=It):r!==It&&r!==kt||(t=Tt)}this.updateStatus(!1,t)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!==typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},i.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===It?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===At&&this.setState({status:Mt})},i.performEnter=function(e){var r=this,n=this.props.enter,i=this.context?this.context.isMounting:e,o=this.props.nodeRef?[i]:[t.findDOMNode(this),i],s=o[0],a=o[1],u=this.getTimeouts(),c=i?u.appear:u.enter;!e&&!n||Et?this.safeSetState({status:kt},(function(){r.props.onEntered(s)})):(this.props.onEnter(s,a),this.safeSetState({status:It},(function(){r.props.onEntering(s,a),r.onTransitionEnd(c,(function(){r.safeSetState({status:kt},(function(){r.props.onEntered(s,a)}))}))})))},i.performExit=function(){var e=this,r=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:t.findDOMNode(this);r&&!Et?(this.props.onExit(i),this.safeSetState({status:Tt},(function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:At},(function(){e.props.onExited(i)}))}))}))):this.safeSetState({status:At},(function(){e.props.onExited(i)}))},i.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},i.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},i.onTransitionEnd=function(e,r){this.setNextCallback(r);var n=this.props.nodeRef?this.props.nodeRef.current:t.findDOMNode(this),i=null==e&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],s=o[0],a=o[1];this.props.addEndListener(s,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},i.render=function(){var t=this.state.status;if(t===Mt)return null;var r=this.props,n=r.children,i=(r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef,bt(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return e.createElement(St.Provider,{value:null},"function"===typeof n?n(t,i):e.cloneElement(e.Children.only(n),i))},n}(e.Component);function Pt(){}Rt.contextType=St,Rt.propTypes={},Rt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Pt,onEntering:Pt,onEntered:Pt,onExit:Pt,onExiting:Pt,onExited:Pt},Rt.UNMOUNTED=Mt,Rt.EXITED=At,Rt.ENTERING=It,Rt.ENTERED=kt,Rt.EXITING=Tt;const Ct=Rt;function Ot(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var xt=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.remove(n):"string"===typeof r.className?r.className=Ot(r.className,n):r.setAttribute("class",Ot(r.className&&r.className.baseVal||"",n)));var r,n}))},Bt=function(t){function r(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},e.onEnter=function(t,r){var n=e.resolveArguments(t,r),i=n[0],o=n[1];e.removeClasses(i,"exit"),e.addClass(i,o?"appear":"enter","base"),e.props.onEnter&&e.props.onEnter(t,r)},e.onEntering=function(t,r){var n=e.resolveArguments(t,r),i=n[0],o=n[1]?"appear":"enter";e.addClass(i,o,"active"),e.props.onEntering&&e.props.onEntering(t,r)},e.onEntered=function(t,r){var n=e.resolveArguments(t,r),i=n[0],o=n[1]?"appear":"enter";e.removeClasses(i,o),e.addClass(i,o,"done"),e.props.onEntered&&e.props.onEntered(t,r)},e.onExit=function(t){var r=e.resolveArguments(t)[0];e.removeClasses(r,"appear"),e.removeClasses(r,"enter"),e.addClass(r,"exit","base"),e.props.onExit&&e.props.onExit(t)},e.onExiting=function(t){var r=e.resolveArguments(t)[0];e.addClass(r,"exit","active"),e.props.onExiting&&e.props.onExiting(t)},e.onExited=function(t){var r=e.resolveArguments(t)[0];e.removeClasses(r,"exit"),e.addClass(r,"exit","done"),e.props.onExited&&e.props.onExited(t)},e.resolveArguments=function(t,r){return e.props.nodeRef?[e.props.nodeRef.current,t]:[t,r]},e.getClassNames=function(t){var r=e.props.classNames,n="string"===typeof r,i=n?""+(n&&r?r+"-":"")+t:r[t];return{baseClassName:i,activeClassName:n?i+"-active":r[t+"Active"],doneClassName:n?i+"-done":r[t+"Done"]}},e}_t(r,t);var n=r.prototype;return n.addClass=function(e,t,r){var n=this.getClassNames(t)[r+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&i&&(n+=" "+i),"active"===r&&e&&e.scrollTop,n&&(this.appliedClasses[t][r]=n,function(e,t){e&&t&&t.split(" ").forEach((function(t){return n=t,void((r=e).classList?r.classList.add(n):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(r,n)||("string"===typeof r.className?r.className=r.className+" "+n:r.setAttribute("class",(r.className&&r.className.baseVal||"")+" "+n)));var r,n}))}(e,n))},n.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,i=r.active,o=r.done;this.appliedClasses[t]={},n&&xt(e,n),i&&xt(e,i),o&&xt(e,o)},n.render=function(){var t=this.props,r=(t.classNames,bt(t,["classNames"]));return e.createElement(Ct,a({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},r}(e.Component);Bt.defaultProps={classNames:""},Bt.propTypes={};const Dt=Bt;function Nt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lt(t,r){var n=Object.create(null);return t&&e.Children.map(t,(function(e){return e})).forEach((function(t){n[t.key]=function(t){return r&&(0,e.isValidElement)(t)?r(t):t}(t)})),n}function Kt(e,t,r){return null!=r[t]?r[t]:e.props[t]}function Ut(t,r,n){var i=Lt(t.children),o=function(e,t){function r(r){return r in t?t[r]:e[r]}e=e||{},t=t||{};var n,i=Object.create(null),o=[];for(var s in e)s in t?o.length&&(i[s]=o,o=[]):o.push(s);var a={};for(var u in t){if(i[u])for(n=0;n<i[u].length;n++){var c=i[u][n];a[i[u][n]]=r(c)}a[u]=r(u)}for(n=0;n<o.length;n++)a[o[n]]=r(o[n]);return a}(r,i);return Object.keys(o).forEach((function(s){var a=o[s];if((0,e.isValidElement)(a)){var u=s in r,c=s in i,h=r[s],l=(0,e.isValidElement)(h)&&!h.props.in;!c||u&&!l?c||!u||l?c&&u&&(0,e.isValidElement)(h)&&(o[s]=(0,e.cloneElement)(a,{onExited:n.bind(null,a),in:h.props.in,exit:Kt(a,"exit",t),enter:Kt(a,"enter",t)})):o[s]=(0,e.cloneElement)(a,{in:!1}):o[s]=(0,e.cloneElement)(a,{onExited:n.bind(null,a),in:!0,exit:Kt(a,"exit",t),enter:Kt(a,"enter",t)})}})),o}var jt=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},qt=function(t){function r(e,r){var n,i=(n=t.call(this,e,r)||this).handleExited.bind(Nt(n));return n.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},n}_t(r,t);var n=r.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},r.getDerivedStateFromProps=function(t,r){var n,i,o=r.children,s=r.handleExited;return{children:r.firstRender?(n=t,i=s,Lt(n.children,(function(t){return(0,e.cloneElement)(t,{onExited:i.bind(null,t),in:!0,appear:Kt(t,"appear",n),enter:Kt(t,"enter",n),exit:Kt(t,"exit",n)})}))):Ut(t,o,s),firstRender:!1}},n.handleExited=function(e,t){var r=Lt(this.props.children);e.key in r||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var r=a({},t.children);return delete r[e.key],{children:r}})))},n.render=function(){var t=this.props,r=t.component,n=t.childFactory,i=bt(t,["component","childFactory"]),o=this.state.contextValue,s=jt(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===r?e.createElement(St.Provider,{value:o},s):e.createElement(St.Provider,{value:o},e.createElement(r,i,s))},r}(e.Component);qt.propTypes={},qt.defaultProps={component:"div",childFactory:function(e){return e}};const Ft=qt;function zt(e,t){return t||(t=e.slice(0)),e.raw=t,e}function Vt(e){var t,r,n="";if("string"===typeof e||"number"===typeof e)n+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Vt(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ht(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Vt(e))&&(n&&(n+=" "),n+=t);return n}const Gt="undefined"!==typeof window?e.useLayoutEffect:()=>{};let Wt=new Map;function Yt(e,t){if(e===t)return e;let r=Wt.get(e);if(r)return r(t),t;let n=Wt.get(t);return n?(n(e),e):t}function Zt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){for(let e of t)"function"===typeof e&&e(...arguments)}}function Xt(){let e=a({},arguments.length<=0?void 0:arguments[0]);for(let t=1;t<arguments.length;t++){let r=t<0||arguments.length<=t?void 0:arguments[t];for(let t in r){let n=e[t],i=r[t];"function"===typeof n&&"function"===typeof i&&"o"===t[0]&&"n"===t[1]&&t.charCodeAt(2)>=65&&t.charCodeAt(2)<=90?e[t]=Zt(n,i):"className"!==t&&"UNSAFE_className"!==t||"string"!==typeof n||"string"!==typeof i?"id"===t&&n&&i?e.id=Yt(n,i):e[t]=void 0!==i?i:n:e[t]=Ht(n,i)}}return e}const Jt=new Set(["id"]),Qt=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),$t=/^(data-.*)$/;function er(e){if(function(){if(null==tr){tr=!1;try{document.createElement("div").focus({get preventScroll(){return tr=!0,!0}})}catch(e){}}return tr}())e.focus({preventScroll:!0});else{let t=function(e){var t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft});return r}(e);e.focus(),function(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}(t)}}let tr=null;let rr=new Map,nr=new Set;function ir(){if("undefined"===typeof window)return;let e=t=>{let r=rr.get(t.target);if(r&&(r.delete(t.propertyName),0===r.size&&(t.target.removeEventListener("transitioncancel",e),rr.delete(t.target)),0===rr.size)){for(let e of nr)e();nr.clear()}};document.body.addEventListener("transitionrun",(t=>{let r=rr.get(t.target);r||(r=new Set,rr.set(t.target,r),t.target.addEventListener("transitioncancel",e)),r.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}"undefined"!==typeof document&&("loading"!==document.readyState?ir():document.addEventListener("DOMContentLoaded",ir));function or(e,t){Gt((()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref.current=null}}),[e,t])}"undefined"!==typeof window&&window.visualViewport;new Map;function sr(e){return"undefined"!==typeof window&&null!=window.navigator&&e.test(window.navigator.platform)}function ar(){return sr(/^Mac/)}function ur(){return sr(/^iPhone/)||sr(/^iPad/)||ar()&&navigator.maxTouchPoints>1}let cr="default",hr="",lr=new WeakMap;function fr(e){ur()?("default"===cr&&(hr=document.documentElement.style.webkitUserSelect,document.documentElement.style.webkitUserSelect="none"),cr="disabled"):e&&(lr.set(e,e.style.userSelect),e.style.userSelect="none")}function dr(e){if(ur()){if("disabled"!==cr)return;cr="restoring",setTimeout((()=>{var e;e=()=>{"restoring"===cr&&("none"===document.documentElement.style.webkitUserSelect&&(document.documentElement.style.webkitUserSelect=hr||""),hr="",cr="default")},requestAnimationFrame((()=>{0===rr.size?e():nr.add(e)}))}),300)}else if(e&&lr.has(e)){let t=lr.get(e);"none"===e.style.userSelect&&(e.style.userSelect=t),""===e.getAttribute("style")&&e.removeAttribute("style"),lr.delete(e)}}function pr(e){return!(0!==e.mozInputSource||!e.isTrusted)||0===e.detail&&!e.pointerType}const yr=e.createContext(null);function gr(t){let r=function(t){let r=(0,e.useContext)(yr);if(r){let{register:e}=r;t=Xt(bt(r,["register"]),t),e()}return or(r,t.ref),t}(t),{onPress:n,onPressChange:i,onPressStart:o,onPressEnd:s,onPressUp:a,isDisabled:u,isPressed:c,preventFocusOnPress:h,shouldCancelOnPointerExit:l,allowTextSelectionOnPress:f}=r,d=bt(r,["onPress","onPressChange","onPressStart","onPressEnd","onPressUp","isDisabled","isPressed","preventFocusOnPress","shouldCancelOnPointerExit","allowTextSelectionOnPress","ref"]),p=(0,e.useRef)(null);p.current={onPress:n,onPressChange:i,onPressStart:o,onPressEnd:s,onPressUp:a,isDisabled:u,shouldCancelOnPointerExit:l};let[y,g]=(0,e.useState)(!1),m=(0,e.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:b,removeAllGlobalListeners:v}=function(){let t=(0,e.useRef)(new Map),r=(0,e.useCallback)(((e,r,n,i)=>{let o=null!=i&&i.once?function(){t.current.delete(n),n(...arguments)}:n;t.current.set(n,{type:r,eventTarget:e,fn:o,options:i}),e.addEventListener(r,n,i)}),[]),n=(0,e.useCallback)(((e,r,n,i)=>{var o;let s=(null==(o=t.current.get(n))?void 0:o.fn)||n;e.removeEventListener(r,s,i),t.current.delete(n)}),[]),i=(0,e.useCallback)((()=>{t.current.forEach(((e,t)=>{n(e.eventTarget,e.type,t,e.options)}))}),[n]);return(0,e.useEffect)((()=>i),[i]),{addGlobalListener:r,removeGlobalListener:n,removeAllGlobalListeners:i}}(),w=(0,e.useMemo)((()=>{let e=m.current,t=(t,r)=>{let{onPressStart:n,onPressChange:i,isDisabled:o}=p.current;o||e.didFirePressStart||(n&&n({type:"pressstart",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),i&&i(!0),e.didFirePressStart=!0,g(!0))},r=function(t,r,n){void 0===n&&(n=!0);let{onPressEnd:i,onPressChange:o,onPress:s,isDisabled:a}=p.current;e.didFirePressStart&&(e.ignoreClickAfterPress=!0,e.didFirePressStart=!1,i&&i({type:"pressend",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}),o&&o(!1),g(!1),s&&n&&!a&&s({type:"press",pointerType:r,target:t.currentTarget,shiftKey:t.shiftKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey}))},n=(e,t)=>{let{onPressUp:r,isDisabled:n}=p.current;n||r&&r({type:"pressup",pointerType:t,target:e.currentTarget,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})},i=t=>{e.isPressed&&(e.isOverTarget&&r(wr(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,v(),f||dr(e.target))},o={onKeyDown(r){br(r.nativeEvent)&&r.currentTarget.contains(r.target)&&(r.preventDefault(),r.stopPropagation(),e.isPressed||r.repeat||(e.target=r.currentTarget,e.isPressed=!0,t(r,"keyboard"),b(document,"keyup",s,!1)))},onKeyUp(t){br(t.nativeEvent)&&!t.repeat&&t.currentTarget.contains(t.target)&&n(wr(e.target,t),"keyboard")},onClick(i){i&&!i.currentTarget.contains(i.target)||i&&0===i.button&&(i.stopPropagation(),u&&i.preventDefault(),e.ignoreClickAfterPress||e.ignoreEmulatedMouseEvents||"virtual"!==e.pointerType&&!pr(i.nativeEvent)||(u||h||er(i.currentTarget),t(i,"virtual"),n(i,"virtual"),r(i,"virtual")),e.ignoreEmulatedMouseEvents=!1,e.ignoreClickAfterPress=!1)}},s=t=>{if(e.isPressed&&br(t)){t.preventDefault(),t.stopPropagation(),e.isPressed=!1;let n=t.target;r(wr(e.target,t),"keyboard",e.target.contains(n)),v(),(e.target.contains(n)&&mr(e.target)||"link"===e.target.getAttribute("role"))&&e.target.click()}};if("undefined"!==typeof PointerEvent){o.onPointerDown=r=>{var n;0===r.button&&r.currentTarget.contains(r.target)&&(0===(n=r.nativeEvent).width&&0===n.height||1===n.width&&1===n.height&&0===n.pressure&&0===n.detail?e.pointerType="virtual":(Er(r.target)&&r.preventDefault(),e.pointerType=r.pointerType,r.stopPropagation(),e.isPressed||(e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=r.pointerId,e.target=r.currentTarget,u||h||er(r.currentTarget),f||fr(e.target),t(r,e.pointerType),b(document,"pointermove",s,!1),b(document,"pointerup",a,!1),b(document,"pointercancel",c,!1))))},o.onMouseDown=e=>{e.currentTarget.contains(e.target)&&0===e.button&&(Er(e.target)&&e.preventDefault(),e.stopPropagation())},o.onPointerUp=t=>{t.currentTarget.contains(t.target)&&"virtual"!==e.pointerType&&0===t.button&&_r(t,t.currentTarget)&&n(t,e.pointerType||t.pointerType)};let s=n=>{n.pointerId===e.activePointerId&&(_r(n,e.target)?e.isOverTarget||(e.isOverTarget=!0,t(wr(e.target,n),e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,r(wr(e.target,n),e.pointerType,!1),p.current.shouldCancelOnPointerExit&&i(n)))},a=t=>{t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&(_r(t,e.target)?r(wr(e.target,t),e.pointerType):e.isOverTarget&&r(wr(e.target,t),e.pointerType,!1),e.isPressed=!1,e.isOverTarget=!1,e.activePointerId=null,e.pointerType=null,v(),f||dr(e.target))},c=e=>{i(e)};o.onDragStart=e=>{e.currentTarget.contains(e.target)&&i(e)}}else{o.onMouseDown=r=>{0===r.button&&r.currentTarget.contains(r.target)&&(Er(r.target)&&r.preventDefault(),r.stopPropagation(),e.ignoreEmulatedMouseEvents||(e.isPressed=!0,e.isOverTarget=!0,e.target=r.currentTarget,e.pointerType=pr(r.nativeEvent)?"virtual":"mouse",u||h||er(r.currentTarget),t(r,e.pointerType),b(document,"mouseup",s,!1)))},o.onMouseEnter=r=>{r.currentTarget.contains(r.target)&&(r.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!0,t(r,e.pointerType)))},o.onMouseLeave=t=>{t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&!e.ignoreEmulatedMouseEvents&&(e.isOverTarget=!1,r(t,e.pointerType,!1),p.current.shouldCancelOnPointerExit&&i(t)))},o.onMouseUp=t=>{t.currentTarget.contains(t.target)&&(e.ignoreEmulatedMouseEvents||0!==t.button||n(t,e.pointerType))};let s=t=>{0===t.button&&(e.isPressed=!1,v(),e.ignoreEmulatedMouseEvents?e.ignoreEmulatedMouseEvents=!1:(_r(t,e.target)?r(wr(e.target,t),e.pointerType):e.isOverTarget&&r(wr(e.target,t),e.pointerType,!1),e.isOverTarget=!1))};o.onTouchStart=r=>{if(!r.currentTarget.contains(r.target))return;r.stopPropagation();let n=function(e){const{targetTouches:t}=e;if(t.length>0)return t[0];return null}(r.nativeEvent);n&&(e.activePointerId=n.identifier,e.ignoreEmulatedMouseEvents=!0,e.isOverTarget=!0,e.isPressed=!0,e.target=r.currentTarget,e.pointerType="touch",u||h||er(r.currentTarget),f||fr(e.target),t(r,e.pointerType),b(window,"scroll",a,!0))},o.onTouchMove=n=>{if(!n.currentTarget.contains(n.target))return;if(n.stopPropagation(),!e.isPressed)return;let o=vr(n.nativeEvent,e.activePointerId);o&&_r(o,n.currentTarget)?e.isOverTarget||(e.isOverTarget=!0,t(n,e.pointerType)):e.isOverTarget&&(e.isOverTarget=!1,r(n,e.pointerType,!1),p.current.shouldCancelOnPointerExit&&i(n))},o.onTouchEnd=t=>{if(!t.currentTarget.contains(t.target))return;if(t.stopPropagation(),!e.isPressed)return;let i=vr(t.nativeEvent,e.activePointerId);i&&_r(i,t.currentTarget)?(n(t,e.pointerType),r(t,e.pointerType)):e.isOverTarget&&r(t,e.pointerType,!1),e.isPressed=!1,e.activePointerId=null,e.isOverTarget=!1,e.ignoreEmulatedMouseEvents=!0,f||dr(e.target),v()},o.onTouchCancel=t=>{t.currentTarget.contains(t.target)&&(t.stopPropagation(),e.isPressed&&i(t))};let a=t=>{e.isPressed&&t.target.contains(e.target)&&i({currentTarget:e.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};o.onDragStart=e=>{e.currentTarget.contains(e.target)&&i(e)}}return o}),[b,u,h,v,f]);return(0,e.useEffect)((()=>()=>{f||dr(m.current.target)}),[f]),{isPressed:c||y,pressProps:Xt(d,w)}}function mr(e){return"A"===e.tagName&&e.hasAttribute("href")}function br(e){const{key:t,code:r,target:n}=e,i=n,{tagName:o,isContentEditable:s}=i,a=i.getAttribute("role");return("Enter"===t||" "===t||"Spacebar"===t||"Space"===r)&&"INPUT"!==o&&"TEXTAREA"!==o&&!0!==s&&(!mr(i)||"button"===a&&"Enter"!==t)&&!("link"===a&&"Enter"!==t)}function vr(e,t){const r=e.changedTouches;for(let n=0;n<r.length;n++){const e=r[n];if(e.identifier===t)return e}return null}function wr(e,t){return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey}}function _r(e,t){let r=t.getBoundingClientRect(),n=function(e){let t=e.width/2||e.radiusX||0,r=e.height/2||e.radiusY||0;return{top:e.clientY-r,right:e.clientX+t,bottom:e.clientY+r,left:e.clientX-t}}(e);return function(e,t){return!(e.left>t.right||t.left>e.right)&&!(e.top>t.bottom||t.top>e.bottom)}(r,n)}function Er(e){return!e.closest('[draggable="true"]')}yr.displayName="PressResponderContext";let Sr=null,Mr=new Set,Ar=!1,Ir=!1,kr=!1;const Tr={Tab:!0,Escape:!0};function Rr(e,t){for(let r of Mr)r(e,t)}function Pr(e){Ir=!0,function(e){return!(e.metaKey||!ar()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(Sr="keyboard",Rr("keyboard",e))}function Cr(e){Sr="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(Ir=!0,Rr("pointer",e))}function Or(e){pr(e)&&(Ir=!0,Sr="virtual")}function xr(e){e.target!==window&&e.target!==document&&(Ir||kr||(Sr="virtual",Rr("virtual",e)),Ir=!1,kr=!1)}function Br(){Ir=!1,kr=!0}function Dr(){if("undefined"===typeof window||Ar)return;let e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){Ir=!0,e.apply(this,arguments)},document.addEventListener("keydown",Pr,!0),document.addEventListener("keyup",Pr,!0),document.addEventListener("click",Or,!0),window.addEventListener("focus",xr,!0),window.addEventListener("blur",Br,!1),"undefined"!==typeof PointerEvent?(document.addEventListener("pointerdown",Cr,!0),document.addEventListener("pointermove",Cr,!0),document.addEventListener("pointerup",Cr,!0)):(document.addEventListener("mousedown",Cr,!0),document.addEventListener("mousemove",Cr,!0),document.addEventListener("mouseup",Cr,!0)),Ar=!0}function Nr(){return"pointer"!==Sr}function Lr(t){void 0===t&&(t={});let{isTextInput:r,autoFocus:n}=t,[i,o]=(0,e.useState)(n||Nr());var s,a,u;return s=e=>{o(e)},a=[r],u={isTextInput:r},Dr(),(0,e.useEffect)((()=>{let e=(e,t)=>{(function(e,t,r){return!(e&&"keyboard"===t&&r instanceof KeyboardEvent&&!Tr[r.key])})(null==u?void 0:u.isTextInput,e,t)&&s(Nr())};return Mr.add(e),()=>Mr.delete(e)}),a),{isFocusVisible:i}}"undefined"!==typeof document&&("loading"!==document.readyState?Dr():document.addEventListener("DOMContentLoaded",Dr));function Kr(e){if(!e)return;let t=!0;return r=>{let n=a({},r,{preventDefault(){r.preventDefault()},isDefaultPrevented:()=>r.isDefaultPrevented(),stopPropagation(){console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.")},continuePropagation(){t=!1}});e(n),t&&r.stopPropagation()}}var Ur=function(e,t){"function"!==typeof e?e.current=t:e(t)};const jr=function(t,r){var n=(0,e.useRef)();return(0,e.useCallback)((function(e){t.current=e,n.current&&Ur(n.current,null),n.current=r,r&&Ur(r,e)}),[r])};const qr=e.useLayoutEffect;const Fr=function(t){var r=(0,e.useRef)(t);return qr((function(){r.current=t})),r};document;e.useLayoutEffect;var zr=function(){return zr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},zr.apply(this,arguments)};var Vr=function(e,t){return function(r){return Math.max(Math.min(r,t),e)}},Hr=function(e){return e%1?Number(e.toFixed(5)):e},Gr=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i,Wr={test:function(e){return"number"===typeof e},parse:parseFloat,transform:function(e){return e}},Yr=zr(zr({},Wr),{transform:Vr(0,1)}),Zr=(zr(zr({},Wr),{default:1}),function(e){return{test:function(t){return"string"===typeof t&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}}),Xr=(Zr("deg"),Zr("%")),Jr=(Zr("px"),Zr("vh"),Zr("vw"),zr(zr({},Xr),{parse:function(e){return Xr.parse(e)/100},transform:function(e){return Xr.transform(100*e)}}),Vr(0,255)),Qr=function(e){return void 0!==e.red},$r=function(e){return void 0!==e.hue};var en=function(e){return function(t){if("string"!==typeof t)return t;for(var r={},n=function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))}(t).replace(/(,|\/)/g," ").split(/ \s*/),i=0;i<4;i++)r[e[i]]=void 0!==n[i]?parseFloat(n[i]):1;return r}},tn=zr(zr({},Wr),{transform:function(e){return Math.round(Jr(e))}});function rn(e,t){return e.startsWith(t)&&Gr.test(e)}var nn={test:function(e){return"string"===typeof e?rn(e,"rgb"):Qr(e)},parse:en(["red","green","blue","alpha"]),transform:function(e){var t=e.red,r=e.green,n=e.blue,i=e.alpha,o=void 0===i?1:i;return function(e){var t=e.red,r=e.green,n=e.blue,i=e.alpha;return"rgba("+t+", "+r+", "+n+", "+(void 0===i?1:i)+")"}({red:tn.transform(t),green:tn.transform(r),blue:tn.transform(n),alpha:Hr(Yr.transform(o))})}};en(["hue","saturation","lightness","alpha"]),zr(zr({},nn),{test:function(e){return"string"===typeof e&&rn(e,"#")},parse:function(e){var t="",r="",n="";return e.length>4?(t=e.substr(1,2),r=e.substr(3,2),n=e.substr(5,2)):(t=e.substr(1,1),r=e.substr(2,1),n=e.substr(3,1),t+=t,r+=r,n+=n),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}});var on=0;"undefined"!==typeof window&&window.requestAnimationFrame;var sn=function(e){return function(t,r,n){return void 0!==n?e(t,r,n):function(n){return e(t,r,n)}}},an=sn((function(e,t,r){return Math.min(Math.max(r,e),t)}));var un=function(e){return e},cn=function(e){return void 0===e&&(e=un),sn((function(t,r,n){var i=r-n,o=-(0-t+1)*(0-e(Math.abs(i)));return i<=0?r+o:r-o}))};cn(),cn(Math.sqrt),sn((function(e,t,r){var n=t-e;return((r-e)%n+n)%n+e})),an(0,1);__webpack_require__(12951);__webpack_require__(72042);__webpack_require__(39648),document.documentElement.currentStyle;var hn,ln="undefined"!==typeof document;!function(){if(void 0!==hn)return hn;if(!ln)return hn=!1,!1;var e=!1,t={get passive(){e=!0}},r=function(){};window.addEventListener("t",r,t),window.removeEventListener("t",r,t),hn=e}();var fn=new Map,dn=(0,e.createContext)(fn);dn.Provider;window.MutationObserver||window.WebKitMutationObserver;function pn(e){return pn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},pn(e)}function yn(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function gn(e,t,r){return gn=yn()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&wt(i,r.prototype),i},gn.apply(null,arguments)}function mn(e){var t="function"===typeof Map?new Map:void 0;return mn=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("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return gn(e,arguments,pn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),wt(n,e)},mn(e)}var bn=function(e){function t(t){return Nt(e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this)}return _t(t,e),t}(mn(Error));function vn(e){return Math.round(255*e)}function wn(e,t,r){return vn(e)+","+vn(t)+","+vn(r)}function _n(e,t,r,n){if(void 0===n&&(n=wn),0===t)return n(r,r,r);var i=(e%360+360)%360/60,o=(1-Math.abs(2*r-1))*t,s=o*(1-Math.abs(i%2-1)),a=0,u=0,c=0;i>=0&&i<1?(a=o,u=s):i>=1&&i<2?(a=s,u=o):i>=2&&i<3?(u=o,c=s):i>=3&&i<4?(u=s,c=o):i>=4&&i<5?(a=s,c=o):i>=5&&i<6&&(a=o,c=s);var h=r-o/2;return n(a+h,u+h,c+h)}var En={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var Sn=/^#[a-fA-F0-9]{6}$/,Mn=/^#[a-fA-F0-9]{8}$/,An=/^#[a-fA-F0-9]{3}$/,In=/^#[a-fA-F0-9]{4}$/,kn=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,Tn=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,Rn=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,Pn=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function Cn(e){if("string"!==typeof e)throw new bn(3);var t=function(e){if("string"!==typeof e)return e;var t=e.toLowerCase();return En[t]?"#"+En[t]:e}(e);if(t.match(Sn))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(Mn)){var r=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:r}}if(t.match(An))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(In)){var n=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:n}}var i=kn.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=Tn.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])};var s=Rn.exec(t);if(s){var a="rgb("+_n(parseInt(""+s[1],10),parseInt(""+s[2],10)/100,parseInt(""+s[3],10)/100)+")",u=kn.exec(a);if(!u)throw new bn(4,t,a);return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10)}}var c=Pn.exec(t.substring(0,50));if(c){var h="rgb("+_n(parseInt(""+c[1],10),parseInt(""+c[2],10)/100,parseInt(""+c[3],10)/100)+")",l=kn.exec(h);if(!l)throw new bn(4,t,h);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10),alpha:parseFloat(""+c[4])}}throw new bn(5)}function On(e){return function(e){var t,r=e.red/255,n=e.green/255,i=e.blue/255,o=Math.max(r,n,i),s=Math.min(r,n,i),a=(o+s)/2;if(o===s)return void 0!==e.alpha?{hue:0,saturation:0,lightness:a,alpha:e.alpha}:{hue:0,saturation:0,lightness:a};var u=o-s,c=a>.5?u/(2-o-s):u/(o+s);switch(o){case r:t=(n-i)/u+(n<i?6:0);break;case n:t=(i-r)/u+2;break;default:t=(r-n)/u+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:c,lightness:a,alpha:e.alpha}:{hue:t,saturation:c,lightness:a}}(Cn(e))}var xn=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function Bn(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function Dn(e){return Bn(Math.round(255*e))}function Nn(e,t,r){return xn("#"+Dn(e)+Dn(t)+Dn(r))}function Ln(e,t,r){return _n(e,t,r,Nn)}function Kn(e,t,r){if("number"===typeof e&&"number"===typeof t&&"number"===typeof r)return Ln(e,t,r);if("object"===typeof e&&void 0===t&&void 0===r)return Ln(e.hue,e.saturation,e.lightness);throw new bn(1)}function Un(e,t,r,n){if("number"===typeof e&&"number"===typeof t&&"number"===typeof r&&"number"===typeof n)return n>=1?Ln(e,t,r):"rgba("+_n(e,t,r)+","+n+")";if("object"===typeof e&&void 0===t&&void 0===r&&void 0===n)return e.alpha>=1?Ln(e.hue,e.saturation,e.lightness):"rgba("+_n(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new bn(2)}function jn(e,t,r){if("number"===typeof e&&"number"===typeof t&&"number"===typeof r)return xn("#"+Bn(e)+Bn(t)+Bn(r));if("object"===typeof e&&void 0===t&&void 0===r)return xn("#"+Bn(e.red)+Bn(e.green)+Bn(e.blue));throw new bn(6)}function qn(e,t,r,n){if("string"===typeof e&&"number"===typeof t){var i=Cn(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}if("number"===typeof e&&"number"===typeof t&&"number"===typeof r&&"number"===typeof n)return n>=1?jn(e,t,r):"rgba("+e+","+t+","+r+","+n+")";if("object"===typeof e&&void 0===t&&void 0===r&&void 0===n)return e.alpha>=1?jn(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new bn(7)}function Fn(e){if("object"!==typeof e)throw new bn(8);if(function(e){return"number"===typeof e.red&&"number"===typeof e.green&&"number"===typeof e.blue&&"number"===typeof e.alpha}(e))return qn(e);if(function(e){return"number"===typeof e.red&&"number"===typeof e.green&&"number"===typeof e.blue&&("number"!==typeof e.alpha||"undefined"===typeof e.alpha)}(e))return jn(e);if(function(e){return"number"===typeof e.hue&&"number"===typeof e.saturation&&"number"===typeof e.lightness&&"number"===typeof e.alpha}(e))return Un(e);if(function(e){return"number"===typeof e.hue&&"number"===typeof e.saturation&&"number"===typeof e.lightness&&("number"!==typeof e.alpha||"undefined"===typeof e.alpha)}(e))return Kn(e);throw new bn(8)}function zn(e,t,r){return function(){var n=r.concat(Array.prototype.slice.call(arguments));return n.length>=t?e.apply(this,n):zn(e,t,n)}}function Vn(e){return zn(e,e.length,[])}function Hn(e,t,r){return Math.max(e,Math.min(t,r))}function Gn(e,t){if("transparent"===t)return t;var r=On(t);return Fn(a({},r,{lightness:Hn(0,1,r.lightness-parseFloat(e))}))}var Wn=Vn(Gn);new Map;const Yn=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"];Yn.join(":not([hidden]),");Yn.push('[tabindex]:not([tabindex="-1"]):not([disabled])');Yn.join(':not([hidden]):not([tabindex="-1"]),');let Zn=e.createContext(null);function Xn(t,r){let{focusProps:n}=function(e){if(e.isDisabled)return{focusProps:{}};let t,r;return(e.onFocus||e.onFocusChange)&&(t=t=>{t.target===t.currentTarget&&(e.onFocus&&e.onFocus(t),e.onFocusChange&&e.onFocusChange(!0))}),(e.onBlur||e.onFocusChange)&&(r=t=>{t.target===t.currentTarget&&(e.onBlur&&e.onBlur(t),e.onFocusChange&&e.onFocusChange(!1))}),{focusProps:{onFocus:t,onBlur:r}}}(t),{keyboardProps:i}=function(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:Kr(e.onKeyDown),onKeyUp:Kr(e.onKeyUp)}}}(t),o=Xt(n,i),s=function(t){let r=(0,e.useContext)(Zn)||{};return or(r,t),bt(r,["ref"])}(r),u=t.isDisabled?{}:s,c=(0,e.useRef)(t.autoFocus);return(0,e.useEffect)((()=>{c.current&&r.current&&r.current.focus(),c.current=!1}),[]),{focusableProps:Xt(a({},o,{tabIndex:t.excludeFromTabOrder&&!t.isDisabled?-1:void 0}),u)}}function Jn(e,t){let r,{elementType:n="button",isDisabled:i,onPress:o,onPressStart:s,onPressEnd:a,onPressChange:u,preventFocusOnPress:c,onClick:h,href:l,target:f,rel:d,type:p="button"}=e;r="button"===n?{type:p,disabled:i}:{role:"button",tabIndex:i?void 0:0,href:"a"===n&&i?void 0:l,target:"a"===n?f:void 0,type:"input"===n?p:void 0,disabled:"input"===n?i:void 0,"aria-disabled":i&&"input"!==n?i:void 0,rel:"a"===n?d:void 0};let{pressProps:y,isPressed:g}=gr({onPressStart:s,onPressEnd:a,onPressChange:u,onPress:o,isDisabled:i,preventFocusOnPress:c,ref:t}),{focusableProps:m}=Xn(e,t),b=Xt(m,y);return b=Xt(b,function(e,t){void 0===t&&(t={});let{labelable:r,propNames:n}=t,i={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(Jt.has(o)||r&&Qt.has(o)||null!=n&&n.has(o)||$t.test(o))&&(i[o]=e[o]);return i}(e,{labelable:!0})),{isPressed:g,buttonProps:Xt(r,b,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],onClick:e=>{h&&(h(e),console.warn("onClick is deprecated, please use onPress"))}})}}const Qn=e.useLayoutEffect;const $n=function(t){var r=(0,e.useRef)(t);return Qn((function(){r.current=t})),r};var ei={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},ti=function(e){Object.keys(ei).forEach((function(t){e.style.setProperty(t,ei[t],"important")}))},ri=null;var ni=function(){},ii=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],oi=!!document.documentElement.currentStyle,si=function(t,r){var n=t.cacheMeasurements,i=t.maxRows,o=t.minRows,s=t.onChange,u=void 0===s?ni:s,c=t.onHeightChange,h=void 0===c?ni:c,l=bt(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]);var f=void 0!==l.value,d=(0,e.useRef)(null),p=jr(d,r),y=(0,e.useRef)(0),g=(0,e.useRef)(),m=function(){var e=d.current,t=n&&g.current?g.current:function(e){var t=window.getComputedStyle(e);if(null===t)return null;var r,n=(r=t,ii.reduce((function(e,t){return e[t]=r[t],e}),{})),i=n.boxSizing;return""===i?null:(oi&&"border-box"===i&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px"),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})}(e);if(t){g.current=t;var r=function(e,t,r,n){void 0===r&&(r=1),void 0===n&&(n=1/0),ri||((ri=document.createElement("textarea")).setAttribute("tabindex","-1"),ri.setAttribute("aria-hidden","true"),ti(ri)),null===ri.parentNode&&document.body.appendChild(ri);var i=e.paddingSize,o=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach((function(e){var t=e;ri.style[t]=s[t]})),ti(ri),ri.value=t;var u=function(e,t){var r=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?r+t.borderSize:r-t.paddingSize}(ri,e);ri.value="x";var c=ri.scrollHeight-i,h=c*r;"border-box"===a&&(h=h+i+o),u=Math.max(h,u);var l=c*n;return"border-box"===a&&(l=l+i+o),[u=Math.min(l,u),c]}(t,e.value||e.placeholder||"x",o,i),s=r[0],a=r[1];y.current!==s&&(y.current=s,e.style.setProperty("height",s+"px","important"),h(s,{rowHeight:a}))}};return(0,e.useLayoutEffect)(m),function(t){var r=$n(t);(0,e.useLayoutEffect)((function(){var e=function(e){r.current(e)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[])}(m),(0,e.createElement)("textarea",a({},l,{onChange:function(e){f||m(),u(e)},ref:p}))};const ai=(0,e.forwardRef)(si);var ui=function(){if("undefined"!==typeof Map)return Map;function e(e,t){var r=-1;return e.some((function(e,n){return e[0]===t&&(r=n,!0)})),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=e(this.__entries__,t),n=this.__entries__[r];return n&&n[1]},t.prototype.set=function(t,r){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=r:this.__entries__.push([t,r])},t.prototype.delete=function(t){var r=this.__entries__,n=e(r,t);~n&&r.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var r=0,n=this.__entries__;r<n.length;r++){var i=n[r];e.call(t,i[1],i[0])}},t}()}(),ci="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,hi="undefined"!==typeof __webpack_require__.g&&__webpack_require__.g.Math===Math?__webpack_require__.g:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")(),li="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(hi):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var fi=["top","right","bottom","left","width","height","size","weight"],di="undefined"!==typeof MutationObserver,pi=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var r=!1,n=!1,i=0;function o(){r&&(r=!1,e()),n&&a()}function s(){li(o)}function a(){var e=Date.now();if(r){if(e-i<2)return;n=!0}else r=!0,n=!1,setTimeout(s,t);i=e}return a}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){ci&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),di?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){ci&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;fi.some((function(e){return!!~r.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),yi=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},gi=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||hi},mi=Si(0,0,0,0);function bi(e){return parseFloat(e)||0}function vi(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce((function(t,r){return t+bi(e["border-"+r+"-width"])}),0)}function wi(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return mi;var n=gi(e).getComputedStyle(e),i=function(e){for(var t={},r=0,n=["top","right","bottom","left"];r<n.length;r++){var i=n[r],o=e["padding-"+i];t[i]=bi(o)}return t}(n),o=i.left+i.right,s=i.top+i.bottom,a=bi(n.width),u=bi(n.height);if("border-box"===n.boxSizing&&(Math.round(a+o)!==t&&(a-=vi(n,"left","right")+o),Math.round(u+s)!==r&&(u-=vi(n,"top","bottom")+s)),!function(e){return e===gi(e).document.documentElement}(e)){var c=Math.round(a+o)-t,h=Math.round(u+s)-r;1!==Math.abs(c)&&(a-=c),1!==Math.abs(h)&&(u-=h)}return Si(i.left,i.top,a,u)}var _i="undefined"!==typeof SVGGraphicsElement?function(e){return e instanceof gi(e).SVGGraphicsElement}:function(e){return e instanceof gi(e).SVGElement&&"function"===typeof e.getBBox};function Ei(e){return ci?_i(e)?function(e){var t=e.getBBox();return Si(0,0,t.width,t.height)}(e):wi(e):mi}function Si(e,t,r,n){return{x:e,y:t,width:r,height:n}}var Mi=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Si(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=Ei(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),Ai=function(e,t){var r=function(e){var t=e.x,r=e.y,n=e.width,i=e.height,o="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(o.prototype);return yi(s,{x:t,y:r,width:n,height:i,top:r,right:t+n,bottom:i+r,left:t}),s}(t);yi(this,{target:e,contentRect:r})},Ii=function(){function e(e,t,r){if(this.activeObservations_=[],this.observations_=new ui,"function"!==typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof gi(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Mi(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof gi(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new Ai(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),ki="undefined"!==typeof WeakMap?new WeakMap:new ui,Ti=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=pi.getInstance(),n=new Ii(t,r,this);ki.set(this,n)};["observe","unobserve","disconnect"].forEach((function(e){Ti.prototype[e]=function(){var t;return(t=ki.get(this))[e].apply(t,arguments)}}));"undefined"!==typeof hi.ResizeObserver&&hi.ResizeObserver;var Ri=function(e){var t={};if(e.flexFill&&(t.flexGrow=1,t.maxWidth="100%"),e.flexFit&&(t.flexGrow=0),e.noShrink&&(t.flexShrink=0),e.ellipsis&&(t.whiteSpace="nowrap",t.overflow="hidden",t.textOverflow="ellipsis"),e.nowrap&&(t.whiteSpace="nowrap"),"isFocusVisible"in e&&(t["&:focus"]={outlineStyle:e.isFocusVisible?"auto":"none"}),e.preserveLines&&(t.whiteSpace="pre-line"),e.textWrap){var r="break-word";t.wordWrap=r,t.overflowWrap=r,t.wordBreak=r}return t},Pi=(0,e.createContext)(),Ci=function(t){var r=t.value,n=t.children;return(0,e.createElement)(Be,{theme:r},(0,e.createElement)(Pi.Provider,{value:r},n))},Oi=function(e){return e.charAt(0)!==e.charAt(0).toLowerCase()},xi=function(e,t){return Oi(t)},Bi=(at.bind(null,xi),ct.bind(null,xi)),Di={},Ni=function(e){return t=function(t){return Oi(t)?"components":Xe(e[t])?"propsDescriptions":"themeProps"},r=e,Object.keys(r).reduce((function(e,n){var i=t(n);return e[i]=e[i]||{},e[i][n]=r[n],e}),{});var t,r},Li=function(e){if(!e)return Di;var t=e.css,r=e.vars,n=bt(e,["css","vars"]);return a({css:t,vars:r},Ni(n))},Ki=function(e){return function(t){return function(r){var n=r[e];if(!n)return r;var i=Li(n),o=i.propsDescriptions,s=i.components;if(!o&&!s)return r;var u=function(e,t,r){void 0===r&&(r={});var n=ct((function(e,r){return t[r]}),r);return Object.keys(n).map((function(t){var r,i=n[t],o=Li(i),s=o.themeProps,u=o.components;if(!s)return u;var c=((r={})[e]=s,r);return u?a({},c,u):c}))}(e,t,o);return function(e){if(0===e.length)return{};var t=e[0];return e.slice(1).reduce((function(e,t){return it(e,t)}),t)}([r,s].concat(u).filter(Boolean))}}},Ui=function(t){var r=t.__ui_kit_name,n=Ki(r);return(0,e.forwardRef)((function(r,i){return(0,e.createElement)(Ci,{value:n(r)},(0,e.createElement)(t,a({},r,{ref:i})))}))},ji=function e(t,r){var n,i,o,s=(n=Xe,i=r,Object.keys(i).reduce((function(e,t){return n(i[t])&&(e[t]=i[t]),e}),{}));return 0===Object.keys(s)?r:(o=function(e,t){return Object.keys(t).reduce((function(r,n){return r[n]=e(t[n],n),r}),{})}((function(r,n){return Xe(r)?":"===n[0]?e(t,r):r[Qe((function(e){return t[e]}),Object.keys(r))]||r.default:r}),r),Ze(o)?o.filter((function(e){return null!==e&&void 0!==e})):Object.keys(o).reduce((function(e,t){var r=o[t];return null!==r&&void 0!==r&&(e[t]=r),e}),{}))},qi=function(e,t,r){var n=e.theme,i=e.style,o=Li(n[t]),s=o.css,u=o.vars,c=o.themeProps;return[u?a({},n.vars,u):n.vars,"function"===typeof r&&void 0!==c&&r(c),s&&ji(e,s),Ri(e),"function"===typeof r&&r(a({},c,e)),i]},Fi=function(e,t){void 0===t&&(t={});var r=t,n=r.displayName,i=r.displayType,o=r.mapPropsToStyles;var s=Ge(e,t);return function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];if(r.length>0&&void 0!==r[0].raw){var u=r;r=[u[0][0]];for(var c=1;c<u.length;c++)r.push(u[c],u[0][c])}var h=n||i||null,l=s.apply(void 0,r.concat([function(e){return qi(e,h,o)}]));return l.__ui_kit_name=h,t.section?Object.defineProperty(Ui(l),"toString",{value:l.toString}):l}};var zi=Fi("div",{displayName:"FixedWrapperMaximized",mapPropsToStyles:function(e){var t={};return e.theme&&(t.right="right"===e.theme.FixedWrapperRoot.position?"0":"auto",t.left="left"===e.theme.FixedWrapperRoot.position?"0":"auto"),e.animationDuration&&(t.transition="all "+e.animationDuration+"ms ease-out"),e.state&&(t.transform="entered"===e.state?"none":"scale(0.8) translate(10%, 30%)",t.opacity="entered"===e.state?"1":"0"),e.height&&(t.height=e.height),e.width&&(t.width=e.width),t},target:"ep7mz240"})({name:"1jmpskd",styles:"display:flex;flex-direction:column;max-height:100vh;position:absolute;bottom:0;@media (max-width: 490px){width:100%;height:100%;position:fixed;}"}),Vi=function(t){var r=Oe();return(0,e.createElement)(Ct,{in:t.active,mountOnEnter:!0,timeout:r.FixedWrapperMaximized.animationDuration,unmountOnExit:!0},(function(r){return(0,e.createElement)(zi,a({},t,{state:r}),e.Children.map(t.children,(function(r){return(0,e.cloneElement)(r,{minimize:t.minimize})})))}))};Vi.propTypes={active:vt.bool,children:vt.node.isRequired,minimize:vt.func,style:(0,vt.shape)()};var Hi=Fi("div",{displayName:"FixedWrapperMinimized",mapPropsToStyles:function(e){var t=e.state,r=e.theme,n={};return r&&(n.transition="all "+r.FixedWrapperMaximized.animationDuration+"ms ease-out",n.right="right"===r.FixedWrapperRoot.position?"0":"auto",n.left="left"===r.FixedWrapperRoot.position?"0":"auto"),t&&(n.transform="entered"===t?"none":"scale(0.8) translate(10%, 30%)",n.opacity="entered"===t?"1":"0"),n},target:"eq1nrcm0"})({name:"m2cnsn",styles:"width:60px;height:60px;position:absolute;bottom:1em"}),Gi=function(t){var r=Oe();return(0,e.createElement)(Ct,{in:t.active,mountOnEnter:!0,timeout:r.FixedWrapperMinimized.animationDuration,unmountOnExit:!0},(function(r){return(0,e.createElement)(Hi,a({},t,{state:r}),e.Children.map(t.children,(function(r){return(0,e.cloneElement)(r,{maximize:t.maximize})})))}))};Gi.propTypes={active:vt.bool,children:vt.node.isRequired,maximize:vt.func,style:(0,vt.shape)()};var Wi=Fi("div",{displayName:"FixedWrapperRoot",mapPropsToStyles:function(e){var t={};return"right"===e.position?(t.right="1em",t.left="auto"):"left"===e.position&&(t.right="auto",t.left="1em"),t},target:"e7t7c040"})({name:"1inca8e",styles:"position:fixed;bottom:0;z-index:99;font-size:16px"}),Yi=function(t){var r=(0,e.useState)(t.maximizedOnInit),n=r[0],i=r[1];return(0,e.createElement)(Wi,t,(0,e.createElement)("div",null,e.Children.map(t.children,(function(t){return t.type===Vi?(0,e.cloneElement)(t,{minimize:function(){return i(!1)},active:n}):t.type===Gi?(0,e.cloneElement)(t,{maximize:function(){return i(!0)},active:!n}):t}))))};Yi.defaultProps={maximizedOnInit:!1},Yi.propTypes={children:vt.node.isRequired,maximizedOnInit:vt.bool,style:(0,vt.shape)()};var Zi=Fi("div",{mapPropsToStyles:function(e){var t={};return e.verticalAlign&&("top"===e.verticalAlign?t.alignItems="flex-start":"bottom"===e.verticalAlign?t.alignItems="flex-end":t.alignItems=e.verticalAlign),e.justify&&(!0===e.justify?t.justifyContent="space-between":"left"===e.justify?t.justifyContent="flex-start":"right"===e.justify?t.justifyContent="flex-end":t.justifyContent=e.justify),e.reverse&&(t.flexDirection="row-reverse"),t},target:"e108e6fy0"})({name:"14u08z3",styles:"display:flex;min-width:0"});vt.bool,vt.node.isRequired;vt.node;var Xi,Ji=function(e){var t=e.color;return t?{fill:t,"& *":{fill:t}}:null},Qi=(Xi=function(e){return Fi(e,{displayType:"Icon",mapPropsToStyles:Ji,shouldForwardProp:h,target:"e5ibypu0"})({name:"y0b0au",styles:"&{display:block;}&,& *{fill:currentColor;}"})},function(e,t){var r={};return function(){var n=e.apply(void 0,arguments);if(Ye(n,r))return r[n];var i=t.apply(void 0,arguments);return r[n]=i,i}}(et,Xi)),$i=function(t){var r=t.children,n=bt(t,["children"]),i=Qi(r.type);return(0,e.createElement)(i,n)};$i.propTypes={children:vt.node.isRequired};var eo=function(t){return(0,e.createElement)("svg",a({viewBox:"0 0 58 58",style:{enableBackground:"new 0 0 58 58"}},t),(0,e.createElement)("rect",{style:{fillRule:"evenodd",clipRule:"evenodd",fill:"#F2F2F2"},width:"58",height:"58"}),(0,e.createElement)("path",{style:{fillRule:"evenodd",clipRule:"evenodd",fill:"#424D57"},d:"M40,38c7.3,3.8,11,8.4,11,13.9v6c0,0.2-0.1,0.3-0.2,0.4C47.9,62,6.1,62,6.1,58l0-0.1l0-0.1 v-6c0-5.5,3.7-10.1,11-13.9c1.2-0.7,2-0.2,2-0.2c2.5,2.3,5.8,3.7,9.5,3.7l-0.1,0l0.3,0c3.5-0.1,6.7-1.5,9.1-3.7 C38,37.8,38.8,37.3,40,38z M28.5,17C34.3,17,39,21.7,39,27.5S34.3,38,28.5,38S18,33.3,18,27.5S22.7,17,28.5,17z"}))},to=function(t){return(0,e.createElement)($i,t,(0,e.createElement)(eo,null))},ro=function(t){return(0,e.createElement)("svg",a({height:"18px",viewBox:"0 0 21 18",width:"21px"},t),(0,e.createElement)("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},(0,e.createElement)("g",{fill:"#000000"},(0,e.createElement)("polygon",{points:"0.01 18 21 9 0.01 0 0 7 15 9 0 11"}))))},no=function(t){return(0,e.createElement)($i,t,(0,e.createElement)(ro,null))};function io(){var e=zt(["\n\t0% {\n\t\topacity: 1.0;\n\t}\n\n\t50% {\n\t\topacity: 0.4;\n\t}\n\n\t100% {\n\t\topacity: 1.0;\n\t}\n"]);return io=function(){return e},e}var oo=function(){var e=dt.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(io()),so=dt("animation:1.5s ease-in-out 0s infinite;animation-name:",oo,";");var ao=Fi("div",{target:"e11eolwx0"})({name:"3st5dg",styles:"width:100vw;max-width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#e5e5e5"}),uo={name:"1t9hbt0",styles:"width:32px;height:32px;fill:currentColor"},co=function(e){return ft(ao,e,ft("svg",{viewBox:"0 0 32 32",css:[uo,so,""]},ft("path",{d:"M6.1,22.1l5.3-4.8c0.4-0.3,1-0.3,1.3,0l3.2,2.8l6.5-5.8c0.4-0.3,1-0.3,1.3,0l2.3,2.1V9c0-0.6-0.4-1-1-1h-18 c-0.6,0-1,0.4-1,1L6.1,22.1C6.1,22,6.1,22,6.1,22.1z M8,23h8.1l-4.1-3.7L8,23z M19.1,23h5.9c0.6,0,1-0.4,1-1v-3l-3-2.7l-5.7,5.1 L19.1,23z M7.1,6h18c1.7,0,3,1.3,3,3v13c0,1.7-1.3,3-3,3h-18c-1.7,0-3-1.3-3-3V9C4.1,7.3,5.4,6,7.1,6z M15.1,16c-1.7,0-3-1.3-3-3 s1.3-3,3-3s3,1.3,3,3S16.8,16,15.1,16z M15.1,14c0.6,0,1-0.4,1-1s-0.4-1-1-1c-0.6,0-1,0.4-1,1S14.5,14,15.1,14z"})))},ho=function(e){return ft(ao,e,ft("svg",{viewBox:"0 0 32 32",css:uo},ft("path",{d:"M3.6,5.1L3.6,5.1l24.1,21.1c0.4,0.4,0.5,1,0.1,1.4c-0.3,0.4-0.9,0.4-1.3,0.2l-0.1-0.1l-8.1-7.1l-2,1.8 l1.7,1.5h4l2.3,2l-0.1,0L24,26H6c-1.6,0-2.9-1.2-3-2.8L3,23L3,7.3L2.3,6.7c-0.4-0.4-0.5-1-0.1-1.4C2.6,4.9,3.1,4.9,3.6,5.1z M11,20.3L6.9,24h8.1L11,20.3z M26,5c1.6,0,2.9,1.2,3,2.8L29,8v15.4l0,0l-2-1.7l0-3.7l-3-2.7l-2.2,2L20.3,16l3.1-2.8 c0.3-0.3,0.9-0.3,1.2-0.1l0.1,0.1l2.3,2.1V8c0-0.5-0.4-0.9-0.9-1L26,7H10L7.7,5l0.1,0L8,5H26z M5,9.1l0,14l5.3-4.8 c0.3-0.3,0.9-0.3,1.2-0.1l0.1,0.1l3.2,2.8l1.9-1.7L5,9.1z M20,8c1.7,0,3,1.3,3,3s-1.3,3-3,3s-3-1.3-3-3S18.3,8,20,8z M20,10 c-0.6,0-1,0.4-1,1s0.4,1,1,1s1-0.4,1-1S20.6,10,20,10z"})))};function lo(){var e=zt(["\n\t&-enter {\n\t\topacity: 0;\n\t\theight: 0;\n\t}\n\n\t&-enter&-enter-active {\n\t\topacity: 1;\n\t\theight: 1.2em;\n\t\ttransition: height 200ms ease-in-out, opacity 100ms ease-in-out 100ms;\n\t}\n\n\t&-exit {\n\t\topacity: 1;\n\t\theight: 1.2em;\n\t}\n\n\t&-exit&-exit-active {\n\t\topacity: 0;\n\t\theight: 0;\n\t\ttransition: height 100ms ease-in-out 100ms, opacity 200ms ease-in-out;\n\t}\n"]);return lo=function(){return e},e}var fo=function(e){return e(lo())},po=function(t){return(0,e.createElement)(mt,null,(function(r){var n=r.css;return(0,e.createElement)(Dt,a({},t,{classNames:fo(n),timeout:200}))}))};function yo(){var e=zt(["\n\t&-enter {\n\t\topacity: 0;\n\t\ttransform: scale(1.2);\n\t}\n\n\t&-enter-active {\n\t\topacity: 1;\n\t\ttransform: scale(1);\n\t\ttransition: opacity ","ms ",", transform ","ms ",";\n\t}\n\n\t&-enter-done {\n\t\topacity: 1;\n\t\ttransform: scale(1);\n\t}\n"]);return yo=function(){return e},e}po.propTypes={children:vt.node};var go="cubic-bezier(0.14, 0, 0, 1)",mo=function(e){return e(yo(),200,go,200,go)},bo=function(t){return(0,e.createElement)(mt,null,(function(r){var n=r.css;return(0,e.createElement)(Dt,a({},t,{classNames:mo(n),timeout:500}))}))},vo=function(t){var r=t.children,n=t.src,i=t.srcSet,o=(t.scaleImage,t.className),s=t.alt,u=void 0===s?"":s,c=bt(t,["children","src","srcSet","scaleImage","className","alt"]),h=(0,e.useState)("pending"),l=h[0],f=h[1],d=(0,e.useState)(!1),p=d[0],y=d[1],g=(0,e.useRef)(0),m="loaded"===l,b=null;if(r)b=r({imageStatus:l,shouldAnimate:p});else switch(l){case"pending":b=(0,e.createElement)(co,c);break;case"failed":b=(0,e.createElement)(ho,c);break;default:b=null}return(0,e.useLayoutEffect)((function(){return f("pending"),y(!1),g.current=setTimeout((function(){return y(!0)}),300),function(){return clearTimeout(g.current)}}),[n,i]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(bo,{in:p&&m},(0,e.createElement)("img",a({alt:u},c,{src:n,srcSet:i,className:o,onLoad:function(){f("loaded"),clearTimeout(g.current)},onError:function(){return f("failed")},style:a({},!m&&{display:"none"})}))),b)};vo.propTypes={children:vt.func};var wo={name:"1wtwico",styles:"display:block;border-radius:inherit;width:100%;height:100%;object-fit:cover"},_o=Fi("div",{displayName:"Avatar",mapPropsToStyles:function(e){var t={},r={},n=e.size,i=e.radius,o=e.fontSize;return n&&(t.width=n,t.height=n,t.lineHeight=n),i&&(t.borderRadius=i,r.borderRadius=i),o&&(t.fontSize=o),a({},t,{"& img":r})},target:"e11ezd0e0"})({name:"1f2to7",styles:"border:1px solid #fff;border-radius:50%;text-align:center;background-color:#fff;text-transform:uppercase;overflow:hidden"}),Eo=function(e){var t=e.imgUrl,r=e.letter,n=null;return t||r?t?n=ft(vo,{src:t,css:wo,alt:"avatar"},(function(e){var t=e.imageStatus,r=e.shouldAnimate;switch(t){case"pending":return ft(to,{css:[wo,r&&so,""]});case"failed":return ft(to,{css:wo});default:return null}})):r&&(n=ft("span",null,r)):n=ft("div",{css:wo},ft(to,{css:wo})),ft(_o,e,n)};Eo.propTypes={imgUrl:vt.string,letter:vt.string,size:vt.string,style:(0,vt.shape)()};var So={name:"1oep8ze",styles:"&>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit;border-bottom-right-radius:0;border-bottom-left-radius:0;}&>:last-child{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:inherit;border-bottom-left-radius:inherit;}&>:first-child:last-child{border-top-left-radius:inherit;border-top-right-radius:inherit;border-bottom-right-radius:inherit;border-bottom-left-radius:inherit;}"},Mo=Fi("div",{displayName:"Bubble",mapPropsToStyles:function(e){var t=e.isOwn,r=e.ovalBorderRadius,n=e.sharpBorderRadius,i=e.radiusType,o={borderTopLeftRadius:"single"===i||"first"===i?r:n,borderTopRightRadius:r,borderBottomRightRadius:r,borderBottomLeftRadius:"single"===i||"last"===i?r:n};return t?function(e){var t=e.borderTopLeftRadius,r=e.borderTopRightRadius,n=e.borderBottomRightRadius;return{borderTopLeftRadius:r,borderTopRightRadius:t,borderBottomRightRadius:e.borderBottomLeftRadius,borderBottomLeftRadius:n}}(o):o},target:"emwkn670"})(So,";border:1px solid rgba(0, 0, 0, 0.05);display:inline-block;max-width:100%;margin-bottom:0.1em;& img{max-width:100%;display:block;}");Mo.propTypes={children:vt.node,isOwn:vt.bool,radiusType:(0,vt.oneOf)(["single","first","last"])};var Ao=Fi("div",{mapPropsToStyles:function(e){return{flexShrink:e.shrink?1:0}},target:"e1jdwequ0"})(""),Io=function(t){return(0,e.createElement)(Ao,a({flexFill:!0},t))};Io.defaultProps={shrink:!0},Io.propTypes={shrink:vt.bool};var ko=Fi("div",{mapPropsToStyles:function(e){return{flexShrink:e.shrink?1:0}},target:"e1yi1p4d0"})(""),To=function(t){return(0,e.createElement)(ko,a({flexFit:!0},t))};To.defaultProps={shrink:!0},To.propTypes={shrink:vt.bool};var Ro=Fi("button",{displayName:"IconButton",section:!0,target:"e1m5b1js0"})("appearance:none;background:transparent;border:0;display:inline-block;margin:0;padding:0.5em;color:inherit;&:hover{cursor:",(function(e){return e.disabled?"default":"pointer"}),";}"),Po=(0,e.forwardRef)((function(t,r){var n=Lr();return(0,e.createElement)(Ro,a({ref:r},n,t))}));Po.propTypes={active:vt.bool,disabled:vt.bool,children:vt.node.isRequired,color:vt.string,onClick:vt.func};var Co=function(e){return e.getBoundingClientRect().top+window.pageYOffset};var Oo=(0,e.createContext)({registerUnseenListItem:st,isScrollOnBottom:st,scrollToBottom:st}),xo=Oo.Provider,Bo=Oo.Consumer,Do=function(e){void 0===e&&(e=0);var t=e;return function(){return t++}}(),No=Fi("div",{displayName:"MessageList",target:"e1i3n9g60"})({name:"1qptc4e",styles:"padding:0.5em;overflow-y:auto;height:100%;outline-offset:-5px"}),Lo=(0,e.forwardRef)((function(t,r){var n=t.active,i=void 0===n||n,o=t.onScroll,s=bt(t,["active","onScroll"]),u=(0,e.useRef)(),c=jr(u,r),h=function(){var t=(0,e.useRef)([]),r=(0,e.useCallback)((function(e){var r=Do(),n=t.current;return n.push(a({},e,{id:r})),function(){var e=$e((function(e){return e.id===r}),n);-1!==e&&n.splice(e,1)}}),[]);return{getAll:function(){return t.current},registerItem:r}}(),l=h.getAll,f=h.registerItem,d=Fr(i),p=Fr(o),y=Lr(),g=(0,e.useCallback)((function(){l().forEach((function(e){var t,r;(t=u.current,r=e.ref,Co(r)-Co(t)+r.clientHeight<=t.clientHeight)&&e.onSeen()}))}),[l]),m=(0,e.useMemo)((function(){return function(e,t){var r,n=Date.now()-2*e,i=function(){n=Date.now(),t.apply(void 0,arguments)};return function(){for(var t=Date.now(),o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];t-n>=e?i.apply(void 0,s):(clearTimeout(r),r=setTimeout.apply(void 0,[i,n-t+e].concat(s)))}}(300,(function(){d.current&&g()}))}),[d,g]),b=(0,e.useCallback)((function(e){m(),p.current&&p.current(e)}),[p,m]);(0,e.useEffect)((function(){i&&g()}),[i,g]);var v=(0,e.useMemo)((function(){return{registerUnseenListItem:f,isScrollOnBottom:function(){return function(e,t){return void 0===t&&(t=0),e.scrollTop+e.clientHeight-e.scrollHeight>=-t}(u.current,20)},scrollToBottom:function(){var e;(e=u.current).scrollTop=e.scrollHeight}}}),[f]);return(0,e.createElement)(xo,{value:v},(0,e.createElement)(No,a({},y,s,{ref:c,onScroll:b,role:"grid","aria-live":"polite","aria-relevant":"additions"})))})),Ko=function(t){function r(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this)._unregisterFromMessageList=st,e._registerInMessageList=ot((function(t){return function(r){e._unregisterFromMessageList(),r&&(e._unregisterFromMessageList=t({ref:r,onSeen:e.props.onSeen}))}})),e}_t(r,t);var n=r.prototype;return n.componentWillUnmount=function(){this._unregisterFromMessageList()},n.render=function(){var t=this;return(0,e.createElement)(Bo,null,(function(r){var n=r.registerUnseenListItem;return(0,e.createElement)("div",{ref:t.props.seen?null:t._registerInMessageList(n),role:"row"},e.Children.only(t.props.children))}))},r}(e.Component);Ko.propTypes={children:vt.node.isRequired,onSeen:vt.func},Ko.defaultProps={onSeen:st};var Uo=Fi("div",{displayName:"Message",mapPropsToStyles:function(e){var t=e.horizontalAlign;return t?{flexDirection:"left"===t?"row":"row-reverse"}:null},section:!0,target:"e10ccb475"})({name:"gsl41n",styles:"display:flex;align-items:flex-start;font-size:0.9em;margin:0.3em;max-width:100%"}),jo=Fi("span",{displayName:"AuthorName",target:"e10ccb474"})({name:"1rawn5e",styles:"font-size:0.8em"}),qo=Fi("div",{displayName:"MessageMeta",target:"e10ccb473"})({name:"1flj9lk",styles:"text-align:left"}),Fo=Fi("div",{displayName:"Content",target:"e10ccb472"})({name:"fabj5c",styles:"display:flex;flex-direction:column;overflow:hidden;align-items:flex-start"}),zo=Fi("span",{displayName:"Time",target:"e10ccb471"})({name:"1rawn5e",styles:"font-size:0.8em"}),Vo=Fi("div",{displayName:"Status",target:"e10ccb470"})({name:"5m4wg",styles:"text-align:right;font-size:0.8em"}),Ho={name:"oldbq4",styles:"user-select:none"},Go=(0,e.forwardRef)((function(t,r){var n=t.children,i=t.authorName,o=t.deliveryStatus,s=void 0===o?"":o,u=t.isOwn,c=t.date,h=t.showMetaOnClick,l=t.onSeen,f=(t.radiusType,t.seen),d=t.enforceDeliveryStatusDisplay,p=t.onClick,y=void 0===p?st:p,g=t.onKeyUp,m=void 0===g?st:g,b=bt(t,["children","authorName","deliveryStatus","isOwn","date","showMetaOnClick","onSeen","radiusType","seen","enforceDeliveryStatusDisplay","onClick","onKeyUp"]),v=Lr(),w=function(t){var r=(0,e.useState)(t),n=r[0],i=r[1];return[n,(0,e.useCallback)((function(){i((function(e){return!e}))}),[])]}(!1),_=w[0],E=w[1];return ft(Ko,{onSeen:l,seen:f},ft(Uo,a({ref:r,"aria-expanded":h?_:null},b,{onKeyUp:function(e){m(e),"Enter"!==e.key&&" "!==e.key||E()},onClick:function(e){y(e),E()},own:u,tabIndex:null}),ft(Fo,a({role:"gridcell"},v),ft(Ft,null,(!h||_)&&ft(po,null,ft(qo,null,i&&ft(jo,null,i," "),c&&ft(zo,null,c)))),n,s?ft(Vo,null,s):d?ft(Vo,{css:Ho},"\xa0"):null)))}));Go.propTypes={authorName:(0,vt.oneOfType)([vt.string,vt.node]),authorOpen:vt.bool,children:vt.node,date:vt.string,deliveryStatus:vt.string,enforceDeliveryStatusDisplay:vt.bool,isOwn:vt.bool,onClick:vt.func,onSeen:vt.func,showMetaOnClick:vt.bool,style:(0,vt.shape)(),toggleAuthor:vt.func,radiusType:(0,vt.oneOf)(["single","first","last"]),seen:vt.bool},Go.defaultProps={onClick:st,seen:!1};var Wo=Fi("div",{displayName:"SubTitle",target:"e1fut3qs0"})({name:"1ecjc06",styles:"font-weight:300;opacity:0.7"});Wo.defaultProps={textWrap:!0};var Yo=Fi("div",{displayName:"Title",target:"e9xf8br0"})({name:"mmvz9h",styles:"font-weight:400"});Yo.defaultProps={textWrap:!0};ut(console.warn.bind(console));var Zo=Fi("div",{displayName:"MessageTitle",target:"e1ykjxgu0"})({name:"1kj42yy",styles:"font-weight:600;padding:1em"}),Xo={name:"11rcwxl",styles:"margin-bottom:4px"},Jo=function(e){var t=e.children,r=e.title,n=e.subtitle,i=bt(e,["children","title","subtitle"]);var o=t||[r&&ft(Yo,{key:"title",preserveLines:!0,css:Xo},r),n&&ft(Wo,{key:"subtitle",preserveLines:!0},n)];return ft(Zo,i,o)};Jo.propTypes={children:(0,vt.oneOfType)([(0,vt.arrayOf)(vt.node),vt.node]),subtitle:vt.string,title:vt.string};var Qo=Fi("div",{displayName:"MessageText",target:"eovu8nx0"})({name:"tzdp72",styles:"white-space:pre-line;word-wrap:break-word;overflow-wrap:break-word;max-width:100%;padding:1em"});var $o=Fi("div",{displayName:"MessageMedia",mapPropsToStyles:function(e){var t=e.style||{};return{img:{borderTopLeftRadius:t.borderTopLeftRadius,borderTopRightRadius:t.borderTopRightRadius,borderBottomRightRadius:t.borderBottomRightRadius,borderBottomLeftRadius:t.borderBottomLeftRadius}}},target:"evmhqt80"})({name:"d3v9zr",styles:"overflow:hidden"}),es="rgba(0, 0, 0, 0.1)",ts="1px solid rgba(0, 0, 0, 0.1)",rs=Fi("div",{displayName:"MessageButtons",target:"edowbh60"})(So,";&>:first-child{border-top:",ts,";}&:first-child>:first-child{border-top:0;}&>:last-child{border-bottom:",ts,";}&:last-child>:last-child{border-bottom:0;}>*{border-color:",es,"!important;}");var ns=Wn(.2),is=Fi((0,e.forwardRef)((function(t,r){var n=t.href,i=bt(t,["href"]);return n?(0,e.createElement)("a",a({href:n,rel:"nofollow noopener"},i,{ref:r})):(0,e.createElement)("button",a({},i,{ref:r}))})),{displayName:"Button",mapPropsToStyles:function(e){var t=e.primary?e.theme.vars["--primary-color"]:"black",r=ns(t);return{borderColor:t,color:t,"&:hover":{color:r,borderColor:r}}},shouldForwardProp:h,target:"e1972fzd0"})({name:"1x6954b",styles:"border-width:1px;border-style:solid;background-color:#fff;font-size:1em;font-family:inherit;line-height:1.4em;text-align:center;text-decoration:none;appearance:none;padding:0.8em;transition:box-shadow 0.1s,color 0.1s,border-color 0.2s;&:hover{cursor:pointer;}&:active{box-shadow:none;outline:none;}&[disabled]{pointer-events:none;}"}),os=function(t){var r=t.label,n=t.onPress,i=t.disabled,o=bt(t,["label","onPress","disabled"]),s=Lr(),u=(0,e.useRef)(),c=Jn(a({onPress:n,isDisabled:i},o),u).buttonProps;return(0,e.createElement)(is,Xt(s,c,o,{ref:u}),r)};os.propTypes={label:(0,vt.oneOfType)([vt.string,vt.node])};var ss=Fi(os,{target:"e121y1dq0"})("display:inline-block;width:100%;border-left:0;border-right:0;border-top:0;border-bottom-color:rgba(0, 0, 0, 0.1);box-shadow:none;transition:background-color 0.1s;background:transparent;color:",(function(e){return e.disabled?"#8D9BA9":"inherit"}),";margin:0;&:hover{border-bottom-color:rgba(0, 0, 0, 0.15);background:rgba(0, 0, 0, 0.02);color:inherit;}&:active{background:rgba(0, 0, 0, 0.04);color:inherit;}"),as=function(t){function r(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).handleClick=function(t){t.stopPropagation(),e.props.onClick(t)},e}return _t(r,t),r.prototype.render=function(){return(0,e.createElement)(ss,a({},this.props,{onClick:this.handleClick}))},r}(e.Component);as.propTypes={className:vt.string,label:vt.string,onClick:vt.func,primary:vt.bool,value:(0,vt.oneOfType)([vt.string,vt.number])},as.defaultProps={onClick:st};var us=function(t){return e.Children.toArray(t).filter(Boolean)};vt.string,vt.string,vt.node,vt.bool,vt.bool;var cs="#fff",hs={vars:{"primary-color":"#427fe1","secondary-color":"#fbfbfb","tertiary-color":cs},AgentBar:{Avatar:{size:"42px",css:{marginRight:".6em"}},css:{backgroundColor:"var(--secondary-color)"}},Avatar:{size:"30px"},Bubble:{sharpBorderRadius:"0.3em",ovalBorderRadius:"1.4em",css:{backgroundColor:{default:"var(--secondary-color)",bot:"green"}}},Button:{},ChatListItem:{Avatar:{css:{marginRight:".5em"}}},FixedWrapperMaximized:{animationDuration:100,width:"400px",height:"500px"},FixedWrapperMinimized:{animationDuration:100},FixedWrapperRoot:{position:"right",css:{}},Message:{secondaryTextColor:"#000",horizontalAlign:"left",own:{horizontalAlign:"right",Bubble:{css:{backgroundColor:"var(--primary-color)",color:cs}},Content:{css:{alignItems:"flex-end"}},MessageMeta:{css:{textAlign:"right"}},Time:{css:{textAlign:"right"}}},bot:{Bubble:{css:{backgroundColor:"green"}}}},MessageButtons:{},MessageGroup:{},MessageList:{css:{backgroundColor:"var(--tertiary-color)"}},MessageMedia:{},MessageText:{},MessageTitle:{},QuickReply:{css:{borderColor:"var(--primary-color)",backgroundColor:"#fff",color:"var(--primary-color)"}},TextComposer:{inputColor:"#000",Icon:{color:"#aaa"},IconButton:{active:{Icon:{color:"var(--primary-color)"}}}},TitleBar:{iconsColor:"#fff",behaviour:"default",css:{backgroundColor:"var(--primary-color)"}}},ls=function e(t){var r=Bi(t);return 0===Object.keys(r).length?a({},t,{vars:nt((function(e){return"--"+e}),t.vars||{})}):a({},t,Je((function(t){return a({},e(t),{css:t.css||{}})}),r),{vars:nt((function(e){return"--"+e}),t.vars||{})})},fs=function(t){var r=t.theme,n=void 0===r?{}:r,i=t.children,o=ls(it(hs,n));return(0,e.createElement)(Ci,{value:o},i)};var ds=Fi("button",{displayName:"QuickReply",target:"e1gt5po80"})({name:"hta3ic",styles:"border-width:1px;border-style:solid;font-size:1em;line-height:1em;appearance:none;transition:box-shadow 0.1s,color 0.1s,border-color 0.2s;margin:0.25em;background-color:#fff;border-radius:1.4em;box-shadow:0 0.1em 0.1em 0 rgba(32, 34, 40, 0.05);font-weight:400;overflow:hidden;padding:0.375em 1em 0.5em;word-break:break-word;&:hover{cursor:pointer;}&:active{outline:none;}"}),ps=function(t){var r=t.value,n=t.onSelect,i=void 0===n?st:n,o=t.onClick,s=void 0===o?st:o,u=bt(t,["value","onSelect","onClick"]),c=Lr(),h=(0,e.useCallback)((function(e){i(r),s(e)}),[s,i,r]);return(0,e.createElement)(ds,a({value:r},u,c,{onClick:h}))};ut(console.warn.bind(console));var ys=Fi("div",{displayName:"QuickReplies",target:"e1dnb9qc0"})({name:"1q028wg",styles:"display:flex;flex-wrap:wrap;text-align:center;justify-content:center;width:100%"}),gs=function(t){function r(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this)._handleSelect=function(t){return e.props.onSelect(t)},e}return _t(r,t),r.prototype.render=function(){var t=this,r=this.props,n=r.children,i=r.replies,o=(r.onSelect,bt(r,["children","replies","onSelect"]));var s=n?us(n):i.map((function(t,r){return(0,e.createElement)(ps,{key:r,value:t},t)}));return(0,e.createElement)(ys,a({},o,{role:"group"}),e.Children.map(s,(function(r){return(0,e.cloneElement)(r,{onSelect:t._handleSelect})})))},r}(e.Component);gs.defaultProps={onSelect:st},gs.propTypes={children:vt.node,onSelect:vt.func,replies:(0,vt.arrayOf)(vt.string)};var ms=Fi("div",{displayName:"TitleBar",section:!0,target:"e1ohfhv1"})({name:"1rw1ajx",styles:"display:flex;justify-content:center;align-items:center;width:100%;border:#000;color:#fff;position:relative;z-index:2;text-align:center;padding:0.4em"}),bs=Fi("div",{displayName:"TitleBarTitle",target:"e1ohfhv0"})({name:"1tbgouq",styles:"width:100%;margin:0;margin-bottom:4px;padding:0 2px;text-align:center;font-size:0.9em;flex-grow:1"}),vs=function(t){var r=t.leftIcons,n=t.rightIcons,i=t.title,o=bt(t,["leftIcons","rightIcons","title"]);return(0,e.createElement)(ms,o,r,(0,e.createElement)(bs,{ellipsis:!0},i),n)};vs.propTypes={leftIcons:(0,vt.arrayOf)(vt.node),rightIcons:(0,vt.arrayOf)(vt.node),theme:(0,vt.shape)(),title:vt.node};var ws=function(e){return 13===e.which},_s=function(e){return ws(e)&&(e.altKey||e.shiftKey)},Es=function(e){return ws(e)&&!e.altKey&&!e.shiftKey};var Ss=(0,e.createContext)(),Ms=function(){return(0,e.useContext)(Ss)},As=Fi("div",{displayName:"TextComposer",section:!0,target:"eyij3xx0"})({name:"1xbhw8e",styles:"padding:0;background:#fff;border-top:1px solid rgba(0, 0, 0, 0.1)"}),Is=function(t){function r(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).state={value:e._getValue({value:e.props.defaultValue})},e._handleButtonClick=function(t){e.maybeSend()&&e.props.onButtonClick(t)},e._handleChange=function(t){var r=t.target.value;e._isControlled()||e.setState({value:r}),e.props.onValueChange(r),e.props.onChange(t)},e._handleInputRef=function(t){e._inputRef=t},e._handleKeyDown=function(t){var r=e.props.onKeyDown;Es(t)&&t.preventDefault(),ws(t)&&!_s(t)?(e.maybeSend(),r(t)):r(t)},e.maybeSend=function(){return!!e._canSend()&&(e._isControlled()||e.setState({value:""}),e.props.onValueChange(""),e.props.onSend(lt(e._getValue())),!0)},e}_t(r,t);var n=r.prototype;return n._getValue=function(e,t){return void 0===e&&(e=this.state),void 0===t&&(t=this.props),this._isControlled()?t.value:e.value},n._canSend=function(){return this.props.active&&""!==this._getValue().trim()},n._isControlled=function(){return"string"===typeof this.props.value},n._setCursorAtTheEnd=function(){var e=this._inputRef.value.length;this._inputRef.setSelectionRange(e,e)},n.componentDidMount=function(){this.props.defaultValue&&this._inputRef&&document.activeElement===this._inputRef&&this._setCursorAtTheEnd()},n.componentDidUpdate=function(e,t){var r=this._getValue();r!==this._getValue(t,e)&&""===r&&this._inputRef.focus()},n.render=function(){var t=this.props,r=(t.active,t.children),n=(t.defaultValue,t.onButtonClick,t.onChange,t.onKeyDown,t.onSend,t.onValueChange,t.value,bt(t,["active","children","defaultValue","onButtonClick","onChange","onKeyDown","onSend","onValueChange","value"])),i={active:this._canSend(),inputRef:this._handleInputRef,value:this._getValue(),maybeSend:this.maybeSend,onButtonClick:this._handleButtonClick,onChange:this._handleChange,onKeyDown:this._handleKeyDown};return(0,e.createElement)(Ss.Provider,{value:i},(0,e.createElement)(As,n,r))},r}(e.Component);function ks(t){var r=t.icon,n=t.onClick,i=void 0===n?st:n,o=bt(t,["icon","onClick"]),s=Ms(),u=s.active,c=s.onButtonClick;return(0,e.createElement)(Po,a({},o,{active:u,disabled:!u,onClick:function(e){u&&(c(e),i(e))}}),r?(0,e.createElement)($i,{"aria-hidden":!0},r):(0,e.createElement)(no,null))}Is.propTypes={active:vt.bool,children:vt.node,defaultValue:vt.string,onButtonClick:vt.func,onChange:vt.func,onKeyDown:vt.func,onSend:vt.func,value:vt.string},Is.defaultProps={active:!0,defaultValue:"",onButtonClick:st,onChange:st,onKeyDown:st,onSend:st,onValueChange:st};var Ts=Fi((0,e.forwardRef)((function(t,r){t.flexFill;var n=bt(t,["flexFill"]);return(0,e.createElement)(ai,a({ref:r},n))})),{displayName:"TextInput",target:"e1m92qam0"})({name:"1x70q7f",styles:"appearance:none;border:0;resize:none;background-color:#fff;height:1.5em;line-height:1.5em;width:100%;font-size:1em;&:focus,&:active{outline:none;}"}),Rs=(0,e.forwardRef)((function(t,r){var n=t.maxRows,i=void 0===n?3:n,o=t.placeholder,s=void 0===o?"Write a message...":o,u=bt(t,["maxRows","placeholder"]),c=(0,e.useRef)(),h=jr(c,r),l=Ms(),f=l.value,d=l.inputRef,p=l.onChange,y=l.onKeyDown;return(0,e.createElement)(Ts,a({},u,{onChange:function(e){p(e),u.onChange&&u.onChange(e)},onKeyDown:function(e){y(e),u.onKeyDown&&u.onKeyDown(e)},value:f,maxRows:i,placeholder:s,ref:function(e){h(e),d(e)}}))})),Ps=function(t){function r(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).handleButtonClick=function(t){return function(r){e.props.onButtonClick(r,t)}},e}return _t(r,t),r.prototype.render=function(){var t=this,r=null,n=$e((function(e){return e.showMore}),this.props.buttons);if(-1!==n){var i=this.props.buttons[n],o=i.text,s=bt(i,["text"]);r=(0,e.createElement)(as,a({},s,{label:o,"data-variant":"show-more",onClick:this.handleButtonClick(n)}))}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(rs,null,this.props.buttons.map((function(r,i){var o=r.text,s=r.key,u=(r.showMore,bt(r,["text","key","showMore"])),c=void 0!==s?s:i;return i!==n?(0,e.createElement)(as,a({key:c,label:o.length>20?o.slice(0,20).trim()+"\u2026":o,onClick:t.handleButtonClick(c)},u)):null}))),r)},r}(e.Component);Ps.defaultProps={onButtonClick:st};var Cs=function(e){return e.stopPropagation()},Os=function(e){return ft("a",a({},e,{onClick:Cs,rel:"nofollow noopener",target:"_blank"}))},xs=function(e){return dt("display:block;width:100%;height:",e?"100%":"150px",";object-fit:cover;")},Bs=Fi("div",{target:"e9ztsyy0"})("display:flex;margin:0 auto;overflow:hidden;width:100%;min-width:110px;height:",(function(e){return e.horizontalLayout?"100%":"150px"}),";align-items:center;justify-content:center;background:#fff;"),Ds=function(e){var t=e.link,r=e.url,n=e.srcset,i=e.horizontalLayout,o=bt(e,["link","url","srcset","horizontalLayout"]),s=ft($o,o,ft(Bs,{horizontalLayout:i},ft(vo,a({alt:"",css:xs(i)},function(e,t){var r={src:e};return void 0!==t&&(r.srcSet=t),r}(r,n)))));return t?ft(Os,{href:t,style:o.style},s):s};Ds.propTypes={link:vt.string,url:vt.string.isRequired,srcSet:vt.string};var Ns={name:"oipjxo",styles:"width:230px"},Ls={name:"ho1qnd",styles:"display:flex;flex-direction:row"},Ks={name:"1mb649y",styles:"max-width:110px"},Us=Fi("div",{target:"es7wtci0"})("width:230px;min-width:0px;max-width:",(function(e){return e.horizontalLayout?"66%":"100%"}),";"),js={borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit",borderBottomRightRadius:0,borderBottomLeftRadius:0},qs={borderTopLeftRadius:"inherit",borderTopRightRadius:0,borderBottomRightRadius:0,borderBottomLeftRadius:"inherit"};e.Component;var Fs=__webpack_require__(80184);function zs(e){const t=e.messages.map((e=>(0,Fs.jsx)(Go,{authorName:e.nick,date:Vs(e),children:(0,Fs.jsx)(Qo,{children:e.payloadAsUtf8})},e.sentTimestamp?e.sentTimestamp.valueOf():""+e.timestamp.valueOf()+e.nick+e.payloadAsUtf8)));return(0,Fs.jsxs)(Lo,{active:!0,containScrollInSubtree:!0,children:[t,(0,Fs.jsx)(Hs,{messages:e.messages})]})}function Vs(e){return e.timestamp.toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!1})}const Hs=t=>{const r=(0,e.useRef)();return(0,e.useEffect)((()=>{r.current.scrollIntoView()}),[t.messages]),(0,Fs.jsx)("div",{ref:r})},Gs=(0,e.createContext)({waku:void 0}),Ws=()=>(0,e.useContext)(Gs);function Ys(t){const[r,n]=(0,e.useState)(""),{waku:i}=Ws(),o=async()=>{t.sendMessage&&(await t.sendMessage(r),n(""))},s=i&&0!==i.relay.getPeers().size||r.startsWith("/");return(0,Fs.jsx)(Is,{onKeyDown:async e=>{"Enter"!==e.key||e.altKey||e.ctrlKey||e.shiftKey||await o()},onChange:e=>{n(e.target.value)},active:s,onButtonClick:o,children:(0,Fs.jsxs)(Zi,{align:"center",children:[(0,Fs.jsx)(Io,{children:(0,Fs.jsx)(Rs,{value:r})}),(0,Fs.jsx)(To,{children:(0,Fs.jsx)(ks,{})})]})})}var Zs=__webpack_require__(6018),Xs=__webpack_require__.n(Zs),Js=__webpack_require__(74395),Qs=__webpack_require__.n(Js);function $s(){return{timestamp:0,nick:"",payload:new Uint8Array}}const ea={encode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xs().Writer.create();return 0!==e.timestamp&&t.uint32(8).uint64(e.timestamp),""!==e.nick&&t.uint32(18).string(e.nick),0!==e.payload.length&&t.uint32(26).bytes(e.payload),t},decode(e,t){const r=e instanceof Xs().Reader?e:new(Xs().Reader)(e);let n=void 0===t?r.len:r.pos+t;const i=$s();for(;r.pos<n;){const e=r.uint32();switch(e>>>3){case 1:i.timestamp=ia(r.uint64());break;case 2:i.nick=r.string();break;case 3:i.payload=r.bytes();break;default:r.skipType(7&e)}}return i},fromJSON(e){const t=$s();return t.timestamp=void 0!==e.timestamp&&null!==e.timestamp?Number(e.timestamp):0,t.nick=void 0!==e.nick&&null!==e.nick?String(e.nick):"",t.payload=void 0!==e.payload&&null!==e.payload?function(e){const t=ra(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;++n)r[n]=t.charCodeAt(n);return r}(e.payload):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.timestamp&&(t.timestamp=Math.round(e.timestamp)),void 0!==e.nick&&(t.nick=e.nick),void 0!==e.payload&&(t.payload=function(e){const t=[];for(const r of e)t.push(String.fromCharCode(r));return na(t.join(""))}(void 0!==e.payload?e.payload:new Uint8Array)),t},fromPartial(e){var t,r,n;const i=$s();return i.timestamp=null!==(t=e.timestamp)&&void 0!==t?t:0,i.nick=null!==(r=e.nick)&&void 0!==r?r:"",i.payload=null!==(n=e.payload)&&void 0!==n?n:new Uint8Array,i}};var ta=(()=>{if("undefined"!==typeof ta)return ta;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof __webpack_require__.g)return __webpack_require__.g;throw"Unable to locate global object"})();const ra=ta.atob||(e=>ta.Buffer.from(e,"base64").toString("binary"));const na=ta.btoa||(e=>ta.Buffer.from(e,"binary").toString("base64"));function ia(e){if(e.gt(Number.MAX_SAFE_INTEGER))throw new ta.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}Xs().util.Long!==Qs()&&(Xs().util.Long=Qs(),Xs().configure());var oa=__webpack_require__(19778).Buffer;class sa{constructor(e){this.proto=e}static fromUtf8String(e,t,r){const n=Math.floor(e.valueOf()/1e3),i=oa.from(r,"utf-8");return new sa({timestamp:n,nick:t,payload:i})}static decode(e){const t=ea.decode(Zs.Reader.create(e));return new sa(t)}encode(){return ea.encode(this.proto).finish()}get timestamp(){return new Date(1e3*this.proto.timestamp)}get nick(){return this.proto.nick}get payloadAsUtf8(){return this.proto.payload?oa.from(this.proto.payload).toString("utf-8"):""}}function aa(e){const{waku:t}=Ws();let n=0,i=0;return t&&(n=t.relay.getPeers().size,i=t.store.peers.length),(0,Fs.jsxs)("div",{className:"chat-container",style:{height:"98vh",display:"flex",flexDirection:"column"},children:[(0,Fs.jsx)(vs,{leftIcons:["Peers: ".concat(n," relay ").concat(i," store.")],title:"Waku v2 chat app"}),(0,Fs.jsx)(zs,{messages:e.messages}),(0,Fs.jsx)(Ys,{sendMessage:t?async n=>async function(e,t,n,i){if(!e.startsWith("/")){const n=new Date,o=sa.fromUtf8String(n,t,e);return i(await r.WakuMessage.fromBytes(o.encode(),fa,{timestamp:n}))}n(e)}(n,e.nick,e.commandHandler,t.relay.send.bind(t.relay)):void 0})]})}var ua=__webpack_require__(68555);class ca{constructor(e,t){this.chatMessage=void 0,this.sentTimestamp=void 0,this.chatMessage=e,this.sentTimestamp=t}static fromWakuMessage(e){if(e.payload)try{const t=sa.decode(e.payload);if(t)return new ca(t,e.timestamp)}catch(t){console.error("Failed to decode chat message",e.payloadAsUtf8,t)}}static fromUtf8String(e,t){const r=new Date;return new ca(sa.fromUtf8String(r,e,t),r)}get nick(){return this.chatMessage.nick}get timestamp(){return this.chatMessage.timestamp}get payloadAsUtf8(){return this.chatMessage.payloadAsUtf8}}var ha=__webpack_require__(1426);const la={AuthorName:{css:{fontSize:"1.1em"}},Message:{css:{margin:"0em",padding:"0em",fontSize:"0.83em"}},MessageText:{css:{margin:"0em",padding:"0.1em",paddingLeft:"1em",fontSize:"1.1em"}},MessageGroup:{css:{margin:"0em",padding:"0.2em"}}},fa="/toy-chat/2/huilong/proto";function da(){const[t,n]=(0,e.useReducer)(ya,[]),[i,o]=(0,e.useState)(void 0),[a,u]=(0,e.useState)((()=>{const e=window.localStorage.getItem("nick");return null!==e?e:(0,ua.R)()})),[c,h]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{localStorage.setItem("nick",a)}),[a]),(0,e.useEffect)((()=>{(async function(e){try{e(await r.Waku.create({libp2p:{config:{pubsub:{enabled:!0,emitSelf:!0}}},bootstrap:{getPeers:r.getNodesFromHostedJson.bind({},pa())}}))}catch(t){console.log("Issue starting waku ",t)}})(o).then((()=>console.log("Waku init done"))).catch((e=>console.log("Waku init failed ",e)))}),[]),(0,e.useEffect)((()=>{if(!i)return;if(!c)return;const e=e=>{console.log("Message received: ",e);const t=ca.fromWakuMessage(e);t&&n([t])};return i.relay.addObserver(e,[fa]),function(){null===i||void 0===i||i.relay.deleteObserver(e,[fa])}}),[i,c]),(0,e.useEffect)((()=>{if(!i)return;if(c)return;(async()=>{await i.waitForConnectedPeer(),console.log("Retrieving archived messages}");try{(async function(e,t){const n=e=>{const r=[];e.map((e=>ca.fromWakuMessage(e))).forEach((e=>{e&&r.push(e)})),t(r)},i=new Date;i.setTime(Date.now()-6048e5);const o=new Date;try{return(await e.store.queryHistory([fa],{pageSize:5,pageDirection:r.PageDirection.FORWARD,timeFilter:{startTime:i,endTime:o},callback:n})).length}catch(s){return console.log("Failed to retrieve messages",s),0}})(i,n).then((e=>{console.log("Messages retrieved:",e),h(!0)}))}catch(e){console.log("Error encountered when retrieving archived messages",e)}})()}),[i,c]),(0,Fs.jsx)("div",{className:"chat-app",style:{height:"100vh",width:"100vw",overflow:"hidden"},children:(0,Fs.jsx)(Gs.Provider,{value:{waku:i},children:(0,Fs.jsx)(fs,{theme:la,children:(0,Fs.jsx)(aa,{nick:a,messages:t,commandHandler:e=>{const{command:t,response:r}=s(e,i,u),o=r.map((e=>ca.fromUtf8String(t,e)));n(o)}})})})})}function pa(){var e;return"development"===(null===ha||void 0===ha||null===(e={NODE_ENV:"production",PUBLIC_URL:"/js-waku",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0})||void 0===e?void 0:e.NODE_ENV)?["fleets","wakuv2.test","waku-websocket"]:["fleets","wakuv2.prod","waku-websocket"]}function ya(e,t){return e.concat(t)}t.render((0,Fs.jsx)(e.StrictMode,{children:(0,Fs.jsx)(da,{})}),document.getElementById("root"))})()})();
|
|
//# sourceMappingURL=main.dea5c94f.js.map |