/*! 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{"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{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!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!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{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;r0;r++)this.gossipsub.outbound.get(t[r])&&(n(r),i--)}let i=e-r;for(let r=e;r0;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!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(ro.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{const n=this.gossipsub.topics.get(r);if(t.forEach((e=>{(null===n||void 0===n||!n.has(e)||s(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{"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>>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>>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>>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>>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;ns.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>>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>>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>>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>>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>>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>>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;np.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{"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{"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=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=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{"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=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=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=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>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=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=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;h1&&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?""};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>>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>>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=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;te.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;re.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;ne.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;i0&&(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<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.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>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>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>>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>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=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>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=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>>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=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;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<=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<=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>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>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=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<>>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:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(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=t0?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>>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>>=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=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>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;au?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;s0)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>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=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s0?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=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>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=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=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;h1&&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?""}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>>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>>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>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(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;te.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;re.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;ne.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;i0&&(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<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.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>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>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>>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>=1;return n},v.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=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>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=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>>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=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;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<=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<=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>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>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=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<>>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:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(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=t0?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>>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>>=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=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{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>>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>>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>>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{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(;++r16)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{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;++t0;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>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,s=n.allocUnsafe(o),a=-1;++a{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{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{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{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())).length0&&r.ishrn(n),r}function f(e,t,r){var o,s;do{for(o=n.alloc(0);8*o.length{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{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{"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=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;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s>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(;i239?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(;nn.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;tr&&(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>>=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;in)&&(r=n);let i="";for(let o=t;or)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||te.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>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>=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)<>>=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)<>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=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)<>>=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)<>>=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>>=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>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=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>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(i=t;i=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||e3?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;s55295&&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=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-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=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=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=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>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=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=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;h1&&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?""};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>>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>>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=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;te.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;re.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;ne.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;i0&&(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<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.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>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>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>>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>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=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>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=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>>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=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;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<=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<=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>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>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=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<>>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:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(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=t0?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>>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>>=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=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{"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{"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{"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;n0;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{"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>>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>>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<>>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>>r[u]&1;for(u=a;u>>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[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length{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{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;ie;)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=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=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>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=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=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;h1&&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?""};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>>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>>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=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;te.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;re.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;ne.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;i0&&(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<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.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>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>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>>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>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=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>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=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>>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=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;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<=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<=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>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>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=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<>>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:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(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=t0?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>>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>>=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=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<=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=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=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=0;a--){for(var M=0;a>=0;){var A=!0;for(u=0;u=0&&M++,E=E.dblp(M),a<0)break;for(u=0;u0?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=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{"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()?"":""},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()?"":""},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":""},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=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"":""},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""}},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>>=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>>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{"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<(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=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=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>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=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=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;h1&&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?""};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>>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>>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=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;te.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;re.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;ne.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;i0&&(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<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.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>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>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>>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>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=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>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=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>>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=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;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<=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<=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>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>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=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<>>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:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(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=t0?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>>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>>=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=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;r0&&(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=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=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(l0){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;o0;++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>>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{"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{"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{"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{"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{"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>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>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>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<>>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>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>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)>>0)>>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)>>0)>>0)>>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.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{"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{"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<>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<>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<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<>>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;d0;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=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=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=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>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=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=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;h1&&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?""};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>>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>>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=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;te.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;re.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;ne.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;i0&&(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<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.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>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>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>>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>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=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>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=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>>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=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;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<=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<=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>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>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=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<>>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:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(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=t0?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>>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>>=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=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>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{"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{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=[];++h1)for(var r=1;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=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=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=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>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=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n=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;h1&&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?""};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>>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>>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=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;te.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;re.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;ne.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;i0&&(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<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.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>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>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>>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>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=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>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=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>>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=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;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<=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<=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>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>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=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<>>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:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(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=t0?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>>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>>=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=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=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=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{"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{"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