@toruslabs/ethereum-controllers 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/ethereumControllers.cjs.js +6153 -0
  2. package/dist/ethereumControllers.cjs.js.map +1 -0
  3. package/dist/ethereumControllers.esm.js +5570 -0
  4. package/dist/ethereumControllers.esm.js.map +1 -0
  5. package/dist/ethereumControllers.umd.min.js +3 -0
  6. package/dist/ethereumControllers.umd.min.js.LICENSE.txt +38 -0
  7. package/dist/ethereumControllers.umd.min.js.map +1 -0
  8. package/dist/types/Account/AccountTrackerController.d.ts +35 -0
  9. package/dist/types/Block/PollingBlockTracker.d.ts +14 -0
  10. package/dist/types/Currency/CurrencyController.d.ts +30 -0
  11. package/dist/types/Gas/GasFeeController.d.ts +64 -0
  12. package/dist/types/Gas/IGasFeeController.d.ts +49 -0
  13. package/dist/types/Gas/gasUtil.d.ts +21 -0
  14. package/dist/types/Keyring/KeyringController.d.ts +20 -0
  15. package/dist/types/Message/AbstractMessageController.d.ts +36 -0
  16. package/dist/types/Message/DecryptMessageController.d.ts +20 -0
  17. package/dist/types/Message/EncryptionPublicKeyController.d.ts +20 -0
  18. package/dist/types/Message/MessageController.d.ts +20 -0
  19. package/dist/types/Message/PersonalMessageController.d.ts +20 -0
  20. package/dist/types/Message/TypedMessageController.d.ts +21 -0
  21. package/dist/types/Message/utils.d.ts +10 -0
  22. package/dist/types/Network/NetworkController.d.ts +40 -0
  23. package/dist/types/Network/createEthereumMiddleware.d.ts +66 -0
  24. package/dist/types/Network/createJsonRpcClient.d.ts +9 -0
  25. package/dist/types/Nfts/INftsController.d.ts +10 -0
  26. package/dist/types/Nfts/NftHandler.d.ts +35 -0
  27. package/dist/types/Nfts/NftsController.d.ts +40 -0
  28. package/dist/types/Preferences/PreferencesController.d.ts +53 -0
  29. package/dist/types/Tokens/ITokensController.d.ts +10 -0
  30. package/dist/types/Tokens/TokenHandler.d.ts +20 -0
  31. package/dist/types/Tokens/TokenRatesController.d.ts +42 -0
  32. package/dist/types/Tokens/TokensController.d.ts +42 -0
  33. package/dist/types/Transaction/NonceTracker.d.ts +37 -0
  34. package/dist/types/Transaction/PendingTransactionTracker.d.ts +32 -0
  35. package/dist/types/Transaction/TransactionController.d.ts +67 -0
  36. package/dist/types/Transaction/TransactionGasUtil.d.ts +21 -0
  37. package/dist/types/Transaction/TransactionStateHistoryHelper.d.ts +16 -0
  38. package/dist/types/Transaction/TransactionStateManager.d.ts +30 -0
  39. package/dist/types/Transaction/TransactionUtils.d.ts +70 -0
  40. package/dist/types/index.d.ts +43 -0
  41. package/dist/types/utils/abiDecoder.d.ts +17 -0
  42. package/dist/types/utils/abis.d.ts +84 -0
  43. package/dist/types/utils/constants.d.ts +81 -0
  44. package/dist/types/utils/contractAddresses.d.ts +1 -0
  45. package/dist/types/utils/conversionUtils.d.ts +42 -0
  46. package/dist/types/utils/helpers.d.ts +24 -0
  47. package/dist/types/utils/interfaces.d.ts +384 -0
  48. package/package.json +71 -0
  49. package/src/Account/AccountTrackerController.ts +157 -0
  50. package/src/Block/PollingBlockTracker.ts +89 -0
  51. package/src/Currency/CurrencyController.ts +117 -0
  52. package/src/Gas/GasFeeController.ts +254 -0
  53. package/src/Gas/IGasFeeController.ts +56 -0
  54. package/src/Gas/gasUtil.ts +163 -0
  55. package/src/Keyring/KeyringController.ts +118 -0
  56. package/src/Message/AbstractMessageController.ts +136 -0
  57. package/src/Message/DecryptMessageController.ts +81 -0
  58. package/src/Message/EncryptionPublicKeyController.ts +83 -0
  59. package/src/Message/MessageController.ts +74 -0
  60. package/src/Message/PersonalMessageController.ts +74 -0
  61. package/src/Message/TypedMessageController.ts +112 -0
  62. package/src/Message/utils.ts +107 -0
  63. package/src/Network/NetworkController.ts +184 -0
  64. package/src/Network/createEthereumMiddleware.ts +307 -0
  65. package/src/Network/createJsonRpcClient.ts +59 -0
  66. package/src/Nfts/INftsController.ts +13 -0
  67. package/src/Nfts/NftHandler.ts +191 -0
  68. package/src/Nfts/NftsController.ts +230 -0
  69. package/src/Preferences/PreferencesController.ts +409 -0
  70. package/src/Tokens/ITokensController.ts +13 -0
  71. package/src/Tokens/TokenHandler.ts +60 -0
  72. package/src/Tokens/TokenRatesController.ts +134 -0
  73. package/src/Tokens/TokensController.ts +278 -0
  74. package/src/Transaction/NonceTracker.ts +152 -0
  75. package/src/Transaction/PendingTransactionTracker.ts +235 -0
  76. package/src/Transaction/TransactionController.ts +558 -0
  77. package/src/Transaction/TransactionGasUtil.ts +74 -0
  78. package/src/Transaction/TransactionStateHistoryHelper.ts +41 -0
  79. package/src/Transaction/TransactionStateManager.ts +315 -0
  80. package/src/Transaction/TransactionUtils.ts +333 -0
  81. package/src/index.ts +45 -0
  82. package/src/utils/abiDecoder.ts +195 -0
  83. package/src/utils/abis.ts +677 -0
  84. package/src/utils/constants.ts +379 -0
  85. package/src/utils/contractAddresses.ts +21 -0
  86. package/src/utils/conversionUtils.ts +269 -0
  87. package/src/utils/helpers.ts +177 -0
  88. package/src/utils/interfaces.ts +454 -0
@@ -0,0 +1,3 @@
1
+ /*! For license information please see ethereumControllers.umd.min.js.LICENSE.txt */
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.EthereumControllers=t():e.EthereumControllers=t()}(self,(()=>(()=>{var e,t,r={7256:(e,t)=>{"use strict";function r(e){if(Array.isArray(e)){const t=[];let n=0;for(let i=0;i<e.length;i++){const o=r(e[i]);t.push(o),n+=o.length}return d(o(n,192),...t)}const t=y(e);return 1===t.length&&t[0]<128?t:d(o(t.length,128),t)}function n(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function i(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return l(u(e))}function o(e,t){if(e<56)return Uint8Array.from([e+t]);const r=p(e),n=p(t+55+r.length/2);return Uint8Array.from(f(n+r))}function s(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);const r=a(y(e));if(t)return r;if(0!==r.remainder.length)throw new Error("invalid RLP: remainder must be zero");return r.data}function a(e){let t,r,o,s,c;const u=[],l=e[0];if(l<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(l<=183){if(t=l-127,o=128===l?Uint8Array.from([]):n(e,1,t),2===t&&o[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:o,remainder:e.slice(t)}}if(l<=191){if(r=l-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=i(n(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return o=n(e,r,t+r),{data:o,remainder:e.slice(t+r)}}if(l<=247){for(t=l-191,s=n(e,1,t);s.length;)c=a(s),u.push(c.data),s=c.remainder;return{data:u,remainder:e.slice(t)}}{if(r=l-246,t=i(n(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const o=r+t;if(o>e.length)throw new Error("invalid RLP: total length is larger than the data");for(s=n(e,r,o);s.length;)c=a(s),u.push(c.data),s=c.remainder;return{data:u,remainder:e.slice(o)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.RLP=t.utils=t.decode=t.encode=void 0,t.encode=r,t.decode=s;const c=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function u(e){let t="";for(let r=0;r<e.length;r++)t+=c[e[r]];return t}function l(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function f(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r;t[r]=l(e.slice(n,n+2))}return t}function d(...e){if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}function h(e){return(new TextEncoder).encode(e)}function p(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function g(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function y(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return g(e)?f((t="string"!=typeof(r=e)?r:g(r)?r.slice(2):r).length%2?`0${t}`:t):h(e);var t,r;if("number"==typeof e||"bigint"==typeof e)return e?f(p(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}t.utils={bytesToHex:u,concatBytes:d,hexToBytes:f,utf8ToBytes:h},t.RLP={encode:r,decode:s}},8872:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSingle=t.decode=t.encodePacked=t.encodeSingle=t.encode=void 0;const n=r(1791),i=r(9777),o=r(9472);t.encode=(e,t,r,n)=>{try{return(0,o.pack)({types:e,values:t,packed:r,tight:n})}catch(e){if(e instanceof i.ParserError)throw new i.ParserError(`Unable to encode value: ${e.message}`,e);throw new i.ParserError(`An unexpected error occurred: ${(0,i.getErrorMessage)(e)}`,e)}},t.encodeSingle=(e,r)=>(0,t.encode)([e],[r]),t.encodePacked=(e,r,n)=>(0,t.encode)(e,r,!0,n),t.decode=(e,t)=>{const r=(0,n.createBytes)(t);try{return(0,o.unpack)(e,r)}catch(e){if(e instanceof i.ParserError)throw new i.ParserError(`Unable to decode value: ${e.message}`,e);throw new i.ParserError(`An unexpected error occurred: ${(0,i.getErrorMessage)(e)}`,e)}},t.decodeSingle=(e,r)=>{const o=(0,t.decode)([e],r);return(0,n.assert)(1===o.length,new i.ParserError("Decoded value array has unexpected length.")),o[0]}},9777:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParserError=t.getErrorStack=t.getErrorMessage=void 0;const n=r(1791);t.getErrorMessage=e=>"string"==typeof e?e:e instanceof Error||(0,n.isObject)(e)&&(0,n.hasProperty)(e,"message")&&"string"==typeof e.message?e.message:"Unknown error.",t.getErrorStack=e=>{if(e instanceof Error)return e.stack};class i extends Error{constructor(e,r){super(e),this.name="ParserError";const n=(0,t.getErrorStack)(r);n&&(this.stack=n)}}t.ParserError=i},260:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8872),t),i(r(9777),t),i(r(5858),t)},2378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.iterate=void 0;const n=r(1791);t.iterate=function*(e,t=32){for(let r=0;r<e.length;r+=t){const i=e=>{(0,n.assert)(e>=0,"Cannot skip a negative number of bytes."),(0,n.assert)(e%t==0,"Length must be a multiple of the size."),r+=e},o=e.subarray(r);yield{skip:i,value:o}}return{skip:()=>{},value:new Uint8Array}}},9472:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unpack=t.pack=t.isDynamicParser=t.getParser=void 0;const n=r(1791),i=r(9777),o=r(2378),s=r(4206),a=r(2313);t.getParser=e=>{const t={address:s.address,array:s.array,bool:s.bool,bytes:s.bytes,fixedBytes:s.fixedBytes,function:s.fn,number:s.number,string:s.string,tuple:s.tuple},r=t[e];if(r)return r;const n=Object.values(t).find((t=>t.isType(e)));if(n)return n;throw new i.ParserError(`The type "${e}" is not supported.`)},t.isDynamicParser=(e,t)=>{const{isDynamic:r}=e;return"function"==typeof r?r(t):r},t.pack=({types:e,values:r,packed:o=!1,tight:s=!1,arrayPacked:c=!1,byteArray:u=new Uint8Array})=>{(0,n.assert)(e.length===r.length,new i.ParserError(`The number of types (${e.length}) does not match the number of values (${r.length}).`));const{staticBuffer:l,dynamicBuffer:f,pointers:d}=e.reduce((({staticBuffer:e,dynamicBuffer:i,pointers:a},u,l)=>{const f=(0,t.getParser)(u),d=r[l];return o||c||!(0,t.isDynamicParser)(f,u)?{staticBuffer:f.encode({buffer:e,value:d,type:u,packed:o,tight:s}),dynamicBuffer:i,pointers:a}:{staticBuffer:(0,n.concatBytes)([e,new Uint8Array(32)]),dynamicBuffer:f.encode({buffer:i,value:d,type:u,packed:o,tight:s}),pointers:[...a,{position:e.length,pointer:i.length}]}}),{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,n.assert)(!o&&!c||0===f.length,new i.ParserError("Invalid pack state."));const h=l.length,p=d.reduce(((e,{pointer:t,position:r})=>{const i=(0,a.padStart)((0,n.numberToBytes)(h+t));return(0,a.set)(e,i,r)}),l);return(0,n.concatBytes)([u,p,f])},t.unpack=(e,r)=>{const s=(0,o.iterate)(r);return e.map((e=>{const{value:{value:o,skip:a},done:c}=s.next();(0,n.assert)(!c,new i.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${e}".`));const u=(0,t.getParser)(e);if((0,t.isDynamicParser)(u,e)){const t=(0,n.bytesToNumber)(o.subarray(0,32)),i=r.subarray(t);return u.decode({type:e,value:i,skip:a})}return u.decode({type:e,value:o,skip:a})}))}},7683:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.address=t.getAddress=void 0;const n=r(1791),i=r(9777),o=r(2313);t.getAddress=e=>{const t=(0,n.createBytes)(e);return(0,n.assert)(t.length<=20,new i.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${t.length} bytes.`)),(0,o.padStart)(t,20)},t.address={isDynamic:!1,isType:e=>"address"===e,getByteLength:()=>32,encode({buffer:e,value:r,packed:i}){const s=(0,t.getAddress)(r);if(i)return(0,n.concatBytes)([e,s]);const a=(0,o.padStart)(s);return(0,n.concatBytes)([e,a])},decode:({value:e})=>(0,n.add0x)((0,n.bytesToHex)(e.slice(12,32)))}},7759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.array=t.getTupleType=t.getArrayType=t.isArrayType=void 0;const n=r(1791),i=r(9777),o=r(9472),s=r(2313),a=r(2408),c=r(4409),u=/^(?<type>.*)\[(?<length>\d*?)\]$/u;t.isArrayType=e=>u.test(e),t.getArrayType=e=>{const t=e.match(u);return(0,n.assert)(t?.groups?.type,new i.ParserError(`Invalid array type. Expected an array type, but received "${e}".`)),[t.groups.type,t.groups.length?parseInt(t.groups.length,10):void 0]},t.getTupleType=(e,t)=>`(${new Array(t).fill(e).join(",")})`,t.array={isDynamic(e){const[r,n]=(0,t.getArrayType)(e);return void 0===n||(0,o.isDynamicParser)((0,o.getParser)(r),r)},isType:e=>(0,t.isArrayType)(e),getByteLength(e){(0,n.assert)((0,t.isArrayType)(e),new i.ParserError(`Expected an array type, but received "${e}".`));const[r,s]=(0,t.getArrayType)(e);return(0,o.isDynamicParser)(this,e)||void 0===s?32:c.tuple.getByteLength((0,t.getTupleType)(r,s))},encode({type:e,buffer:r,value:u,packed:l,tight:f}){const[d,h]=(0,t.getArrayType)(e);if((0,n.assert)(!l||!(0,t.isArrayType)(d),new i.ParserError("Cannot pack nested arrays.")),l&&(0,o.isDynamicParser)((0,o.getParser)(d),d))return(0,o.pack)({types:new Array(u.length).fill(d),values:u,byteArray:r,packed:l,arrayPacked:!0,tight:f});if(h)return(0,n.assert)(h===u.length,new i.ParserError(`Array length does not match type length. Expected a length of ${h}, but received ${u.length}.`)),c.tuple.encode({type:(0,t.getTupleType)(d,h),buffer:r,value:u,packed:a.fixedBytes.isType(d)&&f,tight:f});if(l)return(0,o.pack)({types:new Array(u.length).fill(d),values:u,byteArray:r,packed:a.fixedBytes.isType(d)&&f,arrayPacked:!0,tight:f});const p=(0,s.padStart)((0,n.numberToBytes)(u.length));return(0,o.pack)({types:new Array(u.length).fill(d),values:u,byteArray:(0,n.concatBytes)([r,p]),packed:l,tight:f})},decode({type:e,value:r,...s}){const[a,u]=(0,t.getArrayType)(e);if(u){const e=c.tuple.decode({type:(0,t.getTupleType)(a,u),value:r,...s});return(0,n.assert)(e.length===u,new i.ParserError(`Array length does not match type length. Expected a length of ${u}, but received ${e.length}.`)),e}const l=(0,n.bytesToNumber)(r.subarray(0,32));return(0,o.unpack)(new Array(l).fill(a),r.subarray(32))}}},8457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bool=t.getBooleanValue=void 0;const n=r(1791),i=r(2988),o=r(9777),s=r(1001),a=(0,i.coerce)((0,i.boolean)(),(0,i.union)([(0,i.literal)("true"),(0,i.literal)("false")]),(e=>"true"===e));t.getBooleanValue=e=>{try{return(0,i.create)(e,a)?BigInt(1):BigInt(0)}catch{throw new o.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${e}".`)}},t.bool={isDynamic:!1,isType:e=>"bool"===e,getByteLength:()=>32,encode({buffer:e,value:r,packed:i,tight:o}){const a=(0,t.getBooleanValue)(r);return i?(0,n.concatBytes)([e,(0,n.bigIntToBytes)(a)]):s.number.encode({type:"uint256",buffer:e,value:a,packed:i,tight:o})},decode:e=>s.number.decode({...e,type:"uint256"})===BigInt(1)}},7300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=void 0;const n=r(1791),i=r(2313);t.bytes={isDynamic:!0,isType:e=>"bytes"===e,getByteLength:()=>32,encode({buffer:e,value:t,packed:r}){const o=(0,n.createBytes)(t);if(r)return(0,n.concatBytes)([e,o]);const s=32*Math.ceil(o.byteLength/32);return(0,n.concatBytes)([e,(0,i.padStart)((0,n.numberToBytes)(o.byteLength)),(0,i.padEnd)(o,s)])},decode({value:e}){const t=e.subarray(0,32),r=(0,n.bytesToNumber)(t);return e.slice(32,32+r)}}},2408:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fixedBytes=t.getByteLength=void 0;const n=r(1791),i=r(9777),o=r(2313),s=/^bytes([0-9]{1,2})$/u;t.getByteLength=e=>{const t=e.match(s)?.[1];(0,n.assert)(t,`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`);const r=Number(t);return(0,n.assert)(r>0&&r<=32,new i.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${e}".`)),r},t.fixedBytes={isDynamic:!1,isType:e=>s.test(e),getByteLength:()=>32,encode({type:e,buffer:r,value:s,packed:a}){const c=(0,t.getByteLength)(e),u=(0,n.createBytes)(s);return(0,n.assert)(u.length<=c,new i.ParserError(`Expected a value of length ${c}, but received a value of length ${u.length}.`)),a?(0,n.concatBytes)([r,(0,o.padEnd)(u,c)]):(0,n.concatBytes)([r,(0,o.padEnd)(u)])},decode({type:e,value:r}){const n=(0,t.getByteLength)(e);return r.slice(0,n)}}},2345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fn=t.getFunction=void 0;const n=r(1791),i=r(2988),o=r(9777),s=r(2408),a=(0,i.coerce)((0,i.object)({address:n.StrictHexStruct,selector:n.StrictHexStruct}),(0,i.union)([n.StrictHexStruct,(0,i.instance)(Uint8Array)]),(e=>{const t=(0,n.createBytes)(e);return(0,n.assert)(24===t.length,new o.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${t.length} bytes.`)),{address:(0,n.bytesToHex)(t.subarray(0,20)),selector:(0,n.bytesToHex)(t.subarray(20,24))}}));t.getFunction=e=>{const t=(0,i.create)(e,a);return(0,n.concatBytes)([(0,n.hexToBytes)(t.address),(0,n.hexToBytes)(t.selector)])},t.fn={isDynamic:!1,isType:e=>"function"===e,getByteLength:()=>32,encode({buffer:e,value:r,packed:n,tight:i}){const o=(0,t.getFunction)(r);return s.fixedBytes.encode({type:"bytes24",buffer:e,value:o,packed:n,tight:i})},decode:({value:e})=>({address:(0,n.bytesToHex)(e.slice(0,20)),selector:(0,n.bytesToHex)(e.slice(20,24))})}},4206:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7683),t),i(r(7759),t),i(r(8457),t),i(r(7300),t),i(r(2408),t),i(r(2345),t),i(r(1001),t),i(r(52),t),i(r(5967),t),i(r(4409),t)},1001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.number=t.getBigInt=t.assertNumberLength=t.getLength=t.isSigned=void 0;const n=r(1791),i=r(9777),o=r(2313),s=/^u?int(?<length>[0-9]*)?$/u;t.isSigned=e=>!e.startsWith("u"),t.getLength=e=>{if("int"===e||"uint"===e)return 256;const t=e.match(s);(0,n.assert)(t?.groups?.length,new i.ParserError(`Invalid number type. Expected a number type, but received "${e}".`));const r=parseInt(t.groups.length,10);return(0,n.assert)(r>=8&&r<=256,new i.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${e}".`)),(0,n.assert)(r%8==0,new i.ParserError(`Invalid number length. Expected a multiple of 8, but received "${e}".`)),r},t.assertNumberLength=(e,r)=>{const o=(0,t.getLength)(r),s=BigInt(2)**BigInt(o-((0,t.isSigned)(r)?1:0))-BigInt(1);(0,t.isSigned)(r)?(0,n.assert)(e>=-(s+BigInt(1))&&e<=s,new i.ParserError(`Number "${e}" is out of range for type "${r}".`)):(0,n.assert)(e<=s,new i.ParserError(`Number "${e}" is out of range for type "${r}".`))},t.getBigInt=e=>{try{return(0,n.createBigInt)(e)}catch{throw new i.ParserError(`Invalid number. Expected a valid number value, but received "${e}".`)}},t.number={isDynamic:!1,isType:e=>s.test(e),getByteLength:()=>32,encode({type:e,buffer:r,value:i,packed:s}){const a=(0,t.getBigInt)(i);if((0,t.assertNumberLength)(a,e),(0,t.isSigned)(e)){if(s){const i=(0,t.getLength)(e)/8;return(0,n.concatBytes)([r,(0,n.signedBigIntToBytes)(a,i)])}return(0,n.concatBytes)([r,(0,o.padStart)((0,n.signedBigIntToBytes)(a,32))])}if(s){const i=(0,t.getLength)(e)/8;return(0,n.concatBytes)([r,(0,o.padStart)((0,n.bigIntToBytes)(a),i)])}return(0,n.concatBytes)([r,(0,o.padStart)((0,n.bigIntToBytes)(a))])},decode({type:e,value:r}){const i=r.subarray(0,32);if((0,t.isSigned)(e)){const r=(0,n.bytesToSignedBigInt)(i);return(0,t.assertNumberLength)(r,e),r}const o=(0,n.bytesToBigInt)(i);return(0,t.assertNumberLength)(o,e),o}}},52:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5967:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.string=void 0;const n=r(1791),i=r(7300);t.string={isDynamic:!0,isType:e=>"string"===e,getByteLength:()=>32,encode:({buffer:e,value:t,packed:r,tight:o})=>i.bytes.encode({type:"bytes",buffer:e,value:(0,n.stringToBytes)(t),packed:r,tight:o}),decode:e=>(0,n.bytesToString)(i.bytes.decode(e))}},4409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tuple=t.getTupleElements=void 0;const n=r(1791),i=r(9777),o=r(9472),s=/^\((.+)\)$/u;t.getTupleElements=e=>{(0,n.assert)(e.startsWith("(")&&e.endsWith(")"),new i.ParserError(`Invalid tuple type. Expected tuple type, but received "${e}".`));const t=[];let r="",o=0;for(let n=1;n<e.length-1;n++){const i=e[n];","===i&&0===o?(t.push(r.trim()),r=""):(r+=i,"("===i?o+=1:")"===i&&(o-=1))}return r.trim()&&t.push(r.trim()),t},t.tuple={isDynamic:e=>(0,t.getTupleElements)(e).some((e=>{const t=(0,o.getParser)(e);return(0,o.isDynamicParser)(t,e)})),isType:e=>(e=>s.test(e))(e),getByteLength(e){return(0,o.isDynamicParser)(this,e)?32:(0,t.getTupleElements)(e).reduce(((e,t)=>e+(0,o.getParser)(t).getByteLength(t)),0)},encode({type:e,buffer:r,value:n,packed:i,tight:s}){const a=(0,t.getTupleElements)(e);return(0,o.pack)({types:a,values:n,byteArray:r,packed:i,tight:s})},decode({type:e,value:r,skip:n}){const i=(0,t.getTupleElements)(e);return n(this.getByteLength(e)-32),(0,o.unpack)(i,r)}}},4163:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5858:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4163),t)},1348:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.padEnd=t.padStart=t.set=void 0;const n=r(1791);t.set=(e,t,r)=>(0,n.concatBytes)([e.subarray(0,r),t,e.subarray(r+t.length)]),t.padStart=(e,t=32)=>{const r=new Uint8Array(Math.max(t-e.length,0)).fill(0);return(0,n.concatBytes)([r,e])},t.padEnd=(e,t=32)=>{const r=new Uint8Array(Math.max(t-e.length,0)).fill(0);return(0,n.concatBytes)([e,r])}},2313:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1348),t)},2517:function(e,t,r){"use strict";var n=r(8834).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}: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};Object.defineProperty(t,"__esModule",{value:!0}),t.getEncryptionPublicKey=t.decryptSafely=t.decrypt=t.encryptSafely=t.encrypt=void 0;const a=s(r(717)),c=s(r(251)),u=r(5491);function l({publicKey:e,data:t,version:r}){if((0,u.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,u.isNullish)(t))throw new Error("Missing data parameter");if((0,u.isNullish)(r))throw new Error("Missing version parameter");if("x25519-xsalsa20-poly1305"===r){if("string"!=typeof t)throw new Error("Message data must be given as a string");const r=a.box.keyPair();let n;try{n=c.decodeBase64(e)}catch(e){throw new Error("Bad public key")}const i=c.decodeUTF8(t),o=a.randomBytes(a.box.nonceLength),s=a.box(i,o,n,r.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:c.encodeBase64(o),ephemPublicKey:c.encodeBase64(r.publicKey),ciphertext:c.encodeBase64(s)}}throw new Error("Encryption type/version not supported")}function f({encryptedData:e,privateKey:t}){if((0,u.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,u.isNullish)(t))throw new Error("Missing privateKey parameter");if("x25519-xsalsa20-poly1305"===e.version){const r=d(t),n=a.box.keyPair.fromSecretKey(r).secretKey,i=c.decodeBase64(e.nonce),o=c.decodeBase64(e.ciphertext),s=c.decodeBase64(e.ephemPublicKey),u=a.box.open(o,i,s,n);try{if(!u)throw new Error;const e=c.encodeUTF8(u);if(!e)throw new Error;return e}catch(e){if(e&&"string"==typeof e.message&&e.message.length)throw new Error(`Decryption failed: ${e.message}`);throw new Error("Decryption failed.")}}throw new Error("Encryption type/version not supported.")}function d(e){const t=n.from(e,"hex").toString("base64");return c.decodeBase64(t)}t.encrypt=l,t.encryptSafely=function({publicKey:e,data:t,version:r}){if((0,u.isNullish)(e))throw new Error("Missing publicKey parameter");if((0,u.isNullish)(t))throw new Error("Missing data parameter");if((0,u.isNullish)(r))throw new Error("Missing version parameter");if("object"==typeof t&&t&&"toJSON"in t)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const i={data:t,padding:""},o=n.byteLength(JSON.stringify(i),"utf-8")%2048;let s=0;return o>0&&(s=2048-o-16),i.padding="0".repeat(s),l({publicKey:e,data:JSON.stringify(i),version:r})},t.decrypt=f,t.decryptSafely=function({encryptedData:e,privateKey:t}){if((0,u.isNullish)(e))throw new Error("Missing encryptedData parameter");if((0,u.isNullish)(t))throw new Error("Missing privateKey parameter");return JSON.parse(f({encryptedData:e,privateKey:t})).data},t.getEncryptionPublicKey=function(e){const t=d(e),r=a.box.keyPair.fromSecretKey(t).publicKey;return c.encodeBase64(r)}},539:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.normalize=t.concatSig=void 0,i(r(1695),t),i(r(5190),t),i(r(2517),t);var o=r(5491);Object.defineProperty(t,"concatSig",{enumerable:!0,get:function(){return o.concatSig}}),Object.defineProperty(t,"normalize",{enumerable:!0,get:function(){return o.normalize}})},1695:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractPublicKey=t.recoverPersonalSignature=t.personalSign=void 0;const n=r(9303),i=r(5491);function o(e,t){const r=(0,n.hashPersonalMessage)((0,i.legacyToBuffer)(e));return(0,i.recoverPublicKey)(r,t)}t.personalSign=function({privateKey:e,data:t}){if((0,i.isNullish)(t))throw new Error("Missing data parameter");if((0,i.isNullish)(e))throw new Error("Missing privateKey parameter");const r=(0,i.legacyToBuffer)(t),o=(0,n.hashPersonalMessage)(r),s=(0,n.ecsign)(o,e);return(0,i.concatSig)((0,n.toBuffer)(s.v),s.r,s.s)},t.recoverPersonalSignature=function({data:e,signature:t}){if((0,i.isNullish)(e))throw new Error("Missing data parameter");if((0,i.isNullish)(t))throw new Error("Missing signature parameter");const r=o(e,t),s=(0,n.publicToAddress)(r);return(0,n.bufferToHex)(s)},t.extractPublicKey=function({data:e,signature:t}){if((0,i.isNullish)(e))throw new Error("Missing data parameter");if((0,i.isNullish)(t))throw new Error("Missing signature parameter");return`0x${o(e,t).toString("hex")}`}},5190:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.recoverTypedSignature=t.signTypedData=t.typedSignatureHash=t.TypedDataUtils=t.TYPED_MESSAGE_SCHEMA=t.SignTypedDataVersion=void 0;const n=r(9303),i=r(260),o=r(4206),s=r(2313),a=r(1791),c=r(1115),u=r(5491);var l;function f(e,t){if(!Object.keys(l).includes(e))throw new Error(`Invalid version: '${e}'`);if(t&&!t.includes(e))throw new Error(`SignTypedDataVersion not allowed: '${e}'. Allowed versions are: ${t.join(", ")}`)}function d(e,t){(0,a.assert)(null!==t,`Unable to encode value: Invalid number. Expected a valid number value, but received "${t}".`);const r=BigInt(t),n=(0,o.getLength)(e),i=BigInt(2)**BigInt(n)-BigInt(1);return(0,a.assert)(r>=-i&&r<=i,`Unable to encode value: Number "${t}" is out of range for type "${e}".`),r}function h(e){let t=BigInt(0);for(let r=0;r<e.length;r++){const n=BigInt(e.charCodeAt(r)-48);t*=BigInt(10),t+=n>=49?n-BigInt(49)+BigInt(10):n>=17?n-BigInt(17)+BigInt(10):n}return(0,s.padStart)((0,a.bigIntToBytes)(t),20)}function p(e,t,r,o,u){if(f(u,[l.V3,l.V4]),void 0!==e[r])return["bytes32",u===l.V4&&null==o?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,n.arrToBufArr)((0,c.keccak256)(g(r,o,e,u)))];if("function"===r)throw new Error('Unsupported or invalid type: "function"');if(void 0===o)throw new Error(`missing value for field ${t} of type ${r}`);if("address"===r){if("number"==typeof o)return["address",(0,s.padStart)((0,a.numberToBytes)(o),20)];if((0,a.isStrictHexString)(o))return["address",(0,a.add0x)(o)];if("string"==typeof o)return["address",h(o).subarray(0,20)]}if("bool"===r)return["bool",Boolean(o)];if("bytes"===r)return"number"==typeof o?o=(0,a.numberToBytes)(o):(0,a.isStrictHexString)(o)?o=(0,a.hexToBytes)(o):"string"==typeof o&&(o=(0,a.stringToBytes)(o)),["bytes32",(0,n.arrToBufArr)((0,c.keccak256)(o))];if(r.startsWith("bytes")&&"bytes"!==r&&!r.includes("["))return"number"==typeof o?o<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,a.bigIntToBytes)(BigInt(o))]:(0,a.isStrictHexString)(o)?["bytes32",(0,a.hexToBytes)(o)]:["bytes32",o];if(r.startsWith("int")&&!r.includes("[")){const e=d(r,o);return e>=BigInt(0)?["uint256",e]:["int256",e]}if("string"===r)return o="number"==typeof o?(0,a.numberToBytes)(o):(0,a.stringToBytes)(null!=o?o:""),["bytes32",(0,n.arrToBufArr)((0,c.keccak256)(o))];if(r.endsWith("]")){if(u===l.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const s=r.slice(0,r.lastIndexOf("[")),a=o.map((r=>p(e,t,s,r,u)));return["bytes32",(0,n.arrToBufArr)((0,c.keccak256)((0,i.encode)(a.map((([e])=>e)),a.map((([,e])=>e)))))]}return[r,o]}function g(e,t,r,o){f(o,[l.V3,l.V4]);const s=["bytes32"],a=[v(e,r)];for(const n of r[e]){if(o===l.V3&&void 0===t[n.name])continue;const[e,i]=p(r,n.name,n.type,t[n.name],o);s.push(e),a.push(i)}return(0,n.arrToBufArr)((0,i.encode)(s,a))}function y(e,t){let r="";const n=m(e,t);n.delete(e);const i=[e,...Array.from(n).sort()];for(const e of i){if(!t[e])throw new Error(`No type definition specified: ${e}`);r+=`${e}(${t[e].map((({name:e,type:t})=>`${t} ${e}`)).join(",")})`}return r}function m(e,t,r=new Set){if("string"!=typeof e)throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(e)}`);const n=e.match(/^\w*/u);if([e]=n,r.has(e)||void 0===t[e])return r;r.add(e);for(const n of t[e])m(n.type,t,r);return r}function b(e,t,r,i){f(i,[l.V3,l.V4]);const o=g(e,t,r,i),s=(0,c.keccak256)(o);return(0,n.arrToBufArr)(s)}function v(e,t){const r=(0,a.stringToBytes)(y(e,t));return(0,n.arrToBufArr)((0,c.keccak256)(r))}function w(e){const r={};for(const n in t.TYPED_MESSAGE_SCHEMA.properties)e[n]&&(r[n]=e[n]);return"types"in r&&(r.types=Object.assign({EIP712Domain:[]},r.types)),r}function A(e,t){f(t,[l.V3,l.V4]);const r=w(e),{domain:n}=r;return b("EIP712Domain",n,{EIP712Domain:r.types.EIP712Domain},t)}function E(e,t){if((0,o.isArrayType)(e)&&Array.isArray(t)){const[r]=(0,o.getArrayType)(e);return t.map((e=>E(r,e)))}if("address"===e){if("number"==typeof t)return(0,s.padStart)((0,a.numberToBytes)(t),20);if((0,a.isStrictHexString)(t))return(0,s.padStart)((0,a.hexToBytes)(t).subarray(0,20),20);if(t instanceof Uint8Array)return(0,s.padStart)(t.subarray(0,20),20)}if("bool"===e)return Boolean(t);if(e.startsWith("bytes")&&"bytes"!==e){const r=(0,o.getByteLength)(e);if("number"==typeof t)return t<0?new Uint8Array:(0,a.numberToBytes)(t).subarray(0,r);if((0,a.isStrictHexString)(t))return(0,a.hexToBytes)(t).subarray(0,r);if(t instanceof Uint8Array)return t.subarray(0,r)}if(e.startsWith("uint")&&"number"==typeof t)return Math.abs(t);if(e.startsWith("int")&&"number"==typeof t){const r=(0,o.getLength)(e);return BigInt.asIntN(r,BigInt(t))}return t}function _(e,t){return t.map((t=>{if("string"==typeof t||"number"==typeof t||"bigint"==typeof t){const r=d(e,t);if(r>=BigInt(0))return(0,s.padStart)((0,a.bigIntToBytes)(r),32);const n=(0,o.getLength)(e),i=BigInt.asIntN(n,r);return(0,a.signedBigIntToBytes)(i,32)}return t}))}function S(e){const t=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!("length"in e)||!e.length)throw t;const r=e.map((({name:e,type:t,value:r})=>{if("address[]"===t)return{name:e,type:"bytes32[]",value:(n=r,n.map((e=>"number"==typeof e?(0,s.padStart)((0,a.numberToBytes)(e),32):(0,a.isStrictHexString)(e)?(0,s.padStart)((0,a.hexToBytes)(e).subarray(0,32),32):e instanceof Uint8Array?(0,s.padStart)(e.subarray(0,32),32):e)))};var n;if(t.startsWith("int")&&(0,o.isArrayType)(t)){const[n,i]=(0,o.getArrayType)(t);return{name:e,type:`bytes32[${null!=i?i:""}]`,value:_(n,r)}}return{name:e,type:t,value:E(t,r)}})),l=r.map((e=>"bytes"!==e.type?e.value:(0,u.legacyToBuffer)(e.value))),f=r.map((e=>{if("function"===e.type)throw new Error('Unsupported or invalid type: "function"');return e.type})),d=e.map((e=>{if(!e.name)throw t;return`${e.type} ${e.name}`}));return(0,n.arrToBufArr)((0,c.keccak256)((0,i.encodePacked)(["bytes32","bytes32"],[(0,c.keccak256)((0,i.encodePacked)(["string[]"],[d],!0)),(0,c.keccak256)((0,i.encodePacked)(f,l,!0))])))}!function(e){e.V1="V1",e.V3="V3",e.V4="V4"}(l=t.SignTypedDataVersion||(t.SignTypedDataVersion={})),t.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},t.TypedDataUtils={encodeData:g,encodeType:y,findTypeDependencies:m,hashStruct:b,hashType:v,sanitizeData:w,eip712Hash:function(e,t){f(t,[l.V3,l.V4]);const r=w(e),i=[(0,a.hexToBytes)("1901")];return i.push(A(e,t)),"EIP712Domain"!==r.primaryType&&i.push(b(r.primaryType,r.message,r.types,t)),(0,n.arrToBufArr)((0,c.keccak256)((0,a.concatBytes)(i)))},eip712DomainHash:A},t.typedSignatureHash=function(e){const t=S(e);return(0,a.bytesToHex)(t)},t.signTypedData=function({privateKey:e,data:r,version:i}){if(f(i),(0,u.isNullish)(r))throw new Error("Missing data parameter");if((0,u.isNullish)(e))throw new Error("Missing private key parameter");const o=i===l.V1?S(r):t.TypedDataUtils.eip712Hash(r,i),s=(0,n.ecsign)(o,e);return(0,u.concatSig)((0,n.arrToBufArr)((0,a.bigIntToBytes)(s.v)),s.r,s.s)},t.recoverTypedSignature=function({data:e,signature:r,version:i}){if(f(i),(0,u.isNullish)(e))throw new Error("Missing data parameter");if((0,u.isNullish)(r))throw new Error("Missing signature parameter");const o=i===l.V1?S(e):t.TypedDataUtils.eip712Hash(e,i),s=(0,u.recoverPublicKey)(o,r),c=(0,n.publicToAddress)(s);return(0,a.bytesToHex)(c)}},5491:(e,t,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.normalize=t.recoverPublicKey=t.concatSig=t.legacyToBuffer=t.isNullish=t.padWithZeroes=void 0;const i=r(9303),o=r(1791),s=r(1538);function a(e,t){if(""!==e&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(t<0)throw new Error(`Expected a non-negative integer target length. Received: ${t}`);return String.prototype.padStart.call(e,t,"0")}function c(e){return null==e}t.padWithZeroes=a,t.isNullish=c,t.legacyToBuffer=function(e){return"string"!=typeof e||(0,s.isHexString)(e)?(0,i.toBuffer)(e):n.from(e)},t.concatSig=function(e,t,r){const n=(0,i.fromSigned)(t),c=(0,i.fromSigned)(r),u=(0,i.bufferToInt)(e),l=a((0,i.toUnsigned)(n).toString("hex"),64),f=a((0,i.toUnsigned)(c).toString("hex"),64),d=(0,s.stripHexPrefix)((0,s.intToHex)(u));return(0,o.add0x)(l.concat(f,d))},t.recoverPublicKey=function(e,t){const r=(0,i.fromRpcSig)(t);return(0,i.ecrecover)(e,r.v,r.r,r.s)},t.normalize=function(e){if(!c(e)){if("number"==typeof e){if(e<0)return"0x";const t=(0,o.numberToBytes)(e);e=(0,o.bytesToHex)(t)}if("string"!=typeof e){let t="eth-sig-util.normalize() requires hex string or integer input.";throw t+=` received ${typeof e}: ${e}`,new Error(t)}return(0,o.add0x)(e.toLowerCase())}}},2660:(e,t,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.accountBodyToRLP=t.accountBodyToSlim=t.accountBodyFromSlim=t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;const i=r(7256),o=r(1115),s=r(101),a=r(144),c=r(756),u=r(8413),l=r(6243),f=r(4403),d=BigInt(0);class h{constructor(e=d,t=d,r=u.KECCAK256_RLP,n=u.KECCAK256_NULL){this.nonce=e,this.balance=t,this.storageRoot=r,this.codeHash=n,this._validate()}static fromAccountData(e){const{nonce:t,balance:r,storageRoot:n,codeHash:i}=e;return new h(void 0!==t?(0,c.bufferToBigInt)((0,c.toBuffer)(t)):void 0,void 0!==r?(0,c.bufferToBigInt)((0,c.toBuffer)(r)):void 0,void 0!==n?(0,c.toBuffer)(n):void 0,void 0!==i?(0,c.toBuffer)(i):void 0)}static fromRlpSerializedAccount(e){const t=(0,c.arrToBufArr)(i.RLP.decode(Uint8Array.from(e)));if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)}static fromValuesArray(e){const[t,r,n,i]=e;return new h((0,c.bufferToBigInt)(t),(0,c.bufferToBigInt)(r),n,i)}_validate(){if(this.nonce<d)throw new Error("nonce must be greater than zero");if(this.balance<d)throw new Error("balance must be greater than zero");if(32!==this.storageRoot.length)throw new Error("storageRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")}raw(){return[(0,c.bigIntToUnpaddedBuffer)(this.nonce),(0,c.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return n.from(i.RLP.encode((0,c.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(u.KECCAK256_NULL)}isEmpty(){return this.balance===d&&this.nonce===d&&this.codeHash.equals(u.KECCAK256_NULL)}}function p(e){const[t,r,n,i]=e;return[t,r,0===(0,c.arrToBufArr)(n).length?u.KECCAK256_RLP:n,0===(0,c.arrToBufArr)(i).length?u.KECCAK256_NULL:i]}t.Account=h,t.isValidAddress=function(e){try{(0,l.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)},t.toChecksumAddress=function(e,t){(0,l.assertIsHexString)(e);const r=(0,f.stripHexPrefix)(e).toLowerCase();let i="";void 0!==t&&(i=(0,c.bufferToBigInt)((0,c.toBuffer)(t)).toString()+"0x");const s=n.from(i+r,"utf8"),u=(0,a.bytesToHex)((0,o.keccak256)(s));let d="0x";for(let e=0;e<r.length;e++)parseInt(u[e],16)>=8?d+=r[e].toUpperCase():d+=r[e];return d},t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e},t.generateAddress=function(e,t){return(0,l.assertIsBuffer)(e),(0,l.assertIsBuffer)(t),(0,c.bufferToBigInt)(t)===BigInt(0)?n.from((0,o.keccak256)(i.RLP.encode((0,c.bufArrToArr)([e,null])))).slice(-20):n.from((0,o.keccak256)(i.RLP.encode((0,c.bufArrToArr)([e,t])))).slice(-20)},t.generateAddress2=function(e,t,r){if((0,l.assertIsBuffer)(e),(0,l.assertIsBuffer)(t),(0,l.assertIsBuffer)(r),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==t.length)throw new Error("Expected salt to be of length 32");const i=(0,o.keccak256)(n.concat([n.from("ff","hex"),e,t,(0,o.keccak256)(r)]));return(0,c.toBuffer)(i).slice(-20)},t.isValidPrivate=function(e){return s.secp256k1.utils.isValidPrivateKey(e)},t.isValidPublic=function(e,t=!1){if((0,l.assertIsBuffer)(e),64===e.length)try{return s.secp256k1.ProjectivePoint.fromHex(n.concat([n.from([4]),e])),!0}catch(e){return!1}if(!t)return!1;try{return s.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}},t.pubToAddress=function(e,t=!1){if((0,l.assertIsBuffer)(e),t&&64!==e.length&&(e=n.from(s.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),64!==e.length)throw new Error("Expected pubKey to be of length 64");return n.from((0,o.keccak256)(e)).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToPublic=function(e){return(0,l.assertIsBuffer)(e),n.from(s.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1))},t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))},t.importPublic=function(e){return(0,l.assertIsBuffer)(e),64!==e.length&&(e=n.from(s.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1))),e},t.zeroAddress=function(){const e=(0,c.zeros)(20);return(0,c.bufferToHex)(e)},t.isZeroAddress=function(e){try{(0,l.assertIsString)(e)}catch(e){return!1}return(0,t.zeroAddress)()===e},t.accountBodyFromSlim=p;const g=new Uint8Array(0);t.accountBodyToSlim=function(e){const[t,r,n,i]=e;return[t,r,(0,c.arrToBufArr)(n).equals(u.KECCAK256_RLP)?g:n,(0,c.arrToBufArr)(i).equals(u.KECCAK256_NULL)?g:i]},t.accountBodyToRLP=function(e,t=!0){const r=t?p(e):e;return(0,c.arrToBufArr)(i.RLP.encode(r))}},6175:(e,t,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;const i=r(2660),o=r(756);class s{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.buf=e}static zero(){return new s((0,o.zeros)(20))}static fromString(e){if(!(0,i.isValidAddress)(e))throw new Error("Invalid address");return new s((0,o.toBuffer)(e))}static fromPublicKey(e){if(!n.isBuffer(e))throw new Error("Public key should be Buffer");const t=(0,i.pubToAddress)(e);return new s(t)}static fromPrivateKey(e){if(!n.isBuffer(e))throw new Error("Private key should be Buffer");const t=(0,i.privateToAddress)(e);return new s(t)}static generate(e,t){if("bigint"!=typeof t)throw new Error("Expected nonce to be a bigint");return new s((0,i.generateAddress)(e.buf,(0,o.bigIntToBuffer)(t)))}static generate2(e,t,r){if(!n.isBuffer(t))throw new Error("Expected salt to be a Buffer");if(!n.isBuffer(r))throw new Error("Expected initCode to be a Buffer");return new s((0,i.generateAddress2)(e.buf,t,r))}equals(e){return this.buf.equals(e.buf)}isZero(){return this.equals(s.zero())}isPrecompileOrSystemAddress(){const e=(0,o.bufferToBigInt)(this.buf),t=BigInt(0),r=BigInt("0xffff");return e>=t&&e<=r}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return n.from(this.buf)}}t.Address=s},5778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncEventEmitter=void 0;const n=r(2699);class i extends n.EventEmitter{emit(e,...t){let[r,n]=t;const i=this;let o=i._events[e]??[];return void 0===n&&"function"==typeof r&&(n=r,r=void 0),"newListener"!==e&&"removeListener"!==e||(r={event:r,fn:n},n=void 0),o=Array.isArray(o)?o:[o],async function(e,t,r){let n;for await(const i of t)try{i.length<2?i.call(e,r):await new Promise(((t,n)=>{i.call(e,r,(e=>{e?n(e):t()}))}))}catch(e){n=e}if(n)throw n}(i,o.slice(),r).then(n).catch(n),i.listenerCount(e)>0}once(e,t){const r=this;let n;if("function"!=typeof t)throw new TypeError("listener must be a function");return n=t.length>=2?function(i,o){r.removeListener(e,n),t(i,o)}:function(i){r.removeListener(e,n),t(i,n)},r.on(e,n),r}first(e,t){let r=this._events[e]??[];if("function"!=typeof t)throw new TypeError("listener must be a function");return Array.isArray(r)||(this._events[e]=r=[r]),r.unshift(t),this}before(e,t,r){return this.beforeOrAfter(e,t,r)}after(e,t,r){return this.beforeOrAfter(e,t,r,"after")}beforeOrAfter(e,t,r,n){let i,o,s=this._events[e]??[];const a="after"===n?1:0;if("function"!=typeof r)throw new TypeError("listener must be a function");if("function"!=typeof t)throw new TypeError("target must be a function");for(Array.isArray(s)||(this._events[e]=s=[s]),o=s.length,i=s.length;i--;)if(s[i]===t){o=i+a;break}return s.splice(o,0,r),this}on(e,t){return super.on(e,t)}addListener(e,t){return super.addListener(e,t)}prependListener(e,t){return super.prependListener(e,t)}prependOnceListener(e,t){return super.prependOnceListener(e,t)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,t){return super.removeListener(e,t)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}t.AsyncEventEmitter=i},756:(e,t,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.intToUnpaddedBuffer=t.bigIntToUnpaddedBuffer=t.bigIntToHex=t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.short=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToInt=t.bigIntToBuffer=t.bufferToBigInt=t.bufferToHex=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;const i=r(6243),o=r(4403);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`},t.intToBuffer=function(e){const r=(0,t.intToHex)(e);return n.from((0,o.padToEven)(r.slice(2)),"hex")},t.zeros=function(e){return n.allocUnsafe(e).fill(0)};const s=function(e,r,n){const i=(0,t.zeros)(r);return n?e.length<r?(e.copy(i),i):e.slice(0,r):e.length<r?(e.copy(i,r-e.length),i):e.slice(-r)};t.setLengthLeft=function(e,t){return(0,i.assertIsBuffer)(e),s(e,t,!1)},t.setLengthRight=function(e,t){return(0,i.assertIsBuffer)(e),s(e,t,!0)};const a=function(e){let t=e[0];for(;e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};function c(e){const r=(0,t.bufferToHex)(e);return"0x"===r?BigInt(0):BigInt(r)}function u(e){return(0,t.toBuffer)("0x"+e.toString(16))}t.unpadBuffer=function(e){return(0,i.assertIsBuffer)(e),a(e)},t.unpadArray=function(e){return(0,i.assertIsArray)(e),a(e)},t.unpadHexString=function(e){return(0,i.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),"0x"+a(e)},t.toBuffer=function(e){if(null==e)return n.allocUnsafe(0);if(n.isBuffer(e))return n.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return n.from(e);if("string"==typeof e){if(!(0,o.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return n.from((0,o.padToEven)((0,o.stripHexPrefix)(e)),"hex")}if("number"==typeof e)return(0,t.intToBuffer)(e);if("bigint"==typeof e){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${e}`);let t=e.toString(16);return t.length%2&&(t="0"+t),n.from(t,"hex")}if(e.toArray)return n.from(e.toArray());if(e.toBuffer)return n.from(e.toBuffer());throw new Error("invalid type")},t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")},t.bufferToBigInt=c,t.bigIntToBuffer=u,t.bufferToInt=function(e){const t=Number(c(e));if(!Number.isSafeInteger(t))throw new Error("Number exceeds 53 bits");return t},t.fromSigned=function(e){return BigInt.asIntN(256,c(e))},t.toUnsigned=function(e){return u(BigInt.asUintN(256,e))},t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e},t.short=function(e,t=50){const r=n.isBuffer(e)?e.toString("hex"):e;return r.length<=t?r:r.slice(0,t)+"…"},t.toUtf8=function(e){if((e=(0,o.stripHexPrefix)(e)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return n.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")},t.baToJSON=function(e){if(n.isBuffer(e))return`0x${e.toString("hex")}`;if(e instanceof Array){const r=[];for(let n=0;n<e.length;n++)r.push((0,t.baToJSON)(e[n]));return r}},t.validateNoLeadingZeroes=function(e){for(const[t,r]of Object.entries(e))if(void 0!==r&&r.length>0&&0===r[0])throw new Error(`${t} cannot have leading zeroes, received: ${r.toString("hex")}`)},t.arrToBufArr=function e(t){return Array.isArray(t)?t.map((t=>e(t))):n.from(t)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((t=>e(t))):Uint8Array.from(t??[])},t.bigIntToHex=e=>"0x"+e.toString(16),t.bigIntToUnpaddedBuffer=function(e){return(0,t.unpadBuffer)(u(e))},t.intToUnpaddedBuffer=function(e){return(0,t.unpadBuffer)((0,t.intToBuffer)(e))}},8413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_WITHDRAWALS_PER_PAYLOAD=t.RLP_EMPTY_STRING=t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.SECP256K1_ORDER_DIV_2=t.SECP256K1_ORDER=t.MAX_INTEGER_BIGINT=t.MAX_INTEGER=t.MAX_UINT64=void 0;const n=r(8834),i=r(101);t.MAX_UINT64=BigInt("0xffffffffffffffff"),t.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),t.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),t.SECP256K1_ORDER=i.secp256k1.CURVE.n,t.SECP256K1_ORDER_DIV_2=i.secp256k1.CURVE.n/BigInt(2),t.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.Buffer.from(t.KECCAK256_RLP_S,"hex"),t.RLP_EMPTY_STRING=n.Buffer.from([128]),t.MAX_WITHDRAWALS_PER_PAYLOAD=16},2921:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compactBytesToNibbles=t.bytesToNibbles=t.nibblesToCompactBytes=t.nibblesToBytes=t.hasTerminator=void 0,t.hasTerminator=e=>e.length>0&&16===e[e.length-1],t.nibblesToBytes=(e,t)=>{for(let r=0,n=0;n<e.length;r+=1,n+=2)t[r]=e[n]<<4|e[n+1]},t.nibblesToCompactBytes=e=>{let r=0;(0,t.hasTerminator)(e)&&(r=1,e=e.subarray(0,e.length-1));const n=new Uint8Array(e.length/2+1);return n[0]=r<<5,1==(1&e.length)&&(n[0]|=16,n[0]|=e[0],e=e.subarray(1)),(0,t.nibblesToBytes)(e,n.subarray(1)),n},t.bytesToNibbles=e=>{const t=2*e.length+1,r=new Uint8Array(t);for(let t=0;t<e.length;t++){const n=e[t];r[2*t]=n/16,r[2*t+1]=n%16}return r[t-1]=16,r},t.compactBytesToNibbles=e=>{if(0===e.length)return e;let r=(0,t.bytesToNibbles)(e);r[0]<2&&(r=r.subarray(0,r.length-1));const n=2-(1&r[0]);return r.subarray(n)}},6243:(e,t,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;const i=r(4403);t.assertIsHexString=function(e){if(!(0,i.isHexString)(e))throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)},t.assertIsBuffer=function(e){if(!n.isBuffer(e))throw new Error(`This method only supports Buffer but input was: ${e}`)},t.assertIsArray=function(e){if(!Array.isArray(e))throw new Error(`This method only supports number arrays but input was: ${e}`)},t.assertIsString=function(e){if("string"!=typeof e)throw new Error(`This method only supports strings but input was: ${e}`)}},9303:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.toAscii=t.stripHexPrefix=t.padToEven=t.isHexString=t.isHexPrefixed=t.getKeys=t.getBinarySize=t.fromUtf8=t.fromAscii=t.arrayContainsArray=void 0,i(r(8413),t),i(r(7835),t),i(r(2660),t),i(r(6175),t),i(r(2334),t),i(r(6413),t),i(r(756),t),i(r(5263),t),i(r(2921),t),i(r(5778),t);var o=r(4403);Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return o.isHexString}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),i(r(5594),t),i(r(6698),t)},4403:(e,t,r)=>{"use strict";var n=r(8834).Buffer;function i(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}function o(e){let t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received "+typeof t);return t.length%2&&(t=`0${t}`),t}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=i,t.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return i(e)?e.slice(2):e},t.padToEven=o,t.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof e);return n.byteLength(e,"utf8")},t.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(t))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[!0===r?"some":"every"]((t=>e.indexOf(t)>=0))},t.toAscii=function(e){let t="",r=0;const n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){const n=parseInt(e.substr(r,2),16);t+=String.fromCharCode(n)}return t},t.fromUtf8=function(e){return`0x${o(n.from(e,"utf8").toString("hex")).replace(/^0+|0+$/g,"")}`},t.fromAscii=function(e){let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r).toString(16);t+=n.length<2?`0${n}`:n}return`0x${t}`},t.getKeys=function(e,t,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got "+typeof e);if("string"!=typeof t)throw new Error("[getKeys] method expects input 'key' to be type 'string', got "+typeof e);const n=[];for(let i=0;i<e.length;i++){let o=e[i][t];if(!0!==r||o){if("string"!=typeof o)throw new Error("invalid abi - expected type 'string', received "+typeof o)}else o="";n.push(o)}return n},t.isHexString=function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||void 0!==t&&t>0&&e.length!==2+2*t)}},5594:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Lock=void 0,t.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}}},6698:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getProvider=t.fetchFromProvider=void 0;const n=r(2973);t.fetchFromProvider=async(e,t)=>(await(0,n.default)(e,{headers:{"content-type":"application/json"},type:"json",data:{method:t.method,params:t.params,jsonrpc:"2.0",id:1}})).result,t.getProvider=e=>{if("string"==typeof e)return e;if(void 0!==e?.connection?.url)return e.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")}},6413:(e,t,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;const i=r(1115),o=r(101),s=r(756),a=r(8413),c=r(6243);function u(e,t){return e===BigInt(0)||e===BigInt(1)?e:void 0===t?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function l(e){return e===BigInt(0)||e===BigInt(1)}t.ecsign=function(e,t,r){const i=o.secp256k1.sign(e,t),s=i.toCompactRawBytes();return{r:n.from(s.slice(0,32)),s:n.from(s.slice(32,64)),v:void 0===r?BigInt(i.recovery+27):BigInt(i.recovery+35)+BigInt(r)*BigInt(2)}},t.ecrecover=function(e,t,r,i,a){const c=n.concat([(0,s.setLengthLeft)(r,32),(0,s.setLengthLeft)(i,32)],64),f=u(t,a);if(!l(f))throw new Error("Invalid signature v value");const d=o.secp256k1.Signature.fromCompact(c).addRecoveryBit(Number(f)).recoverPublicKey(e);return n.from(d.toRawBytes(!1).slice(1))},t.toRpcSig=function(e,t,r,i){if(!l(u(e,i)))throw new Error("Invalid signature v value");return(0,s.bufferToHex)(n.concat([(0,s.setLengthLeft)(t,32),(0,s.setLengthLeft)(r,32),(0,s.toBuffer)(e)]))},t.toCompactSig=function(e,t,r,i){if(!l(u(e,i)))throw new Error("Invalid signature v value");let o=r;return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(o=n.from(r),o[0]|=128),(0,s.bufferToHex)(n.concat([(0,s.setLengthLeft)(t,32),(0,s.setLengthLeft)(o,32)]))},t.fromRpcSig=function(e){const t=(0,s.toBuffer)(e);let r,n,i;if(t.length>=65)r=t.slice(0,32),n=t.slice(32,64),i=(0,s.bufferToBigInt)(t.slice(64));else{if(64!==t.length)throw new Error("Invalid signature length");r=t.slice(0,32),n=t.slice(32,64),i=BigInt((0,s.bufferToInt)(t.slice(32,33))>>7),n[0]&=127}return i<27&&(i+=BigInt(27)),{v:i,r,s:n}},t.isValidSignature=function(e,t,r,n=!0,i){if(32!==t.length||32!==r.length)return!1;if(!l(u(e,i)))return!1;const o=(0,s.bufferToBigInt)(t),c=(0,s.bufferToBigInt)(r);return!(o===BigInt(0)||o>=a.SECP256K1_ORDER||c===BigInt(0)||c>=a.SECP256K1_ORDER||n&&c>=a.SECP256K1_ORDER_DIV_2)},t.hashPersonalMessage=function(e){(0,c.assertIsBuffer)(e);const t=n.from(`Ethereum Signed Message:\n${e.length}`,"utf-8");return n.from((0,i.keccak256)(n.concat([t,e])))}},5263:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=void 0;const n=r(756),i=r(4403);var o;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(o=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null;if(void 0===e)return;if("string"==typeof e&&!(0,i.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const r=(0,n.toBuffer)(e);switch(t){case o.Buffer:return r;case o.BigInt:return(0,n.bufferToBigInt)(r);case o.Number:{const e=(0,n.bufferToBigInt)(r);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case o.PrefixedHexString:return(0,n.bufferToHex)(r);default:throw new Error("unknown outputType")}}},7835:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GWEI_TO_WEI=void 0,t.GWEI_TO_WEI=BigInt(1e9)},2334:(e,t,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Withdrawal=void 0;const i=r(6175),o=r(756),s=r(5263);class a{constructor(e,t,r,n){this.index=e,this.validatorIndex=t,this.address=r,this.amount=n}static fromWithdrawalData(e){const{index:t,validatorIndex:r,address:n,amount:o}=e,c=(0,s.toType)(t,s.TypeOutput.BigInt),u=(0,s.toType)(r,s.TypeOutput.BigInt),l=new i.Address((0,s.toType)(n,s.TypeOutput.Buffer)),f=(0,s.toType)(o,s.TypeOutput.BigInt);return new a(c,u,l,f)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[t,r,n,i]=e;return a.fromWithdrawalData({index:t,validatorIndex:r,address:n,amount:i})}static toBufferArray(e){const{index:t,validatorIndex:r,address:o,amount:a}=e,c=(0,s.toType)(t,s.TypeOutput.BigInt)===BigInt(0)?n.alloc(0):(0,s.toType)(t,s.TypeOutput.Buffer),u=(0,s.toType)(r,s.TypeOutput.BigInt)===BigInt(0)?n.alloc(0):(0,s.toType)(r,s.TypeOutput.Buffer);let l;return l=o instanceof i.Address?o.buf:(0,s.toType)(o,s.TypeOutput.Buffer),[c,u,l,(0,s.toType)(a,s.TypeOutput.BigInt)===BigInt(0)?n.alloc(0):(0,s.toType)(a,s.TypeOutput.Buffer)]}raw(){return a.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,o.bigIntToHex)(this.index),validatorIndex:(0,o.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,o.bigIntToHex)(this.amount)}}}t.Withdrawal=a},8856: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.EthereumProviderError=t.JsonRpcError=void 0;const i=r(1791),o=n(r(7847)),s=r(7962);class a extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a non-empty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,(0,i.isPlainObject)(this.data)&&(e.data.cause=(0,s.serializeCause)(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return(0,o.default)(this.serialize(),c,2)}}function c(e,t){if("[Circular]"!==t)return t}t.JsonRpcError=a,t.EthereumProviderError=class extends a{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},5191:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},6748:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.providerErrors=t.rpcErrors=void 0;const n=r(8856),i=r(5191),o=r(7962);function s(e,t){const[r,i]=c(t);return new n.JsonRpcError(e,r??(0,o.getMessageFromCode)(e),i)}function a(e,t){const[r,i]=c(t);return new n.EthereumProviderError(e,r??(0,o.getMessageFromCode)(e),i)}function c(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t??void 0,r]}}return[]}t.rpcErrors={parse:e=>s(i.errorCodes.rpc.parse,e),invalidRequest:e=>s(i.errorCodes.rpc.invalidRequest,e),invalidParams:e=>s(i.errorCodes.rpc.invalidParams,e),methodNotFound:e=>s(i.errorCodes.rpc.methodNotFound,e),internal:e=>s(i.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:e=>s(i.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>s(i.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>s(i.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>s(i.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>s(i.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>s(i.errorCodes.rpc.limitExceeded,e)},t.providerErrors={userRejectedRequest:e=>a(i.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>a(i.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>a(i.errorCodes.provider.unsupportedMethod,e),disconnected:e=>a(i.errorCodes.provider.disconnected,e),chainDisconnected:e=>a(i.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:i}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,i)}}},774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorCodes=t.providerErrors=t.rpcErrors=t.getMessageFromCode=t.serializeError=t.serializeCause=t.EthereumProviderError=t.JsonRpcError=void 0;var n=r(8856);Object.defineProperty(t,"JsonRpcError",{enumerable:!0,get:function(){return n.JsonRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});var i=r(7962);Object.defineProperty(t,"serializeCause",{enumerable:!0,get:function(){return i.serializeCause}}),Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return i.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}});var o=r(6748);Object.defineProperty(t,"rpcErrors",{enumerable:!0,get:function(){return o.rpcErrors}}),Object.defineProperty(t,"providerErrors",{enumerable:!0,get:function(){return o.providerErrors}});var s=r(5191);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})},7962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeCause=t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=r(1791),i=r(5191),o=i.errorCodes.rpc.internal,s={code:o,message:a(o)};function a(e,r="Unspecified error message. This is a bug, please report it."){if(c(e)){const r=e.toString();if((0,n.hasProperty)(i.errorValues,r))return i.errorValues[r].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function c(e){return Number.isInteger(e)}function u(e){return Array.isArray(e)?e.map((e=>(0,n.isValidJson)(e)?e:(0,n.isObject)(e)?l(e):null)):(0,n.isObject)(e)?l(e):(0,n.isValidJson)(e)?e:null}function l(e){return Object.getOwnPropertyNames(e).reduce(((t,r)=>{const i=e[r];return(0,n.isValidJson)(i)&&(t[r]=i),t}),{})}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=a,t.isValidCode=c,t.serializeError=function(e,{fallbackError:t=s,shouldIncludeStack:r=!0}={}){if(!(0,n.isJsonRpcError)(t))throw new Error("Must provide fallback error with integer number code and string message.");const i=function(e,t){if(e&&"object"==typeof e&&"serialize"in e&&"function"==typeof e.serialize)return e.serialize();if((0,n.isJsonRpcError)(e))return e;return{...t,data:{cause:u(e)}}}(e,t);return r||delete i.stack,i},t.serializeCause=u},9336:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{AssertionError:function(){return o},assert:function(){return s},assertStruct:function(){return a},assertExhaustive:function(){return c}});const n=r(6686);function i(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class o extends Error{constructor(e){var t,r;super(e.message),r="ERR_ASSERTION",(t="code")in this?Object.defineProperty(this,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):this[t]=r}}function s(e,t="Assertion failed.",r=o){if(!e){if(t instanceof Error)throw t;throw i(r,t)}}function a(e,t,r="Assertion failed",s=o){try{(0,n.assert)(e,t)}catch(e){throw i(s,`${r}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}}function c(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},8007:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"base64",{enumerable:!0,get:function(){return o}});const n=r(6686),i=r(9336),o=(e,t={})=>{const r=t.paddingRequired??!1,o=t.characterSet??"base64";let s,a;return"base64"===o?s=String.raw`[A-Za-z0-9+\/]`:((0,i.assert)("base64url"===o),s=String.raw`[-_A-Za-z0-9]`),a=r?new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,n.pattern)(e,a)}},8948:(e,t,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isBytes:function(){return l},assertIsBytes:function(){return f},bytesToHex:function(){return d},bytesToBigInt:function(){return h},bytesToSignedBigInt:function(){return p},bytesToNumber:function(){return g},bytesToString:function(){return y},hexToBytes:function(){return m},bigIntToBytes:function(){return b},signedBigIntToBytes:function(){return v},numberToBytes:function(){return w},stringToBytes:function(){return A},valueToBytes:function(){return E},concatBytes:function(){return _},createDataView:function(){return S}});const i=r(9336),o=r(9965),s=48,a=58,c=87,u=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function l(e){return e instanceof Uint8Array}function f(e){(0,i.assert)(l(e),"Value must be a Uint8Array.")}function d(e){if(f(e),0===e.length)return"0x";const t=u(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,o.add0x)(r.join(""))}function h(e){f(e);const t=d(e);return BigInt(t)}function p(e){f(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)}function g(e){f(e);const t=h(e);return(0,i.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}function y(e){return f(e),(new TextDecoder).decode(e)}function m(e){if("0x"===e?.toLowerCase?.())return new Uint8Array;(0,o.assertIsHexString)(e);const t=(0,o.remove0x)(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),i=r.charCodeAt(2*e+1),o=t-(t<a?s:c),u=i-(i<a?s:c);n[e]=16*o+u}return n}function b(e){return(0,i.assert)("bigint"==typeof e,"Value must be a bigint."),(0,i.assert)(e>=BigInt(0),"Value must be a non-negative bigint."),m(e.toString(16))}function v(e,t){(0,i.assert)("bigint"==typeof e,"Value must be a bigint."),(0,i.assert)("number"==typeof t,"Byte length must be a number."),(0,i.assert)(t>0,"Byte length must be greater than 0."),(0,i.assert)(function(e,t){(0,i.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let e=0;e<n.length;e++)n[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}function w(e){return(0,i.assert)("number"==typeof e,"Value must be a number."),(0,i.assert)(e>=0,"Value must be a non-negative number."),(0,i.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),m(e.toString(16))}function A(e){return(0,i.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function E(e){if("bigint"==typeof e)return b(e);if("number"==typeof e)return w(e);if("string"==typeof e)return e.startsWith("0x")?m(e):A(e);if(l(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}function _(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const i=E(e[n]);t[n]=i,r+=i.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n}function S(e){if(void 0!==n&&e instanceof n){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}},6601:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{CAIP_CHAIN_ID_REGEX:function(){return i},CAIP_NAMESPACE_REGEX:function(){return o},CAIP_REFERENCE_REGEX:function(){return s},CAIP_ACCOUNT_ID_REGEX:function(){return a},CAIP_ACCOUNT_ADDRESS_REGEX:function(){return c},CaipChainIdStruct:function(){return u},CaipNamespaceStruct:function(){return l},CaipReferenceStruct:function(){return f},CaipAccountIdStruct:function(){return d},CaipAccountAddressStruct:function(){return h},isCaipChainId:function(){return p},isCaipNamespace:function(){return g},isCaipReference:function(){return y},isCaipAccountId:function(){return m},isCaipAccountAddress:function(){return b},parseCaipChainId:function(){return v},parseCaipAccountId:function(){return w}});const n=r(6686),i=RegExp("^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$","u"),o=/^[-a-z0-9]{3,8}$/u,s=/^[-_a-zA-Z0-9]{1,32}$/u,a=RegExp("^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$","u"),c=/^[-.%a-zA-Z0-9]{1,128}$/u,u=(0,n.pattern)((0,n.string)(),i),l=(0,n.pattern)((0,n.string)(),o),f=(0,n.pattern)((0,n.string)(),s),d=(0,n.pattern)((0,n.string)(),a),h=(0,n.pattern)((0,n.string)(),c);function p(e){return(0,n.is)(e,u)}function g(e){return(0,n.is)(e,l)}function y(e){return(0,n.is)(e,f)}function m(e){return(0,n.is)(e,d)}function b(e){return(0,n.is)(e,h)}function v(e){const t=i.exec(e);if(!t?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:t.groups.namespace,reference:t.groups.reference}}function w(e){const t=a.exec(e);if(!t?.groups)throw new Error("Invalid CAIP account ID.");return{address:t.groups.accountAddress,chainId:t.groups.chainId,chain:{namespace:t.groups.namespace,reference:t.groups.reference}}}},3100:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ChecksumStruct",{enumerable:!0,get:function(){return o}});const n=r(6686),i=r(8007),o=(0,n.size)((0,i.base64)((0,n.string)(),{paddingRequired:!0}),44,44)},3161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createNumber:function(){return d},createBigInt:function(){return h},createBytes:function(){return p},createHex:function(){return g}});const n=r(6686),i=r(9336),o=r(8948),s=r(9965),a=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),s.StrictHexStruct]),c=(0,n.coerce)((0,n.number)(),a,Number),u=(0,n.coerce)((0,n.bigint)(),a,BigInt),l=((0,n.union)([s.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([s.StrictHexStruct]),o.hexToBytes)),f=(0,n.coerce)(s.StrictHexStruct,(0,n.instance)(Uint8Array),o.bytesToHex);function d(e){try{const t=(0,n.create)(e,c);return(0,i.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}}function h(e){try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}}function p(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,l)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}function g(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,f)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},4945:(e,t)=>{"use strict";function r(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function n(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,r(e,t,"get"))}function i(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}function o(e,t,n){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,r(e,t,"set"),n),n}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{FrozenMap:function(){return c},FrozenSet:function(){return f}});var s=new WeakMap;let a=Symbol.iterator;class c{get size(){return n(this,s).size}[a](){return n(this,s)[Symbol.iterator]()}entries(){return n(this,s).entries()}forEach(e,t){return n(this,s).forEach(((r,n,i)=>e.call(t,r,n,this)))}get(e){return n(this,s).get(e)}has(e){return n(this,s).has(e)}keys(){return n(this,s).keys()}values(){return n(this,s).values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}constructor(e){i(this,s,{writable:!0,value:void 0}),o(this,s,new Map(e)),Object.freeze(this)}}var u=new WeakMap;let l=Symbol.iterator;class f{get size(){return n(this,u).size}[l](){return n(this,u)[Symbol.iterator]()}entries(){return n(this,u).entries()}forEach(e,t){return n(this,u).forEach(((r,n,i)=>e.call(t,r,n,this)))}has(e){return n(this,u).has(e)}keys(){return n(this,u).keys()}values(){return n(this,u).values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}constructor(e){i(this,u,{writable:!0,value:void 0}),o(this,u,new Set(e)),Object.freeze(this)}}Object.freeze(c),Object.freeze(c.prototype),Object.freeze(f),Object.freeze(f.prototype)},870:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9965:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{HexStruct:function(){return a},StrictHexStruct:function(){return c},HexAddressStruct:function(){return u},HexChecksumAddressStruct:function(){return l},isHexString:function(){return f},isStrictHexString:function(){return d},assertIsHexString:function(){return h},assertIsStrictHexString:function(){return p},isValidHexAddress:function(){return g},getChecksumAddress:function(){return y},isValidChecksumAddress:function(){return m},add0x:function(){return b},remove0x:function(){return v}});const n=r(125),i=r(6686),o=r(9336),s=r(8948),a=(0,i.pattern)((0,i.string)(),/^(?:0x)?[0-9a-f]+$/iu),c=(0,i.pattern)((0,i.string)(),/^0x[0-9a-f]+$/iu),u=(0,i.pattern)((0,i.string)(),/^0x[0-9a-f]{40}$/u),l=(0,i.pattern)((0,i.string)(),/^0x[0-9a-fA-F]{40}$/u);function f(e){return(0,i.is)(e,a)}function d(e){return(0,i.is)(e,c)}function h(e){(0,o.assert)(f(e),"Value must be a hexadecimal string.")}function p(e){(0,o.assert)(d(e),'Value must be a hexadecimal string, starting with "0x".')}function g(e){return(0,i.is)(e,u)||m(e)}function y(e){(0,o.assert)((0,i.is)(e,l),"Invalid hex address.");const t=v(e.toLowerCase()),r=v((0,s.bytesToHex)((0,n.keccak_256)(t)));return`0x${t.split("").map(((e,t)=>{const n=r[t];return(0,o.assert)((0,i.is)(n,(0,i.string)()),"Hash shorter than address."),parseInt(n,16)>7?e.toUpperCase():e})).join("")}`}function m(e){return!!(0,i.is)(e,l)&&y(e)===e}function b(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`}function v(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}},1791:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach((function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(9336),t),n(r(8007),t),n(r(8948),t),n(r(6601),t),n(r(3100),t),n(r(3161),t),n(r(4945),t),n(r(870),t),n(r(9965),t),n(r(4081),t),n(r(8982),t),n(r(6280),t),n(r(8554),t),n(r(6596),t),n(r(2485),t),n(r(8435),t),n(r(1080),t),n(r(6717),t)},4081:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{UnsafeJsonStruct:function(){return o},JsonStruct:function(){return s},isValidJson:function(){return a},getSafeJson:function(){return c},getJsonSize:function(){return u},jsonrpc2:function(){return l},JsonRpcVersionStruct:function(){return f},JsonRpcIdStruct:function(){return d},JsonRpcErrorStruct:function(){return h},JsonRpcParamsStruct:function(){return p},JsonRpcRequestStruct:function(){return g},JsonRpcNotificationStruct:function(){return y},isJsonRpcNotification:function(){return m},assertIsJsonRpcNotification:function(){return b},isJsonRpcRequest:function(){return v},assertIsJsonRpcRequest:function(){return w},PendingJsonRpcResponseStruct:function(){return A},JsonRpcSuccessStruct:function(){return E},JsonRpcFailureStruct:function(){return _},JsonRpcResponseStruct:function(){return S},isPendingJsonRpcResponse:function(){return x},assertIsPendingJsonRpcResponse:function(){return T},isJsonRpcResponse:function(){return P},assertIsJsonRpcResponse:function(){return I},isJsonRpcSuccess:function(){return k},assertIsJsonRpcSuccess:function(){return O},isJsonRpcFailure:function(){return C},assertIsJsonRpcFailure:function(){return N},isJsonRpcError:function(){return R},assertIsJsonRpcError:function(){return B},getJsonRpcIdValidator:function(){return M}});const n=r(6686),i=r(9336),o=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),(0,n.define)("finite number",(e=>(0,n.is)(e,(0,n.number)())&&Number.isFinite(e))),(0,n.string)(),(0,n.array)((0,n.lazy)((()=>o))),(0,n.record)((0,n.string)(),(0,n.lazy)((()=>o)))]),s=(0,n.coerce)(o,(0,n.any)(),(e=>((0,i.assertStruct)(e,o),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))))));function a(e){try{return c(e),!0}catch{return!1}}function c(e){return(0,n.create)(e,s)}function u(e){(0,i.assertStruct)(e,s,"Invalid JSON value");const t=JSON.stringify(e);return(new TextEncoder).encode(t).byteLength}const l="2.0",f=(0,n.literal)(l),d=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),h=(0,n.object)({code:(0,n.integer)(),message:(0,n.string)(),data:(0,n.optional)(s),stack:(0,n.optional)((0,n.string)())}),p=(0,n.union)([(0,n.record)((0,n.string)(),s),(0,n.array)(s)]),g=(0,n.object)({id:d,jsonrpc:f,method:(0,n.string)(),params:(0,n.optional)(p)}),y=(0,n.object)({jsonrpc:f,method:(0,n.string)(),params:(0,n.optional)(p)});function m(e){return(0,n.is)(e,y)}function b(e,t){(0,i.assertStruct)(e,y,"Invalid JSON-RPC notification",t)}function v(e){return(0,n.is)(e,g)}function w(e,t){(0,i.assertStruct)(e,g,"Invalid JSON-RPC request",t)}const A=(0,n.object)({id:d,jsonrpc:f,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(h)}),E=(0,n.object)({id:d,jsonrpc:f,result:s}),_=(0,n.object)({id:d,jsonrpc:f,error:h}),S=(0,n.union)([E,_]);function x(e){return(0,n.is)(e,A)}function T(e,t){(0,i.assertStruct)(e,A,"Invalid pending JSON-RPC response",t)}function P(e){return(0,n.is)(e,S)}function I(e,t){(0,i.assertStruct)(e,S,"Invalid JSON-RPC response",t)}function k(e){return(0,n.is)(e,E)}function O(e,t){(0,i.assertStruct)(e,E,"Invalid JSON-RPC success response",t)}function C(e){return(0,n.is)(e,_)}function N(e,t){(0,i.assertStruct)(e,_,"Invalid JSON-RPC failure response",t)}function R(e){return(0,n.is)(e,h)}function B(e,t){(0,i.assertStruct)(e,h,"Invalid JSON-RPC error",t)}function M(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}},8982:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6280:(e,t,r)=>{"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{createProjectLogger:function(){return o},createModuleLogger:function(){return s}});const i=(0,n(r(5130)).default)("metamask");function o(e){return i.extend(e)}function s(e,t){return e.extend(t)}},8554:(e,t)=>{"use strict";function r(e){return Array.isArray(e)&&e.length>0}function n(e){return null==e}function i(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{JsonSize:function(){return a},isNonEmptyArray:function(){return r},isNullOrUndefined:function(){return n},isObject:function(){return i},hasProperty:function(){return o},getKnownPropertyNames:function(){return s},ESCAPE_CHARACTERS_REGEXP:function(){return c},isPlainObject:function(){return u},isASCII:function(){return l},calculateStringSize:function(){return f},calculateNumberSize:function(){return d}});const o=(e,t)=>Object.hasOwnProperty.call(e,t);function s(e){return Object.getOwnPropertyNames(e)}var a;!function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(a||(a={}));const c=/"|\\|\n|\r|\t/gu;function u(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}function l(e){return e.charCodeAt(0)<=127}function f(e){return e.split("").reduce(((e,t)=>l(t)?e+1:e+2),0)+(e.match(c)??[]).length}function d(e){return e.toString().length}},6596:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{numberToHex:function(){return o},bigIntToHex:function(){return s},hexToNumber:function(){return a},hexToBigInt:function(){return c}});const n=r(9336),i=r(9965),o=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,i.add0x)(e.toString(16))),s=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,i.add0x)(e.toString(16))),a=e=>{(0,i.assertIsHexString)(e);const t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t},c=e=>((0,i.assertIsHexString)(e),BigInt((0,i.add0x)(e)))},2485:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8435:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{Duration:function(){return r},inMilliseconds:function(){return i},timeSince:function(){return o}}),function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(r||(r={}));const n=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};function i(e,t){return n(e,"count"),e*t}function o(e){return n(e,"timestamp"),Date.now()-e}},1080:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6717:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{VersionStruct:function(){return s},VersionRangeStruct:function(){return a},isValidSemVerVersion:function(){return c},isValidSemVerRange:function(){return u},assertIsSemVerVersion:function(){return l},assertIsSemVerRange:function(){return f},gtVersion:function(){return d},gtRange:function(){return h},satisfiesVersionRange:function(){return p}});const n=r(1011),i=r(6686),o=r(9336),s=(0,i.refine)((0,i.string)(),"Version",(e=>null!==(0,n.valid)(e)||`Expected SemVer version, got "${e}"`)),a=(0,i.refine)((0,i.string)(),"Version range",(e=>null!==(0,n.validRange)(e)||`Expected SemVer range, got "${e}"`));function c(e){return(0,i.is)(e,s)}function u(e){return(0,i.is)(e,a)}function l(e){(0,o.assertStruct)(e,s)}function f(e){(0,o.assertStruct)(e,a)}function d(e,t){return(0,n.gt)(e,t)}function h(e,t){return(0,n.gtr)(e,t)}function p(e,t){return(0,n.satisfies)(e,t,{includePrerelease:!0})}},9121:(e,t,r)=>{"use strict";const n=r(2497),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),f=Symbol("lruList"),d=Symbol("cache"),h=Symbol("updateAgeOnGet"),p=()=>1,g=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(y(e,t)){if(b(e,n),!e[a])return}else r&&(e[h]&&(n.value.now=Date.now()),e[f].unshiftNode(n));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},m=e=>{if(e[o]>e[i])for(let t=e[f].tail;e[o]>e[i]&&null!==t;){const r=t.prev;b(e,t),t=r}},b=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[o]-=r.length,e[d].delete(r.key),e[f].removeNode(t)}};class v{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;y(e,i)&&(b(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[s]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,m(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,m(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[s]&&(this[s]=e,this[o]=0,this[f].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),m(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[f].length}rforEach(e,t){t=t||this;for(let r=this[f].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[f].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[f].toArray().map((e=>e.key))}values(){return this[f].toArray().map((e=>e.value))}reset(){this[u]&&this[f]&&this[f].length&&this[f].forEach((e=>this[u](e.key,e.value))),this[d]=new Map,this[f]=new n,this[o]=0}dump(){return this[f].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[f]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[d].has(e)){if(a>this[i])return b(this,this[d].get(e)),!1;const s=this[d].get(e).value;return this[u]&&(this[l]||this[u](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),m(this),!0}const h=new v(e,t,a,n,r);return h.length>this[i]?(this[u]&&this[u](e,t),!1):(this[o]+=h.length,this[f].unshift(h),this[d].set(e,this[f].head),m(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[f].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach(((e,t)=>g(this,t,!1)))}}},6574:(e,t,r)=>{const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new f(e.value,t).test(this.value):""===e.operator?""===e.value||new f(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=i;const o=r(3611),{safeRe:s,t:a}=r(9954),c=r(6619),u=r(9446),l=r(3238),f=r(1329)},1329:(e,t,r)=>{class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!y(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&p)|(this.options.loose&&g))+":"+e,r=i.get(t);if(r)return r;const n=this.options.loose,o=n?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];e=e.replace(o,k(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(u[l.COMPARATORTRIM],f),a("comparator trim",e),e=e.replace(u[l.TILDETRIM],d),a("tilde trim",e),e=e.replace(u[l.CARETTRIM],h),a("caret trim",e);let c=e.split(" ").map((e=>v(e,this.options))).join(" ").split(/\s+/).map((e=>I(e,this.options)));n&&(c=c.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(u[l.COMPARATORLOOSE]))))),a("range list",c);const m=new Map,b=c.map((e=>new s(e,this.options)));for(const e of b){if(y(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const w=[...m.values()];return i.set(t,w),w}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>b(r,t)&&e.set.some((e=>b(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(O(this.set[t],e,this.options))return!0;return!1}}e.exports=n;const i=new(r(9121))({max:1e3}),o=r(3611),s=r(6574),a=r(9446),c=r(3238),{safeRe:u,t:l,comparatorTrimReplace:f,tildeTrimReplace:d,caretTrimReplace:h}=r(9954),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:g}=r(5532),y=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,b=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},v=(e,t)=>(a("comp",e,t),e=_(e,t),a("caret",e),e=A(e,t),a("tildes",e),e=x(e,t),a("xrange",e),e=P(e,t),a("stars",e),e),w=e=>!e||"x"===e.toLowerCase()||"*"===e,A=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{const r=t.loose?u[l.TILDELOOSE]:u[l.TILDE];return e.replace(r,((t,r,n,i,o)=>{let s;return a("tilde",e,t,r,n,i,o),w(r)?s="":w(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:w(i)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,a("tilde return",s),s}))},_=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{a("caret",e,t);const r=t.loose?u[l.CARETLOOSE]:u[l.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,o,s)=>{let c;return a("caret",e,t,r,i,o,s),w(r)?c="":w(i)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:w(o)?c="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:s?(a("replaceCaret pr",s),c="0"===r?"0"===i?`>=${r}.${i}.${o}-${s} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${s} <${+r+1}.0.0-0`):(a("no pr"),c="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),a("caret return",c),c}))},x=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>T(e,t))).join(" ")),T=(e,t)=>{e=e.trim();const r=t.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return e.replace(r,((r,n,i,o,s,c)=>{a("xRange",e,r,n,i,o,s,c);const u=w(i),l=u||w(o),f=l||w(s),d=f;return"="===n&&d&&(n=""),c=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(l&&(o=0),s=0,">"===n?(n=">=",l?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===n&&(n="<",l?i=+i+1:o=+o+1),"<"===n&&(c="-0"),r=`${n+i}.${o}.${s}${c}`):l?r=`>=${i}.0.0${c} <${+i+1}.0.0-0`:f&&(r=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),a("xRange return",r),r}))},P=(e,t)=>(a("replaceStars",e,t),e.trim().replace(u[l.STAR],"")),I=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),k=e=>(t,r,n,i,o,s,a,c,u,l,f,d,h)=>`${r=w(n)?"":w(i)?`>=${n}.0.0${e?"-0":""}`:w(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=w(u)?"":w(l)?`<${+u+1}.0.0-0`:w(f)?`<${u}.${+l+1}.0-0`:d?`<=${u}.${l}.${f}-${d}`:e?`<${u}.${l}.${+f+1}-0`:`<=${c}`}`.trim(),O=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==s.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},3238:(e,t,r)=>{const n=r(9446),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(5532),{safeRe:s,t:a}=r(9954),c=r(3611),{compareIdentifiers:u}=r(9964);class l{constructor(e,t){if(t=c(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return u(r,i)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const r=this.build[t],i=e.build[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return u(r,i)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=l},8315:(e,t,r)=>{const n=r(5716);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},6619:(e,t,r)=>{const n=r(8596),i=r(89),o=r(9288),s=r(3573),a=r(4008),c=r(3782);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return i(e,r,u);case">":return o(e,r,u);case">=":return s(e,r,u);case"<":return a(e,r,u);case"<=":return c(e,r,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},655:(e,t,r)=>{const n=r(3238),i=r(5716),{safeRe:o,t:s}=r(9954);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=o[s.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),o[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[s.COERCERTL].lastIndex=-1}else r=e.match(o[s.COERCE]);return null===r?null:i(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},2053:(e,t,r)=>{const n=r(3238);e.exports=(e,t,r)=>{const i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)}},6793:(e,t,r)=>{const n=r(3239);e.exports=(e,t)=>n(e,t,!0)},3239:(e,t,r)=>{const n=r(3238);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},5913:(e,t,r)=>{const n=r(5716);e.exports=(e,t)=>{const r=n(e,null,!0),i=n(t,null,!0),o=r.compare(i);if(0===o)return null;const s=o>0,a=s?r:i,c=s?i:r,u=!!a.prerelease.length;if(c.prerelease.length&&!u)return c.patch||c.minor?a.patch?"patch":a.minor?"minor":"major":"major";const l=u?"pre":"";return r.major!==i.major?l+"major":r.minor!==i.minor?l+"minor":r.patch!==i.patch?l+"patch":"prerelease"}},8596:(e,t,r)=>{const n=r(3239);e.exports=(e,t,r)=>0===n(e,t,r)},9288:(e,t,r)=>{const n=r(3239);e.exports=(e,t,r)=>n(e,t,r)>0},3573:(e,t,r)=>{const n=r(3239);e.exports=(e,t,r)=>n(e,t,r)>=0},4506:(e,t,r)=>{const n=r(3238);e.exports=(e,t,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,o).version}catch(e){return null}}},4008:(e,t,r)=>{const n=r(3239);e.exports=(e,t,r)=>n(e,t,r)<0},3782:(e,t,r)=>{const n=r(3239);e.exports=(e,t,r)=>n(e,t,r)<=0},2301:(e,t,r)=>{const n=r(3238);e.exports=(e,t)=>new n(e,t).major},3684:(e,t,r)=>{const n=r(3238);e.exports=(e,t)=>new n(e,t).minor},89:(e,t,r)=>{const n=r(3239);e.exports=(e,t,r)=>0!==n(e,t,r)},5716:(e,t,r)=>{const n=r(3238);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},7257:(e,t,r)=>{const n=r(3238);e.exports=(e,t)=>new n(e,t).patch},5734:(e,t,r)=>{const n=r(5716);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},9529:(e,t,r)=>{const n=r(3239);e.exports=(e,t,r)=>n(t,e,r)},8779:(e,t,r)=>{const n=r(2053);e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},6818:(e,t,r)=>{const n=r(1329);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},6680:(e,t,r)=>{const n=r(2053);e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},9749:(e,t,r)=>{const n=r(5716);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},1011:(e,t,r)=>{const n=r(9954),i=r(5532),o=r(3238),s=r(9964),a=r(5716),c=r(9749),u=r(8315),l=r(4506),f=r(5913),d=r(2301),h=r(3684),p=r(7257),g=r(5734),y=r(3239),m=r(9529),b=r(6793),v=r(2053),w=r(6680),A=r(8779),E=r(9288),_=r(4008),S=r(8596),x=r(89),T=r(3573),P=r(3782),I=r(6619),k=r(655),O=r(6574),C=r(1329),N=r(6818),R=r(8662),B=r(2740),M=r(7408),L=r(7248),F=r(8029),j=r(1572),U=r(9211),D=r(4821),Z=r(1591),H=r(2185),$=r(2669);e.exports={parse:a,valid:c,clean:u,inc:l,diff:f,major:d,minor:h,patch:p,prerelease:g,compare:y,rcompare:m,compareLoose:b,compareBuild:v,sort:w,rsort:A,gt:E,lt:_,eq:S,neq:x,gte:T,lte:P,cmp:I,coerce:k,Comparator:O,Range:C,satisfies:N,toComparators:R,maxSatisfying:B,minSatisfying:M,minVersion:L,validRange:F,outside:j,gtr:U,ltr:D,intersects:Z,simplifyRange:H,subset:$,SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},5532:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},9446:(e,t,r)=>{var n=r(4406);const i="object"==typeof n&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=i},9964:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),i=t.test(r);return n&&i&&(e=+e,r=+r),e===r?0:n&&!i?-1:i&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},3611:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},9954:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=r(5532),s=r(9446),a=(t=e.exports={}).re=[],c=t.safeRe=[],u=t.src=[],l=t.t={};let f=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",o],[d,i]],p=(e,t,r)=>{const n=(e=>{for(const[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=f++;s(e,i,t),l[e]=i,u[i]=t,a[i]=new RegExp(t,r?"g":void 0),c[i]=new RegExp(n,r?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${d}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},9211:(e,t,r)=>{const n=r(1572);e.exports=(e,t,r)=>n(e,t,">",r)},1591:(e,t,r)=>{const n=r(1329);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},4821:(e,t,r)=>{const n=r(1572);e.exports=(e,t,r)=>n(e,t,"<",r)},2740:(e,t,r)=>{const n=r(3238),i=r(1329);e.exports=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&-1!==s.compare(e)||(o=e,s=new n(o,r)))})),o}},7408:(e,t,r)=>{const n=r(3238),i=r(1329);e.exports=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&1!==s.compare(e)||(o=e,s=new n(o,r)))})),o}},7248:(e,t,r)=>{const n=r(3238),i=r(1329),o=r(9288);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const i=e.set[t];let s=null;i.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":s&&!o(t,s)||(s=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!s||r&&!o(r,s)||(r=s)}return r&&e.test(r)?r:null}},1572:(e,t,r)=>{const n=r(3238),i=r(6574),{ANY:o}=i,s=r(1329),a=r(6818),c=r(9288),u=r(4008),l=r(3782),f=r(3573);e.exports=(e,t,r,d)=>{let h,p,g,y,m;switch(e=new n(e,d),t=new s(t,d),r){case">":h=c,p=l,g=u,y=">",m=">=";break;case"<":h=u,p=f,g=c,y="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,d))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let s=null,a=null;if(n.forEach((e=>{e.semver===o&&(e=new i(">=0.0.0")),s=s||e,a=a||e,h(e.semver,s.semver,d)?s=e:g(e.semver,a.semver,d)&&(a=e)})),s.operator===y||s.operator===m)return!1;if((!a.operator||a.operator===y)&&p(e,a.semver))return!1;if(a.operator===m&&g(e,a.semver))return!1}return!0}},2185:(e,t,r)=>{const n=r(6818),i=r(3239);e.exports=(e,t,r)=>{const o=[];let s=null,a=null;const c=e.sort(((e,t)=>i(e,t,r)));for(const e of c)n(e,t,r)?(a=e,s||(s=e)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);const u=[];for(const[e,t]of o)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),f="string"==typeof t.raw?t.raw:String(t);return l.length<f.length?l:t}},2669:(e,t,r)=>{const n=r(1329),i=r(6574),{ANY:o}=i,s=r(6818),a=r(3239),c=[new i(">=0.0.0-0")],u=[new i(">=0.0.0")],l=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=r.includePrerelease?c:u}if(1===t.length&&t[0].semver===o){if(r.includePrerelease)return!0;t=u}const n=new Set;let i,l,h,p,g,y,m;for(const t of e)">"===t.operator||">="===t.operator?i=f(i,t,r):"<"===t.operator||"<="===t.operator?l=d(l,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&l){if(h=a(i.semver,l.semver,r),h>0)return null;if(0===h&&(">="!==i.operator||"<="!==l.operator))return null}for(const e of n){if(i&&!s(e,String(i),r))return null;if(l&&!s(e,String(l),r))return null;for(const n of t)if(!s(e,String(n),r))return!1;return!0}let b=!(!l||r.includePrerelease||!l.semver.prerelease.length)&&l.semver,v=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;b&&1===b.prerelease.length&&"<"===l.operator&&0===b.prerelease[0]&&(b=!1);for(const e of t){if(m=m||">"===e.operator||">="===e.operator,y=y||"<"===e.operator||"<="===e.operator,i)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if(p=f(i,e,r),p===e&&p!==i)return!1}else if(">="===i.operator&&!s(i.semver,String(e),r))return!1;if(l)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),"<"===e.operator||"<="===e.operator){if(g=d(l,e,r),g===e&&g!==l)return!1}else if("<="===l.operator&&!s(l.semver,String(e),r))return!1;if(!e.operator&&(l||i)&&0!==h)return!1}return!(i&&y&&!l&&0!==h||l&&m&&!i&&0!==h||v||b)},f=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},d=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(const n of e.set){for(const e of t.set){const t=l(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},8662:(e,t,r)=>{const n=r(1329);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},8029:(e,t,r)=>{const n=r(1329);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},5567:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},2497:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var s=[];for(n=0;o&&n<t;n++)s.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),n=0;n<r.length;n++)o=i(this,o,r[n]);return s},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(5567)(n)}catch(e){}},3525:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=i,t.hash=o,t.exists=s,t.output=a;const c={number:r,bool:n,bytes:i,hash:o,exists:s,output:a};t.default=c},1655:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:s,l:a}=i(e[o],t);[r[o],n[o]]=[s,a]}return[r,n]}t.fromBig=i,t.split=o;const s=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=s;const a=(e,t,r)=>e>>>r;t.shrSH=a;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;const l=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=l;const f=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=f;const d=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=d;const h=(e,t)=>t;t.rotr32H=h;const p=(e,t)=>e;t.rotr32L=p;const g=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=g;const y=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=y;const m=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=m;const b=(e,t,r)=>e<<r-32|t>>>64-r;function v(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.rotlBL=b,t.add=v;const w=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=w;const A=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=A;const E=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=E;const _=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;t.add4H=_;const S=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);t.add5L=S;const x=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;t.add5H=x;const T={fromBig:i,split:o,toBig:s,shrSH:a,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:f,rotrBL:d,rotr32H:h,rotr32L:p,rotlSH:g,rotlSL:y,rotlBH:m,rotlBL:b,add:v,add3L:w,add3H:A,add4L:E,add4H:_,add5H:x,add5L:S};t.default=T},825:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},125:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;const n=r(3525),i=r(1655),o=r(64),[s,a,c]=[[],[],[]],u=BigInt(0),l=BigInt(1),f=BigInt(2),d=BigInt(7),h=BigInt(256),p=BigInt(113);for(let e=0,t=l,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],s.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let i=u;for(let e=0;e<7;e++)t=(t<<l^(t>>d)*p)%h,t&f&&(i^=l<<(l<<BigInt(e))-l);c.push(i)}const[g,y]=(0,i.split)(c,!0),m=(e,t,r)=>r>32?(0,i.rotlBH)(e,t,r):(0,i.rotlSH)(e,t,r),b=(e,t,r)=>r>32?(0,i.rotlBL)(e,t,r):(0,i.rotlSL)(e,t,r);function v(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=m(o,s,1)^r[n],c=b(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=a[r],o=m(t,i,n),c=b(t,i,n),u=s[r];t=e[u],i=e[u+1],e[u]=o,e[u+1]=c}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=g[n],e[1]^=y[n]}r.fill(0)}t.keccakP=v;class w extends o.Hash{constructor(e,t,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.number)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,o.u32)(this.state)}keccak(){v(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,n.exists)(this);const{blockLen:t,state:r}=this,i=(e=(0,o.toBytes)(e)).length;for(let n=0;n<i;){const o=Math.min(t-this.pos,i-n);for(let t=0;t<o;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,0!=(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,n.exists)(this,!1),(0,n.bytes)(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,n.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,n.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new w(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}t.Keccak=w;const A=(e,t,r)=>(0,o.wrapConstructor)((()=>new w(t,e,r)));t.sha3_224=A(6,144,28),t.sha3_256=A(6,136,32),t.sha3_384=A(6,104,48),t.sha3_512=A(6,72,64),t.keccak_224=A(1,144,28),t.keccak_256=A(1,136,32),t.keccak_384=A(1,104,48),t.keccak_512=A(1,72,64);const E=(e,t,r)=>(0,o.wrapXOFConstructorWithOpts)(((n={})=>new w(t,e,void 0===n.dkLen?r:n.dkLen,!0)));t.shake128=E(31,168,16),t.shake256=E(31,136,32)},64:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(825),i=e=>e instanceof Uint8Array;if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function s(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function a(e){if("string"==typeof e&&(e=s(e)),!i(e))throw new Error("expected Uint8Array, got "+typeof e);return e}t.bytesToHex=function(e){if(!i(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[t]=o}return r},t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=s,t.toBytes=a,t.concatBytes=function(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!i(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t},t.Hash=class{clone(){return this._cloneInto()}};const c={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==c.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(a(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},3460:(e,t,r)=>{"use strict";r.r(t),r.d(t,{clearAPIKey:()=>w,clearEmbedHost:()=>m,enableSentryTracing:()=>g,gatewayAuthHeader:()=>l,gatewayEmbedHostHeader:()=>f,generateJsonRPCObject:()=>N,get:()=>P,getAPIKey:()=>A,getEmbedHost:()=>b,patch:()=>k,post:()=>I,promiseRace:()=>R,promiseTimeout:()=>T,put:()=>O,remove:()=>C,setAPIKey:()=>v,setEmbedHost:()=>y,setLogLevel:()=>E});var n=r(3028),i=r(1344),o=r.n(i),s=r(9640);const a=r.n(s)().getLogger("http-helpers");a.setLevel(s.levels.INFO);let c="torus-default",u="";const l="x-api-key",f="x-embed-host";let d=null;const h=[],p=[];function g(e,t,r){d=e,h.push(...t),p.push(...r)}function y(e){u=e}function m(){u=""}function b(){return u}function v(e){c=e}function w(){c="torus-default"}function A(){return c}function E(e){a.setLevel(e)}async function _(e,t){let r=null;try{r=new URL(e)}catch(e){}if(d&&r&&(h.includes(r.origin)||p.includes(r.pathname))){const r=d.startTransaction({name:e}),n=r.startChild({op:"http"}),i=await fetch(e,t);return n.finish(),r.finish(),i}return fetch(e,t)}function S(){const e={};return c&&(e[l]=c),u&&(e[f]=u),e}function x(e){a.info(`Response: ${e.status} ${e.statusText}`),a.info(`Url: ${e.url}`)}const T=(e,t)=>{const r=new Promise(((t,r)=>{const n=setTimeout((()=>{clearTimeout(n),r(new Error(`Timed out in ${e}ms`))}),e)}));return Promise.race([t,r])},P=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={mode:"cors",headers:{}};(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).useAPIKey&&(r.headers=(0,n.Z)((0,n.Z)({},r.headers),S()));const i=o()(r,t,{method:"GET"}),s=await _(e,i);if(s.ok){const e=s.headers.get("content-type");return null!=e&&e.includes("application/json")?s.json():s.text()}throw x(s),s},I=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};i.useAPIKey&&(s.headers=(0,n.Z)((0,n.Z)({},s.headers),S()));const c=o()(s,r,{method:"POST"});return i.isUrlEncodedData?(c.body=t,"application/json; charset=utf-8"===c.headers["Content-Type"]&&delete c.headers["Content-Type"]):c.body=JSON.stringify(t),T(i.timeout||6e4,_(e,c).then((e=>{if(i.logTracingHeader&&function(e){a.info(`Request tracing with traceID=${e.headers.get("x-web3-correlation-id")}`)}(e),e.ok){const t=e.headers.get("content-type");return null!=t&&t.includes("application/json")?e.json():e.text()}throw x(e),e})))},k=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};i.useAPIKey&&(s.headers=(0,n.Z)((0,n.Z)({},s.headers),S()));const a=o()(s,r,{method:"PATCH"});i.isUrlEncodedData?(a.body=t,"application/json; charset=utf-8"===a.headers["Content-Type"]&&delete a.headers["Content-Type"]):a.body=JSON.stringify(t);const c=await _(e,a);if(c.ok){const e=c.headers.get("content-type");return null!=e&&e.includes("application/json")?c.json():c.text()}throw x(c),c},O=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};i.useAPIKey&&(s.headers=(0,n.Z)((0,n.Z)({},s.headers),S()));const a=o()(s,r,{method:"PUT"});i.isUrlEncodedData?(a.body=t,"application/json; charset=utf-8"===a.headers["Content-Type"]&&delete a.headers["Content-Type"]):a.body=JSON.stringify(t);const c=await _(e,a);if(c.ok){const e=c.headers.get("content-type");return null!=e&&e.includes("application/json")?c.json():c.text()}throw x(c),c},C=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const s={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};i.useAPIKey&&(s.headers=(0,n.Z)((0,n.Z)({},s.headers),S()));const a=o()(s,r,{method:"DELETE"});i.isUrlEncodedData?(a.body=t,"application/json; charset=utf-8"===a.headers["Content-Type"]&&delete a.headers["Content-Type"]):a.body=JSON.stringify(t);const c=await _(e,a);if(c.ok){const e=c.headers.get("content-type");return null!=e&&e.includes("application/json")?c.json():c.text()}throw x(c),c},N=(e,t)=>({jsonrpc:"2.0",method:e,id:10,params:t}),R=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6e4;return Promise.race([P(e,t),new Promise(((e,t)=>{setTimeout((()=>{t(new Error("timed out"))}),r)}))])}},7391:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BasePostMessageStream:()=>b,IGNORE_SUBSTREAM:()=>L,JRPCEngine:()=>k,ObjectMultiplex:()=>F,PostMessageStream:()=>U,SafeEventEmitter:()=>w,SerializableError:()=>A,Substream:()=>M,createAsyncMiddleware:()=>I,createEngineStream:()=>C,createErrorMiddleware:()=>_,createIdRemapMiddleware:()=>T,createLoggerMiddleware:()=>P,createScaffoldMiddleware:()=>x,createStreamMiddleware:()=>S,getRpcPromiseCallback:()=>E,mergeMiddleware:()=>O,providerAsMiddleware:()=>B,providerFromEngine:()=>N,providerFromMiddleware:()=>R,setupMultiplex:()=>j});var n=r(2601),i=r(1887),o=r(2699),s=r(7847),a=r.n(s),c=r(3028),u=r(774),l=r(8797),f=r.n(l),d=r(9928),h=r.n(d),p=r(3171),g=r.n(p);function y(){}const m="ACK";class b extends i.Duplex{constructor(e){let{name:t,target:r,targetWindow:i=window,targetOrigin:o="*"}=e;if(super({objectMode:!0}),(0,n.Z)(this,"_init",void 0),(0,n.Z)(this,"_haveSyn",void 0),(0,n.Z)(this,"_name",void 0),(0,n.Z)(this,"_target",void 0),(0,n.Z)(this,"_targetWindow",void 0),(0,n.Z)(this,"_targetOrigin",void 0),(0,n.Z)(this,"_onMessage",void 0),(0,n.Z)(this,"_synIntervalId",void 0),!t||!r)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=t,this._target=r,this._targetWindow=i,this._targetOrigin=o,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write("BRK",null,y),this._haveSyn=!1,this._init=!1}_handShake(){this._write("SYN",null,y),this.cork()}_onData(e){if(this._init)if("BRK"===e)this._break();else try{this.push(e)}catch(e){this.emit("error",e)}else"SYN"===e?(this._haveSyn=!0,this._write(m,null,y)):e===m&&(this._init=!0,this._haveSyn||this._write(m,null,y),this.uncork())}_postMessage(e){const t=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:e},t)}onMessage(e){const t=e.data;"*"!==this._targetOrigin&&e.origin!==this._targetOrigin||e.source!==this._targetWindow||"object"!=typeof t||t.target!==this._name||!t.data||this._onData(t.data)}_read(){}_write(e,t,r){this._postMessage(e),r()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}function v(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class w extends o.EventEmitter{emit(e){let t="error"===e;const r=this._events;if(void 0!==r)t=t&&void 0===r.error;else if(!t)return!1;for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];if(t){let e;if(i.length>0&&([e]=i),e instanceof Error)throw e;const t=new Error("Unhandled error."+(e?` (${e.message})`:""));throw t.context=e,t}const s=r[e];if(void 0===s)return!1;if("function"==typeof s)v(s,this,i);else{const e=s.length,t=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(s);for(let r=0;r<e;r+=1)v(t[r],this,i)}return!0}}class A extends Error{constructor(e){let{code:t,message:r,data:i}=e;if(!Number.isInteger(t))throw new Error("code must be an integer");if(!r||"string"!=typeof r)throw new Error("message must be string");super(r),(0,n.Z)(this,"code",void 0),(0,n.Z)(this,"data",void 0),this.code=t,void 0!==i&&(this.data=i)}toString(){return a()({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const E=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(n,i)=>{n||i.error?t(n||i.error):!r||Array.isArray(i)?e(i):e(i.result)}};function _(e){return(t,r,n,i)=>{try{if("string"!=typeof t.method||!t.method)return r.error=new A({code:-32603,message:"invalid method"}),void i();n((t=>{const{error:n}=r;return n?(e.error(`OpenLogin - RPC Error: ${n.message}`,n),t()):t()}))}catch(t){e.error(`OpenLogin - RPC Error thrown: ${t.message}`,t),r.error=new A({code:-32603,message:t.message}),i()}}}function S(){const e={},t=new w,r=new i.Duplex({objectMode:!0,read:function(){return!1},write:function(r,n,i){let o;try{r.id?function(t){const r=e[t.id];if(!r)throw new Error(`StreamMiddleware - Unknown response id "${t.id}"`);delete e[t.id],Object.assign(r.res,t),setTimeout(r.end)}(r):function(e){t.emit("notification",e)}(r)}catch(e){o=e}i(o)}});return{events:t,middleware:(t,n,i,o)=>{r.push(t),e[t.id]={req:t,res:n,next:i,end:o}},stream:r}}function x(e){return(t,r,n,i)=>{const o=e[t.method];return void 0===o?n():"function"==typeof o?o(t,r,n,i):(r.result=o,i())}}function T(){return(e,t,r,n)=>{const i=e.id,o=Math.random().toString(36).slice(2);e.id=o,t.id=o,r((r=>{e.id=i,t.id=i,r()}))}}function P(e){return(t,r,n,i)=>{e.debug("REQ",t,"RES",r),n()}}function I(e){return async(t,r,n,i)=>{let o;const s=new Promise((e=>{o=e}));let a=null,c=!1;const u=async()=>{c=!0,n((e=>{a=e,o()})),await s};try{await e(t,r,u),c?(await s,a(null)):i(null)}catch(e){const t=e;a?a(t):i(t)}}}class k extends w{constructor(){super(),(0,n.Z)(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(e,t,r){const n=[];let i=null,o=!1;for(const s of r)if([i,o]=await k._runMiddleware(e,t,s,n),o)break;return[i,o,n.reverse()]}static _runMiddleware(e,t,r,n){return new Promise((i=>{const o=e=>{const r=e||t.error;r&&(t.error=(0,u.serializeError)(r)),i([r,!0])},s=e=>{t.error?o(t.error):(e&&("function"!=typeof e&&o(new A({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),n.push(e)),i([null,!1]))};try{r(e,t,s,o)}catch(e){o(e)}}))}static async _runReturnHandlers(e){for(const t of e)await new Promise(((e,r)=>{t((t=>t?r(t):e()))}))}static _checkForCompletion(e,t,r){if(!("result"in t)&&!("error"in t))throw new A({code:-32603,message:"Response has no error or result for request"});if(!r)throw new A({code:-32603,message:"Nothing ended request"})}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,r,n)=>{try{const[i,o,s]=await k._runAllMiddleware(e,t,this._middleware);return o?(await k._runReturnHandlers(s),n(i)):r((async e=>{try{await k._runReturnHandlers(s)}catch(t){return e(t)}return e()}))}catch(e){return n(e)}}}async _handleBatch(e,t){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,r):r}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise((t=>{this._handle(e,((e,r)=>{t(r)}))}))}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){const e=new A({code:-32603,message:"request must be plain object"});return t(e,{id:void 0,jsonrpc:"2.0",error:e})}if("string"!=typeof e.method){const r=new A({code:-32603,message:"method must be string"});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}const r=(0,c.Z)({},e),n={id:r.id,jsonrpc:r.jsonrpc};let i=null;try{await this._processRequest(r,n)}catch(e){i=e}return i&&(delete n.result,n.error||(n.error=(0,u.serializeError)(i))),t(i,n)}async _processRequest(e,t){const[r,n,i]=await k._runAllMiddleware(e,t,this._middleware);if(k._checkForCompletion(e,t,n),await k._runReturnHandlers(i),r)throw r}}function O(e){const t=new k;return e.forEach((e=>t.push(e))),t.asMiddleware()}function C(e){if(!e||!e.engine)throw new Error("Missing engine parameter!");const{engine:t}=e;let r;return r=new i.Duplex({objectMode:!0,read:function(){},write:function(e,n,i){t.handle(e,((e,t)=>{r.push(t)})),i()}}),t.on&&t.on("notification",(e=>{r.push(e)})),r}function N(e){const t=new w;return t.sendAsync=async t=>{const r=await e.handle(t);if(r.error){var n,i;const e=(0,u.serializeError)(r.error,{fallbackError:{message:(null===(n=r.error)||void 0===n?void 0:n.message)||r.error.toString(),code:(null===(i=r.error)||void 0===i?void 0:i.code)||-32603}});throw u.rpcErrors.internal(e)}return r.result},t.send=(t,r)=>{if("function"!=typeof r)throw new Error('Must provide callback to "send" method.');e.handle(t,r)},e.on&&e.on("notification",(e=>{t.emit("data",null,e)})),t.request=async e=>{const r=(0,c.Z)((0,c.Z)({},e),{},{id:Math.random().toString(36).slice(2),jsonrpc:"2.0"});return await t.sendAsync(r)},t}function R(e){const t=new k;return t.push(e),N(t)}function B(e){return async(t,r,n,i)=>{try{const n=await e.sendAsync(t);return r.result=n,i()}catch(e){return i(e)}}}class M extends i.Duplex{constructor(e){let{parent:t,name:r}=e;super({objectMode:!0}),(0,n.Z)(this,"_parent",void 0),(0,n.Z)(this,"_name",void 0),this._parent=t,this._name=r}_read(){}_write(e,t,r){this._parent.push({name:this._name,data:e}),r()}}const L=Symbol("IGNORE_SUBSTREAM");class F extends i.Duplex{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super((0,c.Z)((0,c.Z)({},e),{},{objectMode:!0})),(0,n.Z)(this,"_substreams",void 0),(0,n.Z)(this,"getStream",void 0),this._substreams={}}createStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);const t=new M({parent:this,name:e});return this._substreams[e]=t,function(e,r){const n=h()((e=>t.destroy(e||void 0)));f()(e,{readable:!1},n),f()(e,{writable:!1},n)}(this),t}ignoreStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);this._substreams[e]=L}_read(){}_write(e,t,r){const{name:n,data:i}=e;if(!n)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),r();const o=this._substreams[n];return o?(o!==L&&o.push(i),r()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${n}"`),r())}}function j(e){const t=new F;return t.getStream=function(e){return this._substreams[e]?this._substreams[e]:this.createStream(e)},g()(e,t,e,(e=>{e&&window.console.error(e)})),t}class U extends b{_postMessage(e){let t=this._targetOrigin;if("object"==typeof e){const r=e;if("object"==typeof r.data){const e=r.data;if(Array.isArray(e.params)&&e.params.length>0){const r=e.params[0];r._origin&&(t=r._origin),r._origin=window.location.origin}}}this._targetWindow.postMessage({target:this._target,data:e},t)}}},7948:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},2937:(e,t,r)=>{var n=r(8834).Buffer;(()=>{var t={758:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});var n=r(56),i=r.n(n),o=r(195),s=r.n(o),a=r(33);class c extends a.SafeEventEmitter{constructor(e){let{config:t={},state:r={}}=e;super(),s()(this,"defaultConfig",{}),s()(this,"defaultState",{}),s()(this,"disabled",!1),s()(this,"name","BaseController"),s()(this,"initialConfig",void 0),s()(this,"initialState",void 0),s()(this,"internalConfig",this.defaultConfig),s()(this,"internalState",this.defaultState),this.initialState=r,this.initialConfig=t}get config(){return this.internalConfig}get state(){return this.internalState}configure(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(arguments.length>2&&void 0!==arguments[2]&&!arguments[2])for(const t in e)void 0!==this.internalConfig[t]&&(this.internalConfig[t]=e[t],this[t]=e[t]);else{this.internalConfig=t?e:Object.assign(this.internalConfig,e);for(const e in this.internalConfig)void 0!==this.internalConfig[e]&&(this[e]=this.internalConfig[e])}}update(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.internalState=t?i()({},e):i()(i()({},this.internalState),e),this.emit("store",this.internalState)}initialize(){return this.internalState=this.defaultState,this.internalConfig=this.defaultConfig,this.configure(this.initialConfig),this.update(this.initialState),this}}const u=c},839:(e,t,r)=>{"use strict";r.d(t,{I:()=>c});var n=r(195),i=r.n(n),o=r(758);const s=(e,t)=>e+t,a=["sync","latest"];class c extends o.Z{constructor(e){let{config:t={},state:r={}}=e;super({config:t,state:r}),i()(this,"name","BaseBlockTracker"),i()(this,"_blockResetTimeout",void 0),this.defaultState={_currentBlock:{idempotencyKey:""},_isRunning:!1},this.defaultConfig={blockResetDuration:2e4},this.initialize(),this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this.state._isRunning}getCurrentBlock(){return this.state._currentBlock}async getLatestBlock(){return this.state._currentBlock.idempotencyKey?this.state._currentBlock:await new Promise((e=>{this.once("latest",(t=>{t&&e(t)}))}))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_start(){}_end(){}_newPotentialLatest(e){const t=this.state._currentBlock;t&&e.idempotencyKey===t.idempotencyKey||this._setCurrentBlock(e)}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener)}_onNewListener(){this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this.state._isRunning||(this.state._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){this.state._isRunning&&(this.state._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return a.map((e=>this.listenerCount(e))).reduce(s)}_setCurrentBlock(e){const t=this.state._currentBlock;this.update({_currentBlock:e}),this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this.config.blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this.update({_currentBlock:{idempotencyKey:""}})}}},79:(e,t,r)=>{"use strict";r.d(t,{W:()=>i});var n=r(758);class i extends n.Z{constructor(e){let{config:t={},state:r}=e;super({config:t,state:r}),this.defaultState={currentCurrency:"usd",conversionRate:0,conversionDate:"N/A",nativeCurrency:"ETH"},this.defaultConfig={pollInterval:6e5},this.initialize()}getNativeCurrency(){return this.state.nativeCurrency}setNativeCurrency(e){this.update({nativeCurrency:e,ticker:e})}getCurrentCurrency(){return this.state.currentCurrency}setCurrentCurrency(e){this.update({currentCurrency:e})}getConversionRate(){return this.state.conversionRate}setConversionRate(e){this.update({conversionRate:e})}getConversionDate(){return this.state.conversionDate}setConversionDate(e){this.update({conversionDate:e})}}},784:(e,t,r)=>{"use strict";r.d(t,{k:()=>u});var n=r(195),i=r.n(n),o=r(33),s=r(758),a=r(868),c=r(469);class u extends s.Z{constructor(e){let{config:t={},state:r}=e;super({config:t,state:r}),i()(this,"_communicationProviderProxy",void 0),this.defaultState={buttonPosition:"bottom-right",isIFrameFullScreen:!0,apiKey:"torus-default",oauthModalVisibility:!1,loginInProgress:!1,dappMetadata:{name:"",icon:""}},this.initialize()}initializeProvider(e){const t=new o.JRPCEngine,r=(0,c.u_)(e);t.push(r);const n=(0,o.providerFromEngine)(t);this.setCommunicationProvider(n)}setCommunicationProvider(e){this._communicationProviderProxy?this._communicationProviderProxy.setTarget(e):this._communicationProviderProxy=(0,a.Z)(e)}}},469:(e,t,r)=>{"use strict";r.d(t,{JL:()=>o,QM:()=>a,u_:()=>c,yP:()=>s});var n=r(33),i=r(1);function o(e){let{changeProvider:t}=e;return(0,n.createAsyncMiddleware)((async(e,r,n)=>{const{method:o}=e;if(o!==i.vU.SET_PROVIDER)return n();if(!t)throw new Error("CommunicationMiddleware - opts.changeProvider not provided");r.result=await t(e)}))}function s(e){let{topup:t}=e;return(0,n.createAsyncMiddleware)((async(e,r,n)=>{const{method:o}=e;if(o!==i.vU.TOPUP)return n();if(!t)throw new Error("CommunicationMiddleware - opts.topup not provided");r.result=await t(e)}))}function a(e,t){return(0,n.createAsyncMiddleware)((async(r,n,i)=>{const{method:o}=r;if(o!==e)return i();if(!t)throw new Error(`CommunicationMiddleware - ${e} not provided`);const s=await t(r);if(!s)return i();n.result=s}))}function c(e){const{getUserInfo:t,getWalletInstanceId:r,topup:c,logout:u,changeProvider:l,setIFrameStatus:f,handleWindowRpc:d,getProviderState:h,loginWithPrivateKey:p,showWalletConnect:g,showCheckout:y,showWalletUi:m}=e;return(0,n.mergeMiddleware)([o({changeProvider:l}),s({topup:c}),(0,n.createScaffoldMiddleware)({[i.vU.LOGOUT]:u,[i.vU.WALLET_INSTANCE_ID]:r,[i.vU.USER_INFO]:t,[i.vU.IFRAME_STATUS]:f,[i.vU.OPENED_WINDOW]:d,[i.vU.CLOSED_WINDOW]:d,[i.vU.GET_PROVIDER_STATE]:h,[i.vU.SHOW_WALLET_CONNECT]:g,[i.vU.SHOW_CHECKOUT]:y,[i.vU.SHOW_WALLET_UI]:m}),a(i.vU.LOGIN_WITH_PRIVATE_KEY,p)])}},745:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(195),i=r.n(n),o=r(33),s=r(1);class a extends o.SafeEventEmitter{constructor(){super(...arguments),i()(this,"handleWindowRpc",((e,t,r,n)=>{const{method:i,params:o}=e;if(i===s.vU.OPENED_WINDOW){const{windowId:e}=o;this.emit(`${e}:opened`),t.result=!0,n()}else if(i===s.vU.CLOSED_WINDOW){const{windowId:e}=o;this.emit(`${e}:closed`),t.result=!0,n()}else r()}))}}const c=a},818:()=>{},608:(e,t,r)=>{"use strict";r.d(t,{W:()=>o});var n=r(758),i=r(883);class o extends n.Z{constructor(e){var t;let{config:r={},state:n}=e;super({config:r,state:n}),this.defaultState={wallets:null!==(t=n.wallets)&&void 0!==t?t:[]},this.initialize()}async signAuthMessage(e,t){const r=this.state.wallets.find((t=>t.address===e));if(!r)throw new Error("key does not exist");const n=(0,i.rj)(t).toString("hex");return await(0,i.l)(r.privateKey,n)}}},735:(e,t,r)=>{"use strict";r.d(t,{H:()=>n});const n=()=>Math.random().toString(36).substring(2)},928:(e,t,n)=>{"use strict";n.d(t,{D:()=>l,v:()=>f});const i=r(774);var o=n(33);const s=["Gateway timeout","ETIMEDOUT","failed to parse response body","Failed to fetch"];function a(e){switch(e.status){case 405:throw i.rpcErrors.methodNotFound();case 418:throw i.rpcErrors.internal({message:"Request is being rate limited."});case 503:case 504:throw i.rpcErrors.internal({message:"Gateway timeout. The request took too long to process.This can happen when querying over too wide a block range."})}}function c(e){return new Promise((t=>{setTimeout(t,e)}))}function u(e,t){if(200!==e.status)throw i.rpcErrors.internal({message:`Non-200 status code: '${e.status}'`,data:t});if(t.error)throw i.rpcErrors.internal({data:t.error});return t.result}function l(e){let{req:t,rpcTarget:r,originHttpHeaderKey:n}=e;const i=new URL(r),o={id:t.id,jsonrpc:t.jsonrpc,method:t.method,params:t.params},s=t.origin,a={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o)};return n&&s&&(a.headers[n]=s),{fetchUrl:i.href,fetchParams:a}}function f(e){let{rpcTarget:t,originHttpHeaderKey:r}=e;return(0,o.createAsyncMiddleware)((async(e,n,i)=>{const{fetchUrl:o,fetchParams:f}=l({req:e,rpcTarget:t,originHttpHeaderKey:r});for(let e=0;e<5;e++){try{const e=await fetch(o,f);a(e);const t=await e.json(),r=u(e,t);return void(n.result=r)}catch(e){const t=e.toString();if(!s.some((e=>t.includes(e))))throw e}await c(1e3)}}))}},994:(e,t,r)=>{"use strict";r.d(t,{y:()=>o});var n=r(485),i=r.n(n);function o(e){return function(t,r,n){n((n=>{r.error&&i().warn("Error in RPC response:\n",r),t.isTorusInternal||(i().info(`RPC (${e.origin}):`,t,"->",r),n())}))}}},152:(e,t,r)=>{"use strict";function n(e){return function(t,r,n){t.origin=e.origin,n()}}r.d(t,{x:()=>n})},964:(e,t,n)=>{"use strict";n.d(t,{K4:()=>u,XQ:()=>y,lQ:()=>m,LC:()=>b,ZZ:()=>w,Ej:()=>p});var i=n(195),o=n.n(i);const s=r(7501);var a=n(1),c=n(883);class u{constructor(e){o()(this,"bc",void 0),o()(this,"channel",void 0);const t=new URLSearchParams(window.location.search).get("instanceId");this.channel=`${e}_${t}`,this.bc=new s.BroadcastChannel(this.channel,c.aN)}getMessageFromChannel(){return new Promise(((e,t)=>{this.bc.addEventListener("message",(async r=>{this.bc.close(),r.error?t(r.error):e(r.data)})),this.bc.postMessage({data:{type:a.AA}})}))}}var l=n(758),f=n(485),d=n.n(f);class h extends l.Z{constructor(e){let{config:t,state:r={}}=e;super({config:t,state:r}),o()(this,"closed",!1),this.initialize()}async open(){return new Promise(((e,t)=>{const{communicationEngine:r,communicationWindowManager:n}=this.config;let i=!1;if(n.once(`${this.state.windowId}:closed`,(()=>{this.closed=!0})),this.state.windowId){const r=new s.BroadcastChannel(this.state.windowId,c.aN);r.addEventListener("message",(async n=>{try{d().info(n,`receiving data on channel: ${r.name}`);const{error:o}=n;if(o)return void t(new Error(o));const{message:s}=n.data;s===a.AA&&(i=!0,await r.postMessage({data:{url:this.state.url.href,message:""}}),e(this),r.close())}catch(e){t(e),r.close(),this.close()}}));const n=async()=>await r.postMessage({data:{message:a.bJ}});let o="server"===r.type?1e3:200;const u=async()=>{if(!i&&!this.closed){const e=await n();"server"===r.type&&e.status>=400&&(o=Math.round(1.5*o)),await(0,c._v)(o),await u()}};u()}else this.update({windowId:(0,c.kb)()}),n.once(`${this.state.windowId}:opened`,(()=>{e(this)})),r.emit("notification",{method:a.Nb.CREATE_WINDOW,params:{windowId:this.state.windowId,url:this.state.url.href}})}))}close(){const{communicationEngine:e}=this.config;e.emit("notification",{method:a.Nb.CLOSE_WINDOW,params:{windowId:this.state.windowId}})}}const p=h;class g extends l.Z{constructor(e){let{config:t,state:r}=e;super({config:t,state:r}),this.defaultConfig={dappStorageKey:"",features:(0,c.SL)(a.Of),target:"_blank",communicationEngine:null,communicationWindowManager:null,timeout:3e4},this.defaultState={windowTimer:null,window:null,iClosedWindow:!1,windowId:"",url:r.url},this.initialize(),this._setupTimer()}async open(){const{target:e,features:t,dappStorageKey:r,communicationEngine:n,communicationWindowManager:i}=this.config,{windowId:o,url:s}=this.state;if(r){const e=new URLSearchParams(s.hash.slice(1));e.append("dappStorageKey",r),s.hash=e.toString(),this.update({url:s})}if(!o){let r=window.open(s.href,e,t);return r||(r=new p({config:{communicationEngine:n,communicationWindowManager:i},state:{url:s}}),r.open()),void this.update({window:r})}const a=new p({config:{communicationEngine:n,communicationWindowManager:i},state:{url:s,windowId:o}});this.update({window:a}),await a.open()}close(){this.update({iClosedWindow:!0});const{window:e}=this.state;e&&e.close()}_setupTimer(){const e=window.setInterval((()=>{const{window:e,windowTimer:t,iClosedWindow:r}=this.state;e&&e.closed&&(t&&clearInterval(t),setTimeout((()=>{r||this.emit("close"),this.update({iClosedWindow:!1,window:null})}),this.config.timeout)),null===e&&t&&clearInterval(t)}),500);this.update({windowTimer:e})}}const y=g;class m{constructor(e){let{instanceId:t,handleLogout:r,handleAccountImport:n,handleNetworkChange:i,handleSelectedAddressChange:s,handleThemeChange:a}=e;o()(this,"handleLogout",void 0),o()(this,"handleAccountImport",void 0),o()(this,"handleNetworkChange",void 0),o()(this,"handleThemeChange",void 0),o()(this,"handleSelectedAddressChange",void 0),o()(this,"instanceId",void 0),this.instanceId=t,this.handleLogout=r,this.handleAccountImport=n,this.handleNetworkChange=i,this.handleSelectedAddressChange=s,this.handleThemeChange=a}setupStoreChannels(){this.logoutChannel(),this.importAccountChannel(),this.networkChangeChannel(),this.selectedAddressChangeChannel(),this.themeChangedChannel()}logoutChannel(){new s.BroadcastChannel(`${a.kl.WALLET_LOGOUT_CHANNEL}_${this.instanceId}`,c.aN).addEventListener("message",(e=>{var t;d().info("received logout message",e),e.error||(null===(t=e.data)||void 0===t?void 0:t.type)!==a.$x.LOGOUT||(d().info("Logging Out"),this.handleLogout())}))}importAccountChannel(){new s.BroadcastChannel(`${a.kl.WALLET_ACCOUNT_IMPORT_CHANNEL}_${this.instanceId}`,c.aN).addEventListener("message",(e=>{var t,r;e.error||(null===(t=e.data)||void 0===t?void 0:t.type)!==a.$x.ACCOUNT_IMPORTED||this.handleAccountImport(null===(r=e.data)||void 0===r?void 0:r.privKey)}))}networkChangeChannel(){new s.BroadcastChannel(`${a.kl.WALLET_NETWORK_CHANGE_CHANNEL}_${this.instanceId}`,c.aN).addEventListener("message",(e=>{var t,r;e.error||(null===(t=e.data)||void 0===t?void 0:t.type)!==a.$x.NETWORK_CHANGE||this.handleNetworkChange(null===(r=e.data)||void 0===r?void 0:r.network)}))}themeChangedChannel(){new s.BroadcastChannel(`${a.kl.THEME_CHANGE}_${this.instanceId}`,c.aN).addEventListener("message",(e=>{var t,r;d().info({ev:e}),e.error||(null===(t=e.data)||void 0===t?void 0:t.type)!==a.$x.SET_THEME||this.handleThemeChange(null===(r=e.data)||void 0===r?void 0:r.theme)}))}selectedAddressChangeChannel(){new s.BroadcastChannel(`${a.kl.WALLET_SELECTED_ADDRESS_CHANNEL}_${this.instanceId}`,c.aN).addEventListener("message",(e=>{var t,r;e.error||(null===(t=e.data)||void 0===t?void 0:t.type)!==a.$x.SELECTED_ADDRESS_CHANGE||this.handleSelectedAddressChange(null===(r=e.data)||void 0===r?void 0:r.selectedAddress)}))}}const b=class extends y{constructor(e){let{config:t,state:r,instanceId:n}=e;super({config:t,state:r}),o()(this,"bc",void 0),this.bc=new s.BroadcastChannel(n,c.aN)}handle(e){return new Promise(((t,r)=>{const n=()=>{this.bc.close(),r(new c.gK("user closed popup")),this.removeListener("close",n)};this.on("close",n),this.bc.addEventListener("message",(async n=>{d().info(n,`receiving data on channel: ${this.bc.name}`);try{const{error:i,data:o}=n;if(i)return void r(new Error(i));e&&await e.call(this,o),t(o)}catch(e){r(e)}finally{this.bc.close(),this.close()}})),this.open().then((()=>{d().info(`opened window ${this.bc.name}`)})).catch((e=>{d().error(e,"something went wrong while opening window"),r(e)}))}))}handleWithHandshake(e,t){return new Promise(((r,n)=>{const i=()=>{this.bc.close(),n(new c.gK("user closed popup")),this.removeListener("close",i)};this.on("close",i),this.bc.addEventListener("message",(async i=>{try{d().info(i,`receiving data on channel: ${this.bc.name}`);const{error:o,data:s}=i;if(o)return void n(new Error(o));const{type:c=""}=s;c===a.AA?await this.bc.postMessage({data:e}):c===a.EV&&(t&&await t.call(this,s),r(s),this.bc.close(),this.close())}catch(e){n(e),this.bc.close(),this.close()}})),this.open().then((()=>{d().info(`opened window ${this.bc.name}`)})).catch((e=>{d().error(e,"something went wrong while opening window"),n(e)}))}))}};var v=n(464);class w{constructor(){o()(this,"error",void 0),o()(this,"finalQueryParams",{}),o()(this,"instanceParameters",void 0),o()(this,"hashParameters",void 0);const{hash:e}=window.location;new URLSearchParams(window.location.search).forEach(((e,t)=>{this.finalQueryParams[t]=e}));const{error:t,instanceParameters:r,hashParameters:n}=(0,v.Kv)(e,this.finalQueryParams);this.error=t,this.instanceParameters=r,this.hashParameters=n}async handle(){return new Promise(((e,t)=>{const{finalQueryParams:r,instanceParameters:n,hashParameters:i,error:o}=this;let c;try{r.windowId?(c=new s.BroadcastChannel(`${r.windowId}`,v.aN),c.addEventListener("message",(async t=>{const{url:n,message:i}=t.data;n?(e(),window.location.href=n):i===a.bJ&&await c.postMessage({data:{windowId:r.windowId,message:a.AA}}),t.error&&""!==t.error&&(d().error(t.error),e(),c.close())}))):(c=new s.BroadcastChannel(`${a.kl.REDIRECT_CHANNEL}_${n.instanceId}`,v.aN),c.addEventListener("message",(async o=>{o.error?(t(o.error),window.close()):(e(),c.close(),d().info("posted",{finalQueryParams:r,hashParameters:i,instanceParameters:n}))})),c.postMessage({data:{instanceParams:n,hashParams:i,queryParams:r},error:o}),setTimeout((()=>{e(),window.location.href=window.location.origin+window.location.search+window.location.hash}),5e3))}catch(e){d().info(e,"something went wrong"),t(e),c&&c.close(),window.close()}}))}}},174:(e,t,n)=>{"use strict";n.d(t,{f:()=>b,a:()=>m});var i=n(56),o=n.n(i),s=n(195),a=n.n(s);const c=r(3460),u=r(7160);var l=n.n(u),f=n(793),d=n(485),h=n.n(d),p=n(758),g=n(850),y=n(883);const m={selectedCurrency:"USD",theme:"dark",locale:"en-US",accountType:n(646).O.NORMAL,contacts:[],jwtToken:"",fetchedPastTx:[],pastTransactions:[],paymentTx:[],defaultPublicAddress:"",customTokens:[],customNfts:[],crashReport:!0,userInfo:{aggregateVerifier:"",email:"",name:"",profileImage:"",typeOfLogin:g.h.GOOGLE,verifier:"",verifierId:""}};class b extends p.Z{constructor(e){let{config:t,state:r,defaultPreferences:n,signAuthMessage:i}=e;if(super({config:t,state:r}),a()(this,"name","PreferencesController"),a()(this,"iframeOrigin",void 0),a()(this,"signAuthMessage",void 0),a()(this,"defaultPreferences",void 0),!t.api)throw new Error("PreferencesController - no api specified in config.");this.defaultState={identities:{},selectedAddress:"",lastErrorMessage:"",lastSuccessMessage:""},this.defaultConfig={api:t.api,pollInterval:18e4},this.initialize(),this.defaultPreferences=o()(o()({},m),n),this.signAuthMessage=i}setIframeOrigin(e){this.iframeOrigin=e}getAddressState(e){const t=e||this.state.selectedAddress;return this.state.identities[t]}setSelectedAddress(e){this.update({selectedAddress:e})}async getUser(e){return(await(0,c.get)(`${this.config.api}/user?fetchTx=false`,this.headers(e),{useAPIKey:!0})).data}async createUser(e){const{selectedCurrency:t,theme:r,verifier:n,verifierId:i,locale:o,address:s,idToken:a}=e,u={default_currency:t,theme:r,verifier:n,verifier_id:i,locale:o,idToken:a};await(0,c.post)(`${this.config.api}/user`,u,this.headers(s),{useAPIKey:!0}),this.updateState({theme:r,defaultPublicAddress:s,selectedCurrency:t,locale:o},s)}async storeUserLogin(e){const{verifierId:t,verifier:r,options:n,address:i,idToken:o}=e;if(!n.rehydrate){const e=l().getParser(window.navigator.userAgent),n=(0,y.Z2)(),s={os:e.getOSName(),os_version:e.getOSVersion()||"unidentified",browser:(null==n?void 0:n.browser)||e.getBrowserName()||"unidentified",browser_version:e.getBrowserVersion()||"unidentified",platform:e.getPlatform().type||"desktop",hostname:this.iframeOrigin,verifier:r,verifier_id:t,idToken:o};await(0,c.post)(`${this.config.api}/user/recordLogin`,s,this.headers(i),{useAPIKey:!0})}}async setCrashReport(e){var t;if(e===(null===(t=this.getAddressState())||void 0===t?void 0:t.crashReport))return!0;try{return await(0,c.patch)(`${this.config.api}/user`,{enable_crash_reporter:e},this.headers(),{useAPIKey:!0}),this.updateState({crashReport:e}),!0}catch(e){return h().error(e),!1}}async setUserTheme(e){var t;if(e===(null===(t=this.getAddressState())||void 0===t?void 0:t.theme))return!0;try{return await(0,c.patch)(`${this.config.api}/user`,{theme:e},this.headers(),{useAPIKey:!0}),this.updateState({theme:e}),!0}catch(e){return h().error(e),!1}}async setUserLocale(e){var t;if(e!==(null===(t=this.getAddressState())||void 0===t?void 0:t.locale))try{return await(0,c.patch)(`${this.config.api}/user`,{locale:e},this.headers(),{useAPIKey:!0}),this.updateState({locale:e}),!0}catch(e){return h().error("unable to set locale",e),!1}}async setSelectedCurrency(e){var t;if(e.selectedCurrency===(null===(t=this.getAddressState())||void 0===t?void 0:t.selectedCurrency))return!0;try{return await(0,c.patch)(`${this.config.api}/user`,{default_currency:e.selectedCurrency},this.headers(),{useAPIKey:!0}),this.updateState({selectedCurrency:e.selectedCurrency}),!0}catch(e){return h().error(e),!1}}async addContact(e){try{var t;const r=await(0,c.post)(`${this.config.api}/contact`,e,this.headers(),{useAPIKey:!0});return this.updateState({contacts:[...(null===(t=this.getAddressState())||void 0===t?void 0:t.contacts)||[],r.data]}),!0}catch(e){return h().error("unable to add contact",e),!1}}async deleteContact(e){try{var t;const r=await(0,c.remove)(`${this.config.api}/contact/${e}`,{},this.headers(),{useAPIKey:!0}),n=null===(t=this.getAddressState())||void 0===t?void 0:t.contacts.filter((e=>e.id!==r.data.id));return n&&this.updateState({contacts:[...n]}),!0}catch(e){return h().error("unable to delete contact",e),!1}}async revokeDiscord(e){try{const t=await(0,c.post)(`${this.config.api}/revoke/discord`,{token:e},this.headers(),{useAPIKey:!0});h().info(t)}catch(e){h().error(e)}}async patchPastTx(e,t){try{const r=await(0,c.patch)(`${this.config.api}/transaction`,e,this.headers(t),{useAPIKey:!0});h().info("successfully patched",r)}catch(e){h().error("unable to patch tx",e)}}async postPastTx(e,t){try{const r=await(0,c.post)(`${this.config.api}/transaction`,e,this.headers(t),{useAPIKey:!0});return h().info("successfully posted tx",r),r}catch(e){h().error(e,"unable to insert transaction")}}async getWalletOrders(e){try{const t=await(0,c.get)(`${this.config.api}/transaction`,this.headers(e),{useAPIKey:!0});return t.success&&t.data?t.data:[]}catch(e){return h().error("unable to get wallet orders tx",e),[]}}async getTopUpOrders(e){try{return(await(0,c.get)(`${this.config.commonApiHost}/transaction`,this.headers(e),{useAPIKey:!0})).data||[]}catch(e){h().error("unable to fetch past Top up orders",e)}}async getBillBoardData(){try{const e=await(0,c.get)(`${this.config.api}/billboard`,this.headers(),{useAPIKey:!0});return e.success?e.data:[]}catch(e){return h().error("unable to get billboard data",e),[]}}async getMessageForSigning(e){return(await(0,c.post)(`${this.config.api}/auth/message`,{public_address:e},{},{useAPIKey:!0})).message}async getTwitterId(e){const t=await(0,c.get)(`${this.config.api}/twitter?screen_name=${e.nick}`,this.headers(),{useAPIKey:!0});return`${e.typeOfLogin.toLowerCase()}|${t.data.toString()}`}async sendEmail(e){return(0,c.post)(`${this.config.api}/transaction/sendemail`,e.emailObject,this.headers(),{useAPIKey:!0})}async refreshJwt(){const e=this.state.selectedAddress,t=await this.getMessageForSigning(e);if(!t.startsWith(this.config.signInPrefix))throw new Error("Cannot sign on invalid message");const r=await this.signAuthMessage(e,t),n=await(0,c.post)(`${this.config.api}/auth/verify`,{public_address:e,signed_message:r},{},{useAPIKey:!0});this.updateState({jwtToken:n.token},e)}async getDappList(){try{const e=await(0,c.get)(`${this.config.api}/dapps`,this.headers(),{useAPIKey:!0});return e.success?e.data:[]}catch(e){return h().error("unable to get billboard data",e),[]}}async fetchEtherscanTx(e){try{const t=new URL(`${this.config.api}/etherscan`);Object.keys(e).forEach((r=>t.searchParams.append(r,e[r])));const r=await(0,c.get)(t.href,this.headers(e.selectedAddress));return r.success?r.data:[]}catch(e){return h().error("unable to fetch etherscan tx",e),[]}}async getCovalentTokenBalances(e,t){try{const r=`https://api.covalenthq.com/v1/${t}/address/${e}/balances_v2/`,n=await(0,c.get)(`${this.config.api}/covalent?url=${encodeURIComponent(r)}`,this.headers(e),{useAPIKey:!0});return n.success?n.data:{}}catch(e){return h().error("unable to get covalent token balances",e),{}}}async getEthereumAssetData(e){var t,r,n,i,o;const{contract:s,tokenId:a}=e;if(!s||!a)throw new Error("Invalid params received while fetching asset data");const u=`https://api.opensea.io/api/v1/asset/${s}/${a}`,l=new URL(`${this.config.api}/opensea`);l.searchParams.append("url",u);const f=await(0,c.get)(l.href,this.headers());return{symbol:null!==(t=null===(r=f.data)||void 0===r||null===(r=r.asset_contract)||void 0===r?void 0:r.symbol)&&void 0!==t?t:"",logo:null===(n=f.data)||void 0===n?void 0:n.image_url,name:null===(i=f.data)||void 0===i?void 0:i.name,description:null===(o=f.data)||void 0===o?void 0:o.name}}async getCovalentAssetData(e){var t;const{contract:r,tokenId:n,chainId:i}=e;if(!r||!n||!i)throw new Error("Invalid params received while fetching asset data");const o=`https://api.covalenthq.com/v1/${i}/tokens/${r}/nft_metadata/${n}/`,s=new URL(`${this.config.api}/covalent`);s.searchParams.append("url",o);const a=(null===(t=(await(0,c.get)(s.href,this.headers())).data)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.items)||[];if(a.length>0){const{nft_data:e,contract_ticker_symbol:t}=a[0];if(e.length>0&&e[0].external_data){const{name:r,image:n,description:i}=e[0].external_data;return{name:r,logo:n,symbol:t||r,description:i}}}}async getEthereumAssetContractData(e){var t,r,n,i,o,s;const{contract:a}=e;if(!a)throw new Error("Invalid params received while fetching asset data");const u=`https://api.opensea.io/api/v1/asset_contract/${a}`,l=new URL(`${this.config.api}/opensea`);l.searchParams.append("url",u);const f=await(0,c.get)(l.href,this.headers());return{symbol:null===(t=f.data)||void 0===t?void 0:t.symbol,logo:null===(r=f.data)||void 0===r?void 0:r.image_url,name:null===(n=f.data)||void 0===n?void 0:n.name,description:null===(i=f.data)||void 0===i?void 0:i.name,schema_name:null!==(o=f.data)&&void 0!==o&&o.schema_name?null===(s=f.data)||void 0===s?void 0:s.schema_name.toLowerCase():""}}async getCovalentAssetContractData(e){var t;const{chainId:r,contract:n}=e;if(!n||!r)throw new Error("Invalid params received while fetching asset data");const i=`https://api.covalenthq.com/v1/${r}/tokens/${n}/nft_metadata/1/`,o=new URL(`${this.config.api}/covalent`);o.searchParams.append("url",i);const s=(null===(t=(await(0,c.get)(o.href,this.headers())).data)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.items)||[];if(s.length>0){const{contract_ticker_symbol:e,contract_name:t,logo_url:r,supports_erc:n}=s[0];let i="erc721";return n.includes("erc1155")&&(i="erc1155"),{name:t,logo:r,symbol:e||t,description:"",schema_name:i}}}async init(e,t,r,n,i){let o={token:r};if(!this.getAddressState(e)){if(!r){const t=await this.getMessageForSigning(e);if(!t.startsWith(this.config.signInPrefix))throw new Error("Cannot sign on invalid message");const r=await this.signAuthMessage(e,t);o=await(0,c.post)(`${this.config.api}/auth/verify`,{public_key:n,public_address:e,signed_message:r},{},{useAPIKey:!0})}this.updateState({jwtToken:o.token,userInfo:t,accountType:null!=i?i:this.defaultPreferences.accountType},e)}}updateState(e,t){const r=t||this.state.selectedAddress,n=this.getAddressState(r)||(0,f.cloneDeep)(this.defaultPreferences),i=o()(o()({},n),e);return this.update({identities:o()(o()({},this.state.identities),{},{[r]:i})}),i}headers(e){var t;const r=e||this.state.selectedAddress;return(0,y.wU)((null===(t=this.getAddressState(r))||void 0===t?void 0:t.jwtToken)||"")}}},646:(e,t,r)=>{"use strict";r.d(t,{F:()=>n,O:()=>i});const n={ACTIVITY_ACTION_ALL:"walletActivity.allTransactions",ACTIVITY_ACTION_SEND:"walletActivity.send",ACTIVITY_ACTION_RECEIVE:"walletActivity.receive",ACTIVITY_ACTION_TOPUP:"walletActivity.topup"},i={NORMAL:"normal",THRESHOLD:"threshold",IMPORTED:"imported"}},908:(e,t,r)=>{"use strict";r.d(t,{i:()=>f});var n=r(56),i=r.n(n),o=r(195),s=r.n(o),a=r(793),c=r(758),u=r(883),l=r(664);class f extends c.Z{constructor(e){let{config:t,state:r,getCurrentChainId:n}=e;super({config:t,state:r}),s()(this,"getCurrentChainId",void 0),this.defaultConfig={txHistoryLimit:40},this.defaultState={transactions:{},unapprovedTxs:{},currentNetworkTxsList:[]},this.initialize(),this.getCurrentChainId=n}getUnapprovedTxList(){const e=this.getCurrentChainId();return(0,a.pickBy)(this.state.transactions,(t=>t.status===l.LN.unapproved&&(0,u.lw)(t,e)))}getTransaction(e){const{transactions:t}=this.state;return t[e]}updateTransaction(e){const t=e.id;e.updated_at=(new Date).toISOString(),this.update({transactions:i()(i()({},this.state.transactions),{},{[t]:e})})}setTxStatusRejected(e){this._setTransactionStatus(e,l.LN.rejected),this._deleteTransaction(e)}setTxStatusUnapproved(e){this._setTransactionStatus(e,l.LN.unapproved)}setTxStatusApproved(e){this._setTransactionStatus(e,l.LN.approved)}setTxStatusSigned(e,t){this._setTransactionStatus(e,l.LN.signed,t)}setTxStatusSubmitted(e){this._setTransactionStatus(e,l.LN.submitted)}setTxStatusDropped(e){this._setTransactionStatus(e,l.LN.dropped)}setTxStatusExpired(e){this._setTransactionStatus(e,l.LN.expired)}setTxStatusConfirmed(e){this._setTransactionStatus(e,l.LN.confirmed)}setTxStatusFailed(e,t){const r=t||new Error("Internal torus failure"),n=this.getTransaction(e);n.error=r,this.updateTransaction(n),this._setTransactionStatus(e,l.LN.failed)}isFinalState(e){return e===l.LN.rejected||e===l.LN.submitted||e===l.LN.confirmed||e===l.LN.failed||e===l.LN.cancelled||e===l.LN.expired}clearUnapprovedTxs(){this.update({transactions:(0,a.omitBy)(this.state.transactions,(e=>e.status===l.LN.unapproved))})}_addTransactionsToState(e){this.update({transactions:e.reduce(((e,t)=>(e[t.id]=t,e)),this.state.transactions)})}_setTransactionsToState(e){this.update({transactions:e.reduce(((e,t)=>(e[t.id]=t,e)),{})})}_deleteTransaction(e){const{transactions:t}=this.state;delete t[e],this.update({transactions:t})}_deleteTransactions(e){const{transactions:t}=this.state;e.forEach((e=>{delete t[e]})),this.update({transactions:t})}_setTransactionStatus(e,t,r){const n=this.getTransaction(e);n&&(n.status=t,this.updateTransaction(n),this.emit(l.RM.TX_STATUS_UPDATE,{txId:e,status:t}),this.isFinalState(t)||r?this.emit(`${n.id}:finished`,n):this.emit(`${n.id}:${t}`,e))}}},664:(e,t,r)=>{"use strict";r.d(t,{L0:()=>i,LN:()=>n,RM:()=>o});let n=function(e){return e.approved="approved",e.cancelled="cancelled",e.cancelling="cancelling",e.confirmed="confirmed",e.failed="failed",e.finalized="finalized",e.processed="processed",e.rejected="rejected",e.signed="signed",e.submitted="submitted",e.unapproved="unapproved",e.dropped="dropped",e.expired="expired",e.pending="pending",e}({});const i={CANCEL:"cancel",RETRY:"retry",CONTRACT_INTERACTION:"contractInteraction",DEPLOY_CONTRACT:"contractDeployment",WASM_BASED_DEPLOY:"wasmBasedDeploy",STANDARD_TRANSACTION:"transaction",STANDARD_PAYMENT_TRANSACTION:"payment_transaction",SENT_ETHER:"sentEther",TOKEN_METHOD_TRANSFER:"transfer",TOKEN_METHOD_TRANSFER_FROM:"transferFrom",TOKEN_METHOD_APPROVE:"approve",COLLECTIBLE_METHOD_SAFE_TRANSFER_FROM:"safeTransferFrom",SET_APPROVAL_FOR_ALL:"setApprovalForAll"},o={TX_WARNING:"tx:warning",TX_ERROR:"tx:error",TX_FAILED:"tx:failed",TX_CONFIRMED:"tx:confirmed",TX_DROPPED:"tx:dropped",TX_EXPIRED:"tx:expired",TX_STATUS_UPDATE:"tx:status_update",TX_UNAPPROVED:"tx:unapproved",TX_RETRY:"tx:retry",TX_BLOCK_UPDATE:"tx:block_update"}},259:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});const n=()=>!0,i=["newListener","removeListener"],o=e=>!i.includes(e);function s(e,t){let r=(t||{}).eventFilter||n;if("string"==typeof r&&"skipInternal"===r&&(r=o),"function"!=typeof r)throw new Error("createEventEmitterProxy - Invalid eventFilter");let i=e,s=e=>{const t=i;i=e,t.eventNames().filter(r).forEach((r=>{(function(e,t){return void 0!==e.rawListeners?e.rawListeners(t):e.listeners(t)})(t,r).forEach((t=>e.on(r,t)))})),t.removeAllListeners()};return new Proxy({},{get:(e,t)=>"setTarget"===t?s:i[t],set:(e,t,r)=>"setTarget"===t?(s=r,!0):(i[t]=r,!0)})}},868:(e,t,r)=>{"use strict";function n(e){let t=e,r=e=>{t=e};return new Proxy({},{get:(e,n)=>"setTarget"===n?r:t[n],set:(e,n,i)=>"setTarget"===n?(r=i,!0):(t[n]=i,!0)})}r.d(t,{Z:()=>n})},1:(e,t,r)=>{"use strict";r.d(t,{$x:()=>B,AA:()=>a,CU:()=>s,E$:()=>m,EV:()=>c,F1:()=>l,GA:()=>C,GI:()=>i,HU:()=>d,Jn:()=>n,K4:()=>f,Mh:()=>A,NO:()=>_,Nb:()=>k,Of:()=>o,P:()=>I,U:()=>E,Y7:()=>g,Ye:()=>y,bJ:()=>u,eN:()=>x,kl:()=>R,lj:()=>v,p:()=>P,p3:()=>p,qU:()=>h,rq:()=>T,sE:()=>w,v:()=>S,vU:()=>O,wA:()=>b,zK:()=>N});const n={height:660,width:375},i={height:740,width:1315},o={height:700,width:1200},s={height:700,width:450},a="popup_loaded",c="popup_result",u="setup_complete",l="walletActivity.allTransactions",f="walletActivity.send",d="walletActivity.burn",h="walletActivity.receive",p="walletActivity.topup",g="walletActivity.createTrustline",y="walletActivity.removeTrustline",m="walletActivity.createNftOffer",b="walletActivity.acceptNftOffer",v="walletActivity.cancelNftOffer",w="walletActivity.all",A="walletActivity.lastOneWeek",E="walletActivity.lastOneMonth",_="walletActivity.lastSixMonts",S="walletActivity.successful",x="walletActivity.unsuccessful",T="walletActivity.pending",P="walletActivity.cancelled",I="walletActivity.cancelling",k={IFRAME_STATUS:"iframe_status",CREATE_WINDOW:"create_window",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},O={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",OPENED_WINDOW:"opened_window",CLOSED_WINDOW:"closed_window",GET_PROVIDER_STATE:"get_provider_state",LOGIN_WITH_PRIVATE_KEY:"login_with_private_key",SHOW_WALLET_CONNECT:"show_wallet_connect",SHOW_CHECKOUT:"show_checkout",SHOW_WALLET_UI:"show_wallet_ui"},C={GET_PROVIDER_STATE:"wallet_get_provider_state"},N={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"},R={REDIRECT_CHANNEL:"redirect_channel",PROVIDER_CHANGE_CHANNEL:"torus_provider_change_channel",TRANSACTION_CHANNEL:"torus_channel",MESSAGE_CHANNEL:"torus_message_channel",WALLET_LOGOUT_CHANNEL:"wallet_logout_channel",WALLET_SELECTED_ADDRESS_CHANNEL:"wallet_selected_address_channel",WALLET_NETWORK_CHANGE_CHANNEL:"wallet_network_change_channel",WALLET_ACCOUNT_IMPORT_CHANNEL:"wallet_account_import_channel",THEME_CHANGE:"theme_change_channel",TOP_UP_CHANNEL:"top_up_channel"},B={LOGOUT:"logout",ACCOUNT_IMPORTED:"account_imported",SELECTED_ADDRESS_CHANGE:"selected_address_change",NETWORK_CHANGE:"network_change",SET_THEME:"set_theme"}},850:(e,t,r)=>{"use strict";r.d(t,{U:()=>i,h:()=>n});const n={GOOGLE:"google",FACEBOOK:"facebook",REDDIT:"reddit",DISCORD:"discord",TWITCH:"twitch",APPLE:"apple",LINE:"line",GITHUB:"github",KAKAO:"kakao",LINKEDIN:"linkedin",TWITTER:"twitter",WEIBO:"weibo",WECHAT:"wechat",EMAIL_PASSWORDLESS:"email_passwordless"},i={MOONPAY:"moonpay",WYRE:"wyre",RAMPNETWORK:"rampnetwork",XANPOOL:"xanpool",MERCURYO:"mercuryo",TRANSAK:"transak"}},883:(e,t,r)=>{"use strict";r.d(t,{gK:()=>o.gK,H9:()=>o.H9,aN:()=>o.aN,dk:()=>o.dk,p6:()=>o.p6,d5:()=>o.d5,mr:()=>o.mr,Z2:()=>o.Z2,wU:()=>o.wU,SL:()=>o.SL,OG:()=>i,Kv:()=>o.Kv,rj:()=>o.rj,I4:()=>o.I4,rX:()=>o.rX,kb:()=>o.kb,l:()=>o.l,I6:()=>o.I6,_v:()=>o._v,Vs:()=>o.Vs,lw:()=>o.lw});var n=r(1);const i=e=>{switch(e){case"rejected":case"unapproved":case"failed":return n.eN;case"confirmed":return n.v;case"submitted":return n.rq;case"cancelled":return n.p;default:return""}};var o=r(464)},464:(e,t,i)=>{"use strict";i.d(t,{gK:()=>S,H9:()=>p,aN:()=>E,dk:()=>l,p6:()=>y,d5:()=>h,mr:()=>m,Z2:()=>_,wU:()=>d,SL:()=>A,Kv:()=>x,rj:()=>v,I4:()=>a,rX:()=>u,kb:()=>c,l:()=>w,I6:()=>g,_v:()=>T,Vs:()=>f,lw:()=>b});const o=r(2938),s=r(6391);function a(e){return`0x${e.toString(16)}`}const c=()=>Math.random().toString(36).slice(2);function u(e,t){if(""!==e&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(t<0)throw new Error(`Expected a non-negative integer target length. Received: ${t}`);return String.prototype.padStart.call(e,t,"0")}function l(e,t,r){const i=(0,o.fromSigned)(t),s=(0,o.fromSigned)(r),a=(0,o.bytesToBigInt)(e),c=u(n.from((0,o.toUnsigned)(i)).toString("hex"),64),l=u(n.from((0,o.toUnsigned)(s)).toString("hex"),64),f=(0,o.stripHexPrefix)((0,o.bigIntToHex)(a));return(0,o.addHexPrefix)(c.concat(l,f))}function f(e){return new Promise((t=>{const r=window.setTimeout((()=>{t(),window.clearTimeout(r)}),e)}))}const d=e=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json; charset=utf-8"}}),h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=s.BigNumber.isBigNumber(e)?e.toNumber():e;if(!Number.isFinite(n))return"";const i="usd"===t.toLowerCase()?parseFloat(Number(n).toFixed(2)):parseFloat(Number(n).toFixed(5)),o=i>0?"~ ":"";return`${"usd"===t.toLowerCase()||r?"":o}${Number(i)} ${t.toUpperCase()}`},p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return e?e.length<11?e:"string"!=typeof e?"":`${e.slice(0,t)}...${e.slice(-t)}`:""},g=function(e){let t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,i=s.BigNumber.isBigNumber(e)?e:new s.BigNumber(e);if(i.isZero())return i;r&&(i=i.times(new s.BigNumber(100))),t=i.gte(new s.BigNumber(1))?n:n-1+Math.ceil(Math.log10(new s.BigNumber("1").div(i).toNumber()));const o=new s.BigNumber(10).pow(new s.BigNumber(t));return Math.round(o.times(i).toNumber())/o.toNumber()},y=e=>{const t=new Date(e);return`${t.getDate()} ${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()]} ${t.getFullYear()}`},m=e=>new Date(e).toTimeString().slice(0,8),b=(e,t)=>void 0!==e.chainId&&e.chainId===t,v=e=>{const t=n.from(e,"utf8"),r=(0,o.hashPersonalMessage)(t);return n.from(r)},w=async(e,t)=>{const r=n.from(e,"hex"),i=(0,o.stripHexPrefix)(t),s=(0,o.ecsign)(n.from(i,"hex"),r);return l(n.from((0,o.bigIntToBytes)(s.v)),n.from(s.r),n.from(s.s))};function A(e){let{width:t,height:r}=e;const n=void 0!==window.screenLeft?window.screenLeft:window.screenX,i=void 0!==window.screenTop?window.screenTop:window.screenY,o=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,s=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,a=Math.abs((o-t)/2/1+n);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=${r/1},width=${t/1},top=${Math.abs((s-r)/2/1+i)},left=${a}`}const E={type:"server",webWorkerSupport:!1};function _(){var e;if(null!==(e=navigator)&&void 0!==e&&e.brave)return{browser:"Brave"}}class S extends Error{}const x=(e,t)=>{const r={};new URL(`${window.location.origin}/?${e.slice(1)}`).searchParams.forEach(((e,t)=>{r[t]=e}));let n={},i="";return t.windowId||(Object.keys(r).length>0&&r.state?(n=JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(r.state))))||{},i=r.error_description||r.error||i):Object.keys(t).length>0&&t.state&&(n=JSON.parse(window.atob(decodeURIComponent(decodeURIComponent(t.state))))||{},t.error&&(i=t.error))),{error:i,instanceParameters:n,hashParameters:r}};function T(e){return new Promise((t=>{setTimeout(t,e)}))}},195:e=>{"use strict";e.exports=r(6290)},56:e=>{"use strict";e.exports=r(814)},33:e=>{"use strict";e.exports=r(7391)},793:e=>{"use strict";e.exports=r(5003)},485:e=>{"use strict";e.exports=r(9640)}},i={};function o(e){var r=i[e];if(void 0!==r)return r.exports;var n=i[e]={exports:{}};return t[e](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};(()=>{"use strict";o.r(s),o.d(s,{ACCOUNT_CATEGORY:()=>A.O,ACTIVITY_ACTION:()=>A.F,ACTIVITY_ACTION_ACCEPT_NFT_OFFER:()=>d.wA,ACTIVITY_ACTION_ALL:()=>d.F1,ACTIVITY_ACTION_BURN:()=>d.HU,ACTIVITY_ACTION_CANCEL_NFT_OFFER:()=>d.lj,ACTIVITY_ACTION_CREATE_NFT_OFFER:()=>d.E$,ACTIVITY_ACTION_CREATE_TRUSTLINE:()=>d.Y7,ACTIVITY_ACTION_RECEIVE:()=>d.qU,ACTIVITY_ACTION_REMOVE_TRUSTLINE:()=>d.Ye,ACTIVITY_ACTION_SEND:()=>d.K4,ACTIVITY_ACTION_TOPUP:()=>d.p3,ACTIVITY_PERIOD_ALL:()=>d.sE,ACTIVITY_PERIOD_MONTH_ONE:()=>d.U,ACTIVITY_PERIOD_MONTH_SIX:()=>d.NO,ACTIVITY_PERIOD_WEEK_ONE:()=>d.Mh,ACTIVITY_STATUS_CANCELLED:()=>d.p,ACTIVITY_STATUS_CANCELLING:()=>d.P,ACTIVITY_STATUS_PENDING:()=>d.rq,ACTIVITY_STATUS_SUCCESSFUL:()=>d.v,ACTIVITY_STATUS_UNSUCCESSFUL:()=>d.eN,BROADCAST_CHANNELS:()=>d.kl,BROADCAST_CHANNELS_MSGS:()=>d.$x,BaseBlockTracker:()=>t.I,BaseController:()=>e.Z,BaseCurrencyController:()=>i.W,BaseEmbedController:()=>a.k,BaseKeyringController:()=>p.W,BasePreferencesController:()=>w.f,BaseTransactionStateManager:()=>E.i,BroadcastChannelHandler:()=>v.K4,COMMUNICATION_JRPC_METHODS:()=>d.vU,COMMUNICATION_NOTIFICATIONS:()=>d.Nb,CommunicationWindowManager:()=>u.Z,DEFAULT_PREFERENCES:()=>w.a,FEATURES_CONFIRM_WINDOW:()=>d.CU,FEATURES_DEFAULT_POPUP_WINDOW:()=>d.Of,FEATURES_DEFAULT_WALLET_WINDOW:()=>d.GI,FEATURES_PROVIDER_CHANGE_WINDOW:()=>d.Jn,LOGIN_PROVIDER:()=>h.h,PAYMENT_PROVIDER:()=>h.U,POPUP_LOADED:()=>d.AA,POPUP_RESULT:()=>d.EV,PROVIDER_JRPC_METHODS:()=>d.GA,PROVIDER_NOTIFICATIONS:()=>d.zK,PopupHandler:()=>v.XQ,PopupStoreChannel:()=>v.lQ,PopupWithBcHandler:()=>v.LC,RedirectHandler:()=>v.ZZ,SETUP_COMPLETE:()=>d.bJ,StreamWindow:()=>v.Ej,TRANSACTION_TYPES:()=>_.L0,TX_EVENTS:()=>_.RM,TransactionStatus:()=>_.LN,UserError:()=>S.gK,addressSlicer:()=>S.H9,broadcastChannelOptions:()=>S.aN,concatSig:()=>S.dk,createChangeProviderMiddlewareMiddleware:()=>c.JL,createCommunicationMiddleware:()=>c.u_,createEventEmitterProxy:()=>r.Z,createFetchConfigFromReq:()=>g.D,createFetchMiddleware:()=>g.v,createGenericJRPCMiddleware:()=>c.QM,createLoggerMiddleware:()=>y.y,createOriginMiddleware:()=>m.x,createRandomId:()=>b.H,createSwappableProxy:()=>n.Z,createTopupMiddleware:()=>c.yP,formatDate:()=>S.p6,formatSmallNumbers:()=>S.d5,formatTime:()=>S.mr,getCustomDeviceInfo:()=>S.Z2,getHeaders:()=>S.wU,getPopupFeatures:()=>S.SL,getTxStatusText:()=>S.OG,handleRedirectParameters:()=>S.Kv,hashMessage:()=>S.rj,intToHex:()=>S.I4,padWithZeroes:()=>S.rX,randomId:()=>S.kb,signMessage:()=>S.l,significantDigits:()=>S.I6,sleep:()=>S._v,timeout:()=>S.Vs,transactionMatchesNetwork:()=>S.lw});var e=o(758),t=o(839),r=o(259),n=o(868),i=o(79),a=o(784),c=o(469),u=o(745),l=o(818),f={};for(const e in l)["default","BaseController","createEventEmitterProxy","createSwappableProxy","CommunicationWindowManager","BaseBlockTracker","BaseCurrencyController","BaseEmbedController","createChangeProviderMiddlewareMiddleware","createCommunicationMiddleware","createGenericJRPCMiddleware","createTopupMiddleware"].indexOf(e)<0&&(f[e]=()=>l[e]);o.d(s,f);var d=o(1),h=o(850),p=o(608),g=o(928),y=o(994),m=o(152),b=o(735),v=o(964),w=o(174),A=o(646),E=o(908),_=o(664),S=o(883)})(),e.exports=s})()},5766:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],c=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),l=0,f=c>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));return 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]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},6391:function(e,t,r){var n;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",l=u+"Number primitive has more than 15 significant digits: ",f=1e14,d=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,y=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function b(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=d-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function v(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,c=e.e,u=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function w(e,t,r,n){if(e<t||e>r||e!==c(e))throw Error(u+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function A(e){var t=e.c.length-1;return m(e.e/d)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function _(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}o=function e(t){var r,n,i,o,S,x,T,P,I,k,O=G.prototype={constructor:G,toString:null,valueOf:null},C=new G(1),N=20,R=4,B=-7,M=21,L=-1e7,F=1e7,j=!1,U=1,D=0,Z={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function G(e,t){var r,o,a,u,f,p,g,y,m=this;if(!(m instanceof G))return new G(e,t);if(null==t){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>F?m.c=m.e=null:e.e<L?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,f=e;f>=10;f/=10,u++);return void(u>F?m.c=m.e=null:(m.e=u,m.c=[e]))}y=String(e)}else{if(!s.test(y=String(e)))return i(m,y,p);m.s=45==y.charCodeAt(0)?(y=y.slice(1),-1):1}(u=y.indexOf("."))>-1&&(y=y.replace(".","")),(f=y.search(/e/i))>0?(u<0&&(u=f),u+=+y.slice(f+1),y=y.substring(0,f)):u<0&&(u=y.length)}else{if(w(t,2,H.length,"Base"),10==t&&$)return q(m=new G(e),N+m.e+1,R);if(y=String(e),p="number"==typeof e){if(0*e!=0)return i(m,y,p,t);if(m.s=1/e<0?(y=y.slice(1),-1):1,G.DEBUG&&y.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else m.s=45===y.charCodeAt(0)?(y=y.slice(1),-1):1;for(r=H.slice(0,t),u=f=0,g=y.length;f<g;f++)if(r.indexOf(o=y.charAt(f))<0){if("."==o){if(f>u){u=g;continue}}else if(!a&&(y==y.toUpperCase()&&(y=y.toLowerCase())||y==y.toLowerCase()&&(y=y.toUpperCase()))){a=!0,f=-1,u=0;continue}return i(m,String(e),p,t)}p=!1,(u=(y=n(y,t,10,m.s)).indexOf("."))>-1?y=y.replace(".",""):u=y.length}for(f=0;48===y.charCodeAt(f);f++);for(g=y.length;48===y.charCodeAt(--g););if(y=y.slice(f,++g)){if(g-=f,p&&G.DEBUG&&g>15&&(e>h||e!==c(e)))throw Error(l+m.s*e);if((u=u-f-1)>F)m.c=m.e=null;else if(u<L)m.c=[m.e=0];else{if(m.e=u,m.c=[],f=(u+1)%d,u<0&&(f+=d),f<g){for(f&&m.c.push(+y.slice(0,f)),g-=d;f<g;)m.c.push(+y.slice(f,f+=d));f=d-(y=y.slice(f)).length}else f-=g;for(;f--;y+="0");m.c.push(+y)}}else m.c=[m.e=0]}function z(e,t,r,n){var i,o,s,a,c;if(null==r?r=R:w(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=b(e.c),c=1==n||2==n&&(s<=B||s>=M)?E(c,s):_(c,s,"0");else if(o=(e=q(new G(e),t,r)).e,a=(c=b(e.c)).length,1==n||2==n&&(t<=o||o<=B)){for(;a<t;c+="0",a++);c=E(c,o)}else if(t-=s,c=_(c,o,"0"),o+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-a)>0)for(o+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function V(e,t){for(var r,n,i=1,o=new G(e[0]);i<e.length;i++)(!(n=new G(e[i])).s||(r=v(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function W(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*d-1)>F?e.c=e.e=null:r<L?e.c=[e.e=0]:(e.e=r,e.c=t),e}function q(e,t,r,n){var i,o,s,u,l,h,g,y=e.c,m=p;if(y){e:{for(i=1,u=y[0];u>=10;u/=10,i++);if((o=t-i)<0)o+=d,s=t,l=y[h=0],g=c(l/m[i-s-1]%10);else if((h=a((o+1)/d))>=y.length){if(!n)break e;for(;y.length<=h;y.push(0));l=g=0,i=1,s=(o%=d)-d+1}else{for(l=u=y[h],i=1;u>=10;u/=10,i++);g=(s=(o%=d)-d+i)<0?0:c(l/m[i-s-1]%10)}if(n=n||t<0||null!=y[h+1]||(s<0?l:l%m[i-s-1]),n=r<4?(g||n)&&(0==r||r==(e.s<0?3:2)):g>5||5==g&&(4==r||n||6==r&&(o>0?s>0?l/m[i-s]:0:y[h-1])%10&1||r==(e.s<0?8:7)),t<1||!y[0])return y.length=0,n?(t-=e.e+1,y[0]=m[(d-t%d)%d],e.e=-t||0):y[0]=e.e=0,e;if(0==o?(y.length=h,u=1,h--):(y.length=h+1,u=m[d-o],y[h]=s>0?c(l/m[i-s]%m[s])*u:0),n)for(;;){if(0==h){for(o=1,s=y[0];s>=10;s/=10,o++);for(s=y[0]+=u,u=1;s>=10;s/=10,u++);o!=u&&(e.e++,y[0]==f&&(y[0]=1));break}if(y[h]+=u,y[h]!=f)break;y[h--]=0,u=1}for(o=y.length;0===y[--o];y.pop());}e.e>F?e.c=e.e=null:e.e<L&&(e.c=[e.e=0])}return e}function K(e){var t,r=e.e;return null===r?e.toString():(t=b(e.c),t=r<=B||r>=M?E(t,r):_(t,r,"0"),e.s<0?"-"+t:t)}return G.clone=e,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(w(r=e[t],0,y,t),N=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(w(r=e[t],0,8,t),R=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(w(r[0],-y,0,t),w(r[1],0,y,t),B=r[0],M=r[1]):(w(r,-y,y,t),B=-(M=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)w(r[0],-y,-1,t),w(r[1],1,y,t),L=r[0],F=r[1];else{if(w(r,-y,y,t),!r)throw Error(u+t+" cannot be zero: "+r);L=-(F=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw j=!r,Error(u+"crypto unavailable");j=r}else j=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(w(r=e[t],0,9,t),U=r),e.hasOwnProperty(t="POW_PRECISION")&&(w(r=e[t],0,y,t),D=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);Z=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);$="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:N,ROUNDING_MODE:R,EXPONENTIAL_AT:[B,M],RANGE:[L,F],CRYPTO:j,MODULO_MODE:U,POW_PRECISION:D,FORMAT:Z,ALPHABET:H}},G.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!G.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-y&&i<=y&&i===c(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=f||r!==c(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(u+"Invalid BigNumber: "+e)},G.maximum=G.max=function(){return V(arguments,-1)},G.minimum=G.min=function(){return V(arguments,1)},G.random=(o=9007199254740992,S=Math.random()*o&2097151?function(){return c(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,s=0,l=[],f=new G(C);if(null==e?e=N:w(e,0,y),i=a(e/d),j)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(l.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw j=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(l.push(o%1e14),s+=7);s=i/7}if(!j)for(;s<i;)(o=S())<9e15&&(l[s++]=o%1e14);for(i=l[--s],e%=d,i&&e&&(o=p[d-e],l[s]=c(i/o)*o);0===l[s];l.pop(),s--);if(s<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=d);for(s=1,o=l[0];o>=10;o/=10,s++);s<d&&(n-=d-s)}return f.e=n,f.c=l,f}),G.sum=function(){for(var e=1,t=arguments,r=new G(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,c=e.length;a<c;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var c,u,l,f,d,h,p,g,y=n.indexOf("."),m=N,v=R;for(y>=0&&(f=D,D=0,n=n.replace(".",""),h=(g=new G(i)).pow(n.length-y),D=f,g.c=t(_(b(h.c),h.e,"0"),10,o,e),g.e=g.c.length),l=f=(p=t(n,i,o,a?(c=H,e):(c=e,H))).length;0==p[--f];p.pop());if(!p[0])return c.charAt(0);if(y<0?--l:(h.c=p,h.e=l,h.s=s,p=(h=r(h,g,m,v,o)).c,d=h.r,l=h.e),y=p[u=l+m+1],f=o/2,d=d||u<0||null!=p[u+1],d=v<4?(null!=y||d)&&(0==v||v==(h.s<0?3:2)):y>f||y==f&&(4==v||d||6==v&&1&p[u-1]||v==(h.s<0?8:7)),u<1||!p[0])n=d?_(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(p.length=u,d)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(f=p.length;!p[--f];);for(y=0,n="";y<=f;n+=c.charAt(p[y++]));n=_(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,c=e.length,u=t%g,l=t/g|0;for(e=e.slice();c--;)a=((i=u*(o=e[c]%g)+(n=l*o+(s=e[c]/g|0)*u)%g*g+a)/r|0)+(n/g|0)+l*s,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,a){var u,l,h,p,g,y,b,v,w,A,E,_,S,x,T,P,I,k=n.s==i.s?1:-1,O=n.c,C=i.c;if(!(O&&O[0]&&C&&C[0]))return new G(n.s&&i.s&&(O?!C||O[0]!=C[0]:C)?O&&0==O[0]||!C?0*k:k/0:NaN);for(w=(v=new G(k)).c=[],k=o+(l=n.e-i.e)+1,a||(a=f,l=m(n.e/d)-m(i.e/d),k=k/d|0),h=0;C[h]==(O[h]||0);h++);if(C[h]>(O[h]||0)&&l--,k<0)w.push(1),p=!0;else{for(x=O.length,P=C.length,h=0,k+=2,(g=c(a/(C[0]+1)))>1&&(C=e(C,g,a),O=e(O,g,a),P=C.length,x=O.length),S=P,E=(A=O.slice(0,P)).length;E<P;A[E++]=0);I=C.slice(),I=[0].concat(I),T=C[0],C[1]>=a/2&&T++;do{if(g=0,(u=t(C,A,P,E))<0){if(_=A[0],P!=E&&(_=_*a+(A[1]||0)),(g=c(_/T))>1)for(g>=a&&(g=a-1),b=(y=e(C,g,a)).length,E=A.length;1==t(y,A,b,E);)g--,r(y,P<b?I:C,b,a),b=y.length,u=1;else 0==g&&(u=g=1),b=(y=C.slice()).length;if(b<E&&(y=[0].concat(y)),r(A,y,E,a),E=A.length,-1==u)for(;t(C,A,P,E)<1;)g++,r(A,P<E?I:C,E,a),E=A.length}else 0===u&&(g++,A=[0]);w[h++]=g,A[0]?A[E++]=O[S]||0:(A=[O[S]],E=1)}while((S++<x||null!=A[0])&&k--);p=null!=A[0],w[0]||w.splice(0,1)}if(a==f){for(h=1,k=w[0];k>=10;k/=10,h++);q(v,o+(v.e=h+l*d-1)+1,s,p)}else v.e=l,v.r=+p;return v}}(),x=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,P=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,k=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(k,"");if(I.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(x,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(T,"$1").replace(P,"0.$1")),t!=o))return new G(o,i);if(G.DEBUG)throw Error(u+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},O.absoluteValue=O.abs=function(){var e=new G(this);return e.s<0&&(e.s=1),e},O.comparedTo=function(e,t){return v(this,new G(e,t))},O.decimalPlaces=O.dp=function(e,t){var r,n,i,o=this;if(null!=e)return w(e,0,y),null==t?t=R:w(t,0,8),q(new G(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-m(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},O.dividedBy=O.div=function(e,t){return r(this,new G(e,t),N,R)},O.dividedToIntegerBy=O.idiv=function(e,t){return r(this,new G(e,t),0,1)},O.exponentiatedBy=O.pow=function(e,t){var r,n,i,o,s,l,f,h,p=this;if((e=new G(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+K(e));if(null!=t&&(t=new G(t)),s=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new G(Math.pow(+K(p),s?e.s*(2-A(e)):+K(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new G(NaN);(n=!l&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return o=p.s<0&&A(e)?-0:0,p.e>-1&&(o=1/o),new G(l?1/o:o);D&&(o=a(D/d+2))}for(s?(r=new G(.5),l&&(e.s=1),f=A(e)):f=(i=Math.abs(+K(e)))%2,h=new G(C);;){if(f){if(!(h=h.times(p)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=c(i/2)))break;f=i%2}else if(q(e=e.times(r),e.e+1,1),e.e>14)f=A(e);else{if(0==(i=+K(e)))break;f=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?h:(l&&(h=C.div(h)),t?h.mod(t):o?q(h,D,R,void 0):h)},O.integerValue=function(e){var t=new G(this);return null==e?e=R:w(e,0,8),q(t,t.e+1,e)},O.isEqualTo=O.eq=function(e,t){return 0===v(this,new G(e,t))},O.isFinite=function(){return!!this.c},O.isGreaterThan=O.gt=function(e,t){return v(this,new G(e,t))>0},O.isGreaterThanOrEqualTo=O.gte=function(e,t){return 1===(t=v(this,new G(e,t)))||0===t},O.isInteger=function(){return!!this.c&&m(this.e/d)>this.c.length-2},O.isLessThan=O.lt=function(e,t){return v(this,new G(e,t))<0},O.isLessThanOrEqualTo=O.lte=function(e,t){return-1===(t=v(this,new G(e,t)))||0===t},O.isNaN=function(){return!this.s},O.isNegative=function(){return this.s<0},O.isPositive=function(){return this.s>0},O.isZero=function(){return!!this.c&&0==this.c[0]},O.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new G(e,t)).s,!a||!t)return new G(NaN);if(a!=t)return e.s=-t,s.plus(e);var c=s.e/d,u=e.e/d,l=s.c,h=e.c;if(!c||!u){if(!l||!h)return l?(e.s=-t,e):new G(h?s:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new G(l[0]?s:3==R?-0:0)}if(c=m(c),u=m(u),l=l.slice(),a=c-u){for((o=a<0)?(a=-a,i=l):(u=c,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=l.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(l[t]!=h[t]){o=l[t]<h[t];break}if(o&&(i=l,l=h,h=i,e.s=-e.s),(t=(n=h.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=f-1;n>a;){if(l[--n]<h[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=f}l[n]-=h[n]}for(;0==l[0];l.splice(0,1),--u);return l[0]?W(e,l,u):(e.s=3==R?-1:1,e.c=[e.e=0],e)},O.modulo=O.mod=function(e,t){var n,i,o=this;return e=new G(e,t),!o.c||!e.s||e.c&&!e.c[0]?new G(NaN):!e.c||o.c&&!o.c[0]?new G(o):(9==U?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,U),(e=o.minus(n.times(e))).c[0]||1!=U||(e.s=o.s),e)},O.multipliedBy=O.times=function(e,t){var r,n,i,o,s,a,c,u,l,h,p,y,b,v,w,A=this,E=A.c,_=(e=new G(e,t)).c;if(!(E&&_&&E[0]&&_[0]))return!A.s||!e.s||E&&!E[0]&&!_||_&&!_[0]&&!E?e.c=e.e=e.s=null:(e.s*=A.s,E&&_?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=m(A.e/d)+m(e.e/d),e.s*=A.s,(c=E.length)<(h=_.length)&&(b=E,E=_,_=b,i=c,c=h,h=i),i=c+h,b=[];i--;b.push(0));for(v=f,w=g,i=h;--i>=0;){for(r=0,p=_[i]%w,y=_[i]/w|0,o=i+(s=c);o>i;)r=((u=p*(u=E[--s]%w)+(a=y*u+(l=E[s]/w|0)*p)%w*w+b[o]+r)/v|0)+(a/w|0)+y*l,b[o--]=u%v;b[o]=r}return r?++n:b.splice(0,1),W(e,b,n)},O.negated=function(){var e=new G(this);return e.s=-e.s||null,e},O.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new G(e,t)).s,!i||!t)return new G(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/d,s=e.e/d,a=n.c,c=e.c;if(!o||!s){if(!a||!c)return new G(i/0);if(!a[0]||!c[0])return c[0]?e:new G(a[0]?n:0*i)}if(o=m(o),s=m(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=c):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=c.length)<0&&(r=c,c=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+c[t]+i)/f|0,a[t]=f===a[t]?0:a[t]%f;return i&&(a=[i].concat(a),++s),W(e,a,s)},O.precision=O.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return w(e,1,y),null==t?t=R:w(t,0,8),q(new G(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*d+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},O.shiftedBy=function(e){return w(e,-9007199254740991,h),this.times("1e"+e)},O.squareRoot=O.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,c=s.s,u=s.e,l=N+4,f=new G("0.5");if(1!==c||!a||!a[0])return new G(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+K(s)))||c==1/0?(((t=b(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=m((u+1)/2)-(u<0||u%2),n=new G(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new G(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=f.times(o.plus(r(s,o,l,1))),b(o.c).slice(0,c)===(t=b(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(q(n,n.e+N+2,1),e=!n.times(n).eq(s));break}if(!i&&(q(o,o.e+N+2,0),o.times(o).eq(s))){n=o;break}l+=4,c+=4,i=1}return q(n,n.e+N+1,R,e)},O.toExponential=function(e,t){return null!=e&&(w(e,0,y),e++),z(this,e,t,1)},O.toFixed=function(e,t){return null!=e&&(w(e,0,y),e=e+this.e+1),z(this,e,t)},O.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=Z;else if("object"!=typeof r)throw Error(u+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",f=s[0],d=s[1],h=i.s<0,p=h?f.slice(1):f,g=p.length;if(c&&(o=a,a=c,c=o,g-=o),a>0&&g>0){for(o=g%a||a,f=p.substr(0,o);o<g;o+=a)f+=l+p.substr(o,a);c>0&&(f+=l+p.slice(o)),h&&(f="-"+f)}n=d?f+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):f}return(r.prefix||"")+n+(r.suffix||"")},O.toFraction=function(e){var t,n,i,o,s,a,c,l,f,h,g,y,m=this,v=m.c;if(null!=e&&(!(c=new G(e)).isInteger()&&(c.c||1!==c.s)||c.lt(C)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+K(c));if(!v)return new G(m);for(t=new G(C),f=n=new G(C),i=l=new G(C),y=b(v),s=t.e=y.length-m.e-1,t.c[0]=p[(a=s%d)<0?d+a:a],e=!e||c.comparedTo(t)>0?s>0?t:f:c,a=F,F=1/0,c=new G(y),l.c[0]=0;h=r(c,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,f=l.plus(h.times(o=f)),l=o,t=c.minus(h.times(o=t)),c=o;return o=r(e.minus(n),i,0,1),l=l.plus(o.times(f)),n=n.plus(o.times(i)),l.s=f.s=m.s,g=r(f,i,s*=2,R).minus(m).abs().comparedTo(r(l,n,s,R).minus(m).abs())<1?[f,i]:[l,n],F=a,g},O.toNumber=function(){return+K(this)},O.toPrecision=function(e,t){return null!=e&&w(e,1,y),z(this,e,t,2)},O.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=B||o>=M?E(b(r.c),o):_(b(r.c),o,"0"):10===e&&$?t=_(b((r=q(new G(r),N+o+1,R)).c),r.e,"0"):(w(e,2,H.length,"Base"),t=n(_(b(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},O.valueOf=O.toJSON=function(){return K(this)},O._isBigNumber=!0,null!=t&&G.set(t),G}(),o.default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},2197: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&&void 0!==window.Buffer?window.Buffer:r(3196).Buffer}catch(e){}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 c(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function u(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),c=t;c<a;c++){var u=e.charCodeAt(c)-48;o*=i,s=u>=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&s<i,"Invalid character"),o+=s}return o}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l<a;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var f=1;for(c=u(e,l,e.length,t),l=0;l<s;l++)f*=t;this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){l(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function g(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,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,f=67108863&c,d=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=d;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+f)/67108864|0,f=67108863&s}r.words[u]=0|f,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?d[6-c.length]+c+r:c+r}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 u=h[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var g=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?g+r:d[u-g.length]+g+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)},o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var y=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],f=8191&l,d=l>>>13,h=0|s[1],p=8191&h,g=h>>>13,y=0|s[2],m=8191&y,b=y>>>13,v=0|s[3],w=8191&v,A=v>>>13,E=0|s[4],_=8191&E,S=E>>>13,x=0|s[5],T=8191&x,P=x>>>13,I=0|s[6],k=8191&I,O=I>>>13,C=0|s[7],N=8191&C,R=C>>>13,B=0|s[8],M=8191&B,L=B>>>13,F=0|s[9],j=8191&F,U=F>>>13,D=0|a[0],Z=8191&D,H=D>>>13,$=0|a[1],G=8191&$,z=$>>>13,V=0|a[2],W=8191&V,q=V>>>13,K=0|a[3],J=8191&K,Y=K>>>13,Q=0|a[4],X=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],ce=8191&ae,ue=ae>>>13,le=0|a[8],fe=8191&le,de=le>>>13,he=0|a[9],pe=8191&he,ge=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(u+(n=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,H))+Math.imul(d,Z)|0))<<13)|0;u=((o=Math.imul(d,H))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,Z),i=(i=Math.imul(p,H))+Math.imul(g,Z)|0,o=Math.imul(g,H);var me=(u+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,z)|0)+Math.imul(d,G)|0))<<13)|0;u=((o=o+Math.imul(d,z)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,Z),i=(i=Math.imul(m,H))+Math.imul(b,Z)|0,o=Math.imul(b,H),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,z)|0;var be=(u+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(d,W)|0))<<13)|0;u=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,Z),i=(i=Math.imul(w,H))+Math.imul(A,Z)|0,o=Math.imul(A,H),n=n+Math.imul(m,G)|0,i=(i=i+Math.imul(m,z)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,z)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,q)|0;var ve=(u+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,Z),i=(i=Math.imul(_,H))+Math.imul(S,Z)|0,o=Math.imul(S,H),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,q)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,Y)|0;var we=(u+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,X)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,Z),i=(i=Math.imul(T,H))+Math.imul(P,Z)|0,o=Math.imul(P,H),n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,z)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,z)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(m,J)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,ee)|0;var Ae=(u+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(k,Z),i=(i=Math.imul(k,H))+Math.imul(O,Z)|0,o=Math.imul(O,H),n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,z)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,z)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,X)|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(g,re)|0,o=o+Math.imul(g,ne)|0;var Ee=(u+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,se)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,Z),i=(i=Math.imul(N,H))+Math.imul(R,Z)|0,o=Math.imul(R,H),n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,z)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,z)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,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(g,oe)|0,o=o+Math.imul(g,se)|0;var _e=(u+(n=n+Math.imul(f,ce)|0)|0)+((8191&(i=(i=i+Math.imul(f,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(M,Z),i=(i=Math.imul(M,H))+Math.imul(L,Z)|0,o=Math.imul(L,H),n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,z)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,z)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,q)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,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,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(g,ce)|0,o=o+Math.imul(g,ue)|0;var Se=(u+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(j,Z),i=(i=Math.imul(j,H))+Math.imul(U,Z)|0,o=Math.imul(U,H),n=n+Math.imul(M,G)|0,i=(i=i+Math.imul(M,z)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,z)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(m,ce)|0,i=(i=i+Math.imul(m,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(g,fe)|0,o=o+Math.imul(g,de)|0;var xe=(u+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ge)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,ge)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(j,G),i=(i=Math.imul(j,z))+Math.imul(U,G)|0,o=Math.imul(U,z),n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(N,J)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(m,fe)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(b,fe)|0,o=o+Math.imul(b,de)|0;var Te=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;u=((o=o+Math.imul(g,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(j,W),i=(i=Math.imul(j,q))+Math.imul(U,W)|0,o=Math.imul(U,q),n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,de)|0;var Pe=(u+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ge)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,ge)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(j,J),i=(i=Math.imul(j,Y))+Math.imul(U,J)|0,o=Math.imul(U,Y),n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(P,ce)|0,o=o+Math.imul(P,ue)|0,n=n+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,de)|0;var Ie=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ge)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(j,X),i=(i=Math.imul(j,ee))+Math.imul(U,X)|0,o=Math.imul(U,ee),n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(k,ce)|0,i=(i=i+Math.imul(k,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,de)|0;var ke=(u+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,ge)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(j,re),i=(i=Math.imul(j,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,se)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(R,ce)|0,o=o+Math.imul(R,ue)|0,n=n+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Oe=(u+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ge)|0)+Math.imul(P,pe)|0))<<13)|0;u=((o=o+Math.imul(P,ge)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(j,oe),i=(i=Math.imul(j,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,de)|0;var Ce=(u+(n=n+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,ge)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,ge)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(j,ce),i=(i=Math.imul(j,ue))+Math.imul(U,ce)|0,o=Math.imul(U,ue),n=n+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,de)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,ge)|0)+Math.imul(R,pe)|0))<<13)|0;u=((o=o+Math.imul(R,ge)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(j,fe),i=(i=Math.imul(j,de))+Math.imul(U,fe)|0,o=Math.imul(U,de);var Re=(u+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ge)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Be=(u+(n=Math.imul(j,pe))|0)+((8191&(i=(i=Math.imul(j,ge))+Math.imul(U,pe)|0))<<13)|0;return u=((o=Math.imul(U,ge))+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,c[0]=ye,c[1]=me,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=Ee,c[7]=_e,c[8]=Se,c[9]=xe,c[10]=Te,c[11]=Pe,c[12]=Ie,c[13]=ke,c[14]=Oe,c[15]=Ce,c[16]=Ne,c[17]=Re,c[18]=Be,0!==u&&(c[19]=u,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,f=(0|e.words[l])*(0|t.words[u]),d=67108863&f;a=67108863&(d=d+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(d>>>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||(y=g),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?g(this,e,t):r<1024?m(this,e,t):b(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},v.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var f=c,d=u,h=0;h<s;h++){var p=r[l+h],g=n[l+h],y=r[l+h+s],m=n[l+h+s],b=f*y-d*m;m=f*m+d*y,y=b,r[l+h]=p+y,n[l+h]=g+m,r[l+h+s]=p-y,n[l+h+s]=g-m,h!==a&&(b=c*f-u*d,d=c*d+u*f,f=b)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},v.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),f=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,o,a,c,n,i),this.transform(u,o,l,f,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*f[h];c[h]=a[h]*f[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<r;this.words[t]=c|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=r;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var f=0|this.words[u];this.words[u]=l<<26-o|f>>>o,l=f&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var c=(0|e.words[i])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var f=c-1;f>=0;f--){var d=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=d)}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),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(f)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},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),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new T(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 A(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(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(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 P(e){T.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)}A.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},A.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},A.prototype.split=function(e,t){e.iushrn(this.n,0,t)},A.prototype.imulK=function(e){return e.imul(this.k)},i(E,A),E.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},E.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(_,A),i(S,A),i(x,A),x.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new _;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return w[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.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")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.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)},T.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},T.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)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.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),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var g=h,y=0;0!==g.cmp(a);y++)g=g.redSqr();n(y<p);var m=this.pow(f,new o(1).iushln(p-y-1));d=d.redMul(m),f=m.redSqr(),h=h.redMul(f),p=y}return d},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var f=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4==++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new P(e)},i(P,T),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.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)},P.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)},P.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},7160:function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(r),s=Math.max(i,o),a=0,c=e.map([t,r],(function(t){var r=s-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(c[0][s]>c[1][s])return 1;if(c[0][s]===c[1][s]){if(s===a)return 0;s-=1}else if(c[0][s]<c[1][s])return-1}},e.map=function(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n},e.find=function(e,t){var r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){var i=e[r];if(t(i,r))return i}},e.assign=function(e){for(var t,r,n=e,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var a=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){n[t]=e[t]}))};for(t=0,r=o.length;t<r;t+=1)a();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,r){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},o=r(18);function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=function(){function e(){}var t,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],null&&s(t.prototype,null),r&&s(t,r),e}();t.default=a,e.exports=t.default},91:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=c(r(92)),i=c(r(93)),o=c(r(94)),s=c(r(95)),a=c(r(17));function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},n=0,i={},o=0;if(Object.keys(e).forEach((function(t){var s=e[t];"string"==typeof s?(i[t]=s,o+=1):"object"==typeof s&&(r[t]=s,n+=1)})),n>0){var s=Object.keys(r),c=a.default.find(s,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(r[c]);if(void 0!==u)return u}var l=a.default.find(s,(function(e){return t.isPlatform(e)}));if(l){var f=this.satisfies(r[l]);if(void 0!==f)return f}}if(o>0){var d=Object.keys(i),h=a.default.find(d,(function(e){return t.isBrowser(e,!0)}));if(void 0!==h)return this.compareVersion(i[h])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(a.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:o.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:o.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:o.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},o=r(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=s,e.exports=t.default}})},2745:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(8087);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},8834:(e,t,r)=>{"use strict";const n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.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,c.prototype),t}function c(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 f(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(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(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return h(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 c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(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 f(e){return l(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(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 V(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:V(e).length;t=(""+t).toLowerCase(),i=!0}}function y(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 O(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return x(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),J(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=c.from(t,n)),c.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,c=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,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function A(e,t,r,n){return q(V(t,e.length-r),e,r,n)}function E(e,t,r,n){return q(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return q(W(t),e,r,n)}function S(e,t,r,n){return q(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}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<=P)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=P));return r}(n)}t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===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),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==l[e]){o=u[e],s=l[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const P=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function C(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function B(e,t,r,n,i){H(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 M(e,t,r,n,i){H(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 L(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 F(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Q((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=Q((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(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},c.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Q((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=Q((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(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},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Q((function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Q((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(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},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(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},c.prototype.writeBigInt64LE=Q((function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Q((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const U={};function D(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function Z(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,i,o)}function $(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw $(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",`>= ${r?1:0} and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Z(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function V(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=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?X:e}function X(){throw new Error("BigInt not supported")}},2680:(e,t,r)=>{"use strict";var n=r(7286),i=r(9429),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},9429:(e,t,r)=>{"use strict";var n=r(4090),i=r(7286),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),c=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=a(n,s,arguments);return c&&u&&c(t,"length").configurable&&u(t,"length",{value:1+l(0,e.length-(arguments.length-1))}),t};var f=function(){return a(n,o,arguments)};u?u(e.exports,"apply",{value:f}):e.exports.apply=f},5130:(e,t,r)=>{var n=r(4406);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(7123)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7123:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(1378),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},7554:(e,t,r)=>{"use strict";var n=t;n.version=r(763).i8,n.utils=r(8288),n.rand=r(2745),n.curve=r(8610),n.curves=r(1479),n.ec=r(2150),n.eddsa=r(9208)},8919:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288),o=i.getNAF,s=i.getJSF,a=i.assert;function c(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 u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,c,u=[];for(s=0;s<n.length;s+=r.step){c=0;for(var l=s+r.step-1;l>=s;l--)c=(c<<1)+n[l];u.push(c)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(s=0;s<u.length;s++)(c=u[s])===h?d=d.mixedAdd(r.points[s]):c===-h&&(d=d.mixedAdd(r.points[s].neg()));f=f.add(d)}return f.toP()},c.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(t,r,this._bitLength),c=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var l=0;u>=0&&0===s[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var f=s[u];a(0!==f),c="affine"===e.type?f>0?c.mixedAdd(i[f-1>>1]):c.mixedAdd(i[-f-1>>1].neg()):f>0?c.add(i[f-1>>1]):c.add(i[-f-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){var a,c,u,l=this._wnafT1,f=this._wnafT2,d=this._wnafT3,h=0;for(a=0;a<n;a++){var p=(u=t[a])._getNAFPoints(e);l[a]=p.wnd,f[a]=p.points}for(a=n-1;a>=1;a-=2){var g=a-1,y=a;if(1===l[g]&&1===l[y]){var m=[t[g],null,null,t[y]];0===t[g].y.cmp(t[y].y)?(m[1]=t[g].add(t[y]),m[2]=t[g].toJ().mixedAdd(t[y].neg())):0===t[g].y.cmp(t[y].y.redNeg())?(m[1]=t[g].toJ().mixedAdd(t[y]),m[2]=t[g].add(t[y].neg())):(m[1]=t[g].toJ().mixedAdd(t[y]),m[2]=t[g].toJ().mixedAdd(t[y].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[g],r[y]);for(h=Math.max(v[0].length,h),d[g]=new Array(h),d[y]=new Array(h),c=0;c<h;c++){var w=0|v[0][c],A=0|v[1][c];d[g][c]=b[3*(w+1)+(A+1)],d[y][c]=0,f[g]=m}}else d[g]=o(r[g],l[g],this._bitLength),d[y]=o(r[y],l[y],this._bitLength),h=Math.max(d[g].length,h),h=Math.max(d[y].length,h)}var E=this.jpoint(null,null,null),_=this._wnafT4;for(a=h;a>=0;a--){for(var S=0;a>=0;){var x=!0;for(c=0;c<n;c++)_[c]=0|d[c][a],0!==_[c]&&(x=!1);if(!x)break;S++,a--}if(a>=0&&S++,E=E.dblp(S),a<0)break;for(c=0;c<n;c++){var T=_[c];0!==T&&(T>0?u=f[c][T-1>>1]:T<0&&(u=f[c][-T-1>>1].neg()),E="affine"===u.type?E.mixedAdd(u):E.add(u))}}for(a=0;a<n;a++)f[a]=null;return i?E:E.toP()},c.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(e){return this.encode(e,!0)},u.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},u.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},u.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},u.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},u.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},7105:(e,t,r)=>{"use strict";var n=r(8288),i=r(2197),o=r(1285),s=r(8919),a=n.assert;function c(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 u(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(c,s),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},c.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 c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},c.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)},c.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(u,s.BasePoint),c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},c.prototype.point=function(e,t,r,n){return new u(this,e,t,r,n)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=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),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),f=s.redMul(o);return this.curve.point(c,u,f,l)},u.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=s.redSub(a).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),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(c)),r=n.redMul(o);return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),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),c=r.redAdd(t),u=o.redMul(s),l=a.redMul(c),f=o.redMul(c),d=s.redMul(a);return this.curve.point(u,l,d,f)},u.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),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),f=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(f,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){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},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),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}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},8610:(e,t,r)=>{"use strict";var n=t;n.base=r(8919),n.short=r(7715),n.mont=r(5125),n.edwards=r(7105)},5125:(e,t,r)=>{"use strict";var n=r(2197),i=r(1285),o=r(8919),s=r(8288);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 c(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(c,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.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)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.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()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.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},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},7715:(e,t,r)=>{"use strict";var n=r(8288),i=r(2197),o=r(1285),s=r(8919),a=n.assert;function c(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 u(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 l(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(c,s),e.exports=c,c.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)}}},c.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()]},c.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,c,u,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),g=new i(0),y=new i(0),m=new i(1),b=0;0!==d.cmpn(0);){var v=h.div(d);u=h.sub(v.mul(d)),l=y.sub(v.mul(p));var w=m.sub(v.mul(g));if(!n&&u.cmp(f)<0)t=c.neg(),r=p,n=u.neg(),o=l;else if(n&&2==++b)break;c=u,h=d,d=u,y=p,p=l,m=g,g=w}s=u.neg(),a=l;var A=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(A)>=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}]},c.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),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},c.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)},c.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)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u},o(u,s.BasePoint),c.prototype.point=function(e,t,r){return new u(this,e,t,r)},c.prototype.pointFromJSON=function(e,t){return u.fromJSON(this,e,t)},u.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.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)},u.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)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.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)},u.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)},u.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)},u.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))},u.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},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),c.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.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)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.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),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),f=n.redMul(u),d=c.redSqr().redIAdd(l).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,h,p)},l.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 c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),f=a.redSqr().redIAdd(u).redISub(l).redISub(l),d=a.redMul(l.redISub(f)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(f,d,h)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),f=u.redSqr(),d=f.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(f),g=h.redSqr().redISub(p.redAdd(p)),y=p.redISub(g),m=h.redMul(y);m=m.redIAdd(m).redISub(d);var b=u.redMul(a);t+1<e&&(c=c.redMul(d)),o=g,a=b,u=m}return this.curve.jpoint(o,u.redMul(i),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),h=this.x.redAdd(f).redSqr().redISub(l).redISub(d);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),g=p.redSqr(),y=d.redIAdd(d);y=(y=y.redIAdd(y)).redIAdd(y),e=g.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},l.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),g=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var y=f.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),t=h.redMul(p.redISub(e)).redISub(y)}return this.curve.jpoint(e,t,r)},l.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),f=u.redISub(l),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=a.redMul(f).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(a).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,d,h)},l.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},l.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},l.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1479:(e,t,r)=>{"use strict";var n,i=t,o=r(4485),s=r(8610),a=r(8288).assert;function c(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 u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("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"]}),u("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"]}),u("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"]}),u("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"]}),u("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"]}),u("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"]}),u("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(7983)}catch(e){n=void 0}u("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]})},2150:(e,t,r)=>{"use strict";var n=r(2197),i=r(8873),o=r(8288),s=r(1479),a=r(2745),c=o.assert,u=r(2307),l=r(1798);function f(e){if(!(this instanceof f))return new f(e);"string"==typeof e&&(c(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=f,f.prototype.keyPair=function(e){return new u(this,e)},f.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},f.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},f.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)}},f.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},f.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),c=e.toArray("be",s),u=new i({hash:this.hash,entropy:a,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(u.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(f)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var g=p.getX(),y=g.umod(this.n);if(0!==y.cmpn(0)){var m=h.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var b=(p.getY().isOdd()?1:0)|(0!==g.cmp(y)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),b^=1),new l({r:y,s:m,recoveryParam:b})}}}}}},f.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new l(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,c=s.invm(this.n),u=c.mul(e).umod(this.n),f=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(e,t,r,i){c((3&r)===r,"The recovery param is more than two bits"),t=new l(t,i);var o=this.n,s=new n(e),a=t.r,u=t.s,f=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var h=t.r.invm(o),p=o.sub(s).mul(h).umod(o),g=u.mul(h).umod(o);return this.g.mulAdd(p,a,g)},f.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(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")}},2307:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},1798:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288),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 c(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function l(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=c(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=c(e,r);if(!1===s)return!1;var u=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var l=c(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;var f=e.slice(r.place,l+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(u),this.s=new n(f),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=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,e)}},9208:(e,t,r)=>{"use strict";var n=r(4485),i=r(1479),o=r(8288),s=o.assert,a=o.parseBytes,c=r(851),u=r(6117);function l(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(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=l,l.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()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},l.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)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return o.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},851:(e,t,r)=>{"use strict";var n=r(8288),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},6117:(e,t,r)=>{"use strict";var n=r(2197),i=r(8288),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function c(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(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},7983: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"]]}}},8288:(e,t,r)=>{"use strict";var n=t,i=r(2197),o=r(9561),s=r(3022);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,c=o.andln(i-1);o.isOdd()?(a=c>(i>>1)-1?(i>>1)-c:c,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,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,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")}},8797:(e,t,r)=>{var n=r(4406),i=r(9928),o=function(){},s=function(e,t,r){if("function"==typeof t)return s(e,null,t);t||(t={}),r=i(r||o);var a=e._writableState,c=e._readableState,u=t.readable||!1!==t.readable&&e.readable,l=t.writable||!1!==t.writable&&e.writable,f=!1,d=function(){e.writable||h()},h=function(){l=!1,u||r.call(e)},p=function(){u=!1,l||r.call(e)},g=function(t){r.call(e,t?new Error("exited with error code: "+t):null)},y=function(t){r.call(e,t)},m=function(){n.nextTick(b)},b=function(){if(!f)return(!u||c&&c.ended&&!c.destroyed)&&(!l||a&&a.ended&&!a.destroyed)?void 0:r.call(e,new Error("premature close"))},v=function(){e.req.on("finish",h)};return function(e){return e.setHeader&&"function"==typeof e.abort}(e)?(e.on("complete",h),e.on("abort",m),e.req?v():e.on("request",v)):l&&!a&&(e.on("end",d),e.on("close",d)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",g),e.on("end",p),e.on("finish",h),!1!==t.error&&e.on("error",y),e.on("close",m),function(){f=!0,e.removeListener("complete",h),e.removeListener("abort",m),e.removeListener("request",v),e.req&&e.req.removeListener("finish",h),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("exit",g),e.removeListener("end",p),e.removeListener("error",y),e.removeListener("close",m)}};e.exports=s},1115:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak512=t.keccak384=t.keccak256=t.keccak224=void 0;const n=r(3488),i=r(144);t.keccak224=(0,i.wrapHash)(n.keccak_224),t.keccak256=(()=>{const e=(0,i.wrapHash)(n.keccak_256);return e.create=n.keccak_256.create,e})(),t.keccak384=(0,i.wrapHash)(n.keccak_384),t.keccak512=(0,i.wrapHash)(n.keccak_512)},1019:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCurve=t.getHash=void 0;const n=r(520),i=r(300),o=r(551);function s(e){return{hash:e,hmac:(t,...r)=>(0,n.hmac)(e,t,(0,i.concatBytes)(...r)),randomBytes:i.randomBytes}}t.getHash=s,t.createCurve=function(e,t){const r=t=>(0,o.weierstrass)({...e,...s(t)});return Object.freeze({...r(t),create:r})}},7824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateBasic=t.wNAF=void 0;const n=r(8767),i=r(7367),o=BigInt(0),s=BigInt(1);t.wNAF=function(e,t){const r=(e,t)=>{const r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>o;)r&s&&(n=n.add(i)),i=i.double(),r>>=s;return n},precomputeWindow(e,t){const{windows:r,windowSize:i}=n(t),o=[];let s=e,a=s;for(let e=0;e<r;e++){a=s,o.push(a);for(let e=1;e<i;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(t,i,o){const{windows:a,windowSize:c}=n(t);let u=e.ZERO,l=e.BASE;const f=BigInt(2**t-1),d=2**t,h=BigInt(t);for(let e=0;e<a;e++){const t=e*c;let n=Number(o&f);o>>=h,n>c&&(n-=d,o+=s);const a=t,p=t+Math.abs(n)-1,g=e%2!=0,y=n<0;0===n?l=l.add(r(g,i[a])):u=u.add(r(y,i[p]))}return{p:u,f:l}},wNAFCached(e,t,r,n){const i=e._WINDOW_SIZE||1;let o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,n(o))),this.wNAF(i,o,r)}}},t.validateBasic=function(e){return(0,n.validateField)(e.Fp),(0,i.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}},9173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHasher=t.isogenyMap=t.hash_to_field=t.expand_message_xof=t.expand_message_xmd=void 0;const n=r(8767),i=r(7367),o=i.bytesToNumberBE;function s(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function a(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function c(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected")}function u(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function l(e,t,r,n){c(e),c(t),u(r),t.length>255&&(t=n((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:o,blockLen:l}=n,f=Math.ceil(r/o);if(f>255)throw new Error("Invalid xmd length");const d=(0,i.concatBytes)(t,s(t.length,1)),h=s(0,l),p=s(r,2),g=new Array(f),y=n((0,i.concatBytes)(h,e,p,s(0,1),d));g[0]=n((0,i.concatBytes)(y,s(1,1),d));for(let e=1;e<=f;e++){const t=[a(y,g[e-1]),s(e+1,1),d];g[e]=n((0,i.concatBytes)(...t))}return(0,i.concatBytes)(...g).slice(0,r)}function f(e,t,r,n,o){if(c(e),c(t),u(r),t.length>255){const e=Math.ceil(2*n/8);t=o.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(e).update(s(r,2)).update(t).update(s(t.length,1)).digest()}function d(e,t,r){(0,i.validateObject)(r,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:s,k:a,m:d,hash:h,expand:p,DST:g}=r;c(e),u(t);const y=function(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return(0,i.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}(g),m=s.toString(2).length,b=Math.ceil((m+a)/8),v=t*d*b;let w;if("xmd"===p)w=l(e,y,v,h);else if("xof"===p)w=f(e,y,v,a,h);else{if("_internal_pass"!==p)throw new Error('expand must be "xmd" or "xof"');w=e}const A=new Array(t);for(let e=0;e<t;e++){const t=new Array(d);for(let r=0;r<d;r++){const i=b*(r+e*d),a=w.subarray(i,i+b);t[r]=(0,n.mod)(o(a),s)}A[e]=t}return A}t.expand_message_xmd=l,t.expand_message_xof=f,t.hash_to_field=d,t.isogenyMap=function(e,t){const r=t.map((e=>Array.from(e).reverse()));return(t,n)=>{const[i,o,s,a]=r.map((r=>r.reduce(((r,n)=>e.add(e.mul(r,t),n)))));return t=e.div(i,o),n=e.mul(n,e.div(s,a)),{x:t,y:n}}},t.createHasher=function(e,t,r){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const o=d(n,2,{...r,DST:r.DST,...i}),s=e.fromAffine(t(o[0])),a=e.fromAffine(t(o[1])),c=s.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,i){const o=d(n,1,{...r,DST:r.encodeDST,...i}),s=e.fromAffine(t(o[0])).clearCofactor();return s.assertValidity(),s}}}},8767:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashToPrivateScalar=t.FpSqrtEven=t.FpSqrtOdd=t.Field=t.nLength=t.FpIsSquare=t.FpDiv=t.FpInvertBatch=t.FpPow=t.validateField=t.isNegativeLE=t.FpSqrt=t.tonelliShanks=t.invert=t.pow2=t.pow=t.mod=void 0;const n=r(7367),i=BigInt(0),o=BigInt(1),s=BigInt(2),a=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);function f(e,t){const r=e%t;return r>=i?r:t+r}function d(e,t,r){if(r<=i||t<i)throw new Error("Expected power/modulo > 0");if(r===o)return i;let n=o;for(;t>i;)t&o&&(n=n*e%r),e=e*e%r,t>>=o;return n}function h(e,t){if(e===i||t<=i)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=f(e,t),n=t,s=i,a=o,c=o,u=i;for(;r!==i;){const e=n/r,t=n%r,i=s-c*e,o=a-u*e;n=r,r=t,s=c,a=u,c=i,u=o}if(n!==o)throw new Error("invert: does not exist");return f(s,t)}function p(e){const t=(e-o)/s;let r,n,a;for(r=e-o,n=0;r%s===i;r/=s,n++);for(a=s;a<e&&d(a,t,e)!==e-o;a++);if(1===n){const t=(e+o)/c;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const u=(r+o)/s;return function(e,i){if(e.pow(i,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let s=n,c=e.pow(e.mul(e.ONE,a),r),l=e.pow(i,u),f=e.pow(i,r);for(;!e.eql(f,e.ONE);){if(e.eql(f,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(f);t<s&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,o<<BigInt(s-t-1));c=e.sqr(r),l=e.mul(l,r),f=e.mul(f,c),s=t}return l}}function g(e){if(e%c===a){const t=(e+o)/c;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%l===u){const t=(e-u)/l;return function(e,r){const n=e.mul(r,s),i=e.pow(n,t),o=e.mul(r,i),a=e.mul(e.mul(o,s),i),c=e.mul(o,e.sub(a,e.ONE));if(!e.eql(e.sqr(c),r))throw new Error("Cannot find square root");return c}}return p(e)}BigInt(9),BigInt(16),t.mod=f,t.pow=d,t.pow2=function(e,t,r){let n=e;for(;t-- >i;)n*=n,n%=r;return n},t.invert=h,t.tonelliShanks=p,t.FpSqrt=g,t.isNegativeLE=(e,t)=>(f(e,t)&o)===o;const y=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(e,t,r){if(r<i)throw new Error("Expected power > 0");if(r===i)return e.ONE;if(r===o)return t;let n=e.ONE,s=t;for(;r>i;)r&o&&(n=e.mul(n,s)),s=e.sqr(s),r>>=o;return n}function b(e,t){const r=new Array(t.length),n=t.reduce(((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n))),e.ONE),i=e.inv(n);return t.reduceRight(((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n))),i),r}function v(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}t.validateField=function(e){const t=y.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.validateObject)(e,t)},t.FpPow=m,t.FpInvertBatch=b,t.FpDiv=function(e,t,r){return e.mul(t,"bigint"==typeof r?h(r,e.ORDER):e.inv(r))},t.FpIsSquare=function(e){const t=(e.ORDER-o)/s;return r=>{const n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}},t.nLength=v,t.Field=function(e,t,r=!1,s={}){if(e<=i)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:a,nByteLength:c}=v(e,t);if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");const u=g(e),l=Object.freeze({ORDER:e,BITS:a,BYTES:c,MASK:(0,n.bitMask)(a),ZERO:i,ONE:o,create:t=>f(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return i<=t&&t<e},is0:e=>e===i,isOdd:e=>(e&o)===o,neg:t=>f(-t,e),eql:(e,t)=>e===t,sqr:t=>f(t*t,e),add:(t,r)=>f(t+r,e),sub:(t,r)=>f(t-r,e),mul:(t,r)=>f(t*r,e),pow:(e,t)=>m(l,e,t),div:(t,r)=>f(t*h(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>h(t,e),sqrt:s.sqrt||(e=>u(l,e)),invertBatch:e=>b(l,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.numberToBytesLE)(e,c):(0,n.numberToBytesBE)(e,c),fromBytes:e=>{if(e.length!==c)throw new Error(`Fp.fromBytes: expected ${c}, got ${e.length}`);return r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(l)},t.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)},t.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r},t.hashToPrivateScalar=function(e,t,r=!1){const i=(e=(0,n.ensureBytes)("privateHash",e)).length,s=v(t).nByteLength+8;if(s<24||i<s||i>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${i}`);return f(r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e),t-o)+o}},7367:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateObject=t.createHmacDrbg=t.bitMask=t.bitSet=t.bitGet=t.bitLen=t.utf8ToBytes=t.equalBytes=t.concatBytes=t.ensureBytes=t.numberToVarBytesBE=t.numberToBytesLE=t.numberToBytesBE=t.bytesToNumberLE=t.bytesToNumberBE=t.hexToBytes=t.hexToNumber=t.numberToHexUnpadded=t.bytesToHex=void 0;const r=BigInt(0),n=BigInt(1),i=BigInt(2),o=e=>e instanceof Uint8Array,s=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function a(e){if(!o(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=s[e[r]];return t}function c(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function u(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function l(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[t]=o}return r}function f(e,t){return l(e.toString(16).padStart(2*t,"0"))}function d(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!o(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t}t.bytesToHex=a,t.numberToHexUnpadded=c,t.hexToNumber=u,t.hexToBytes=l,t.bytesToNumberBE=function(e){return u(a(e))},t.bytesToNumberLE=function(e){if(!o(e))throw new Error("Uint8Array expected");return u(a(Uint8Array.from(e).reverse()))},t.numberToBytesBE=f,t.numberToBytesLE=function(e,t){return f(e,t).reverse()},t.numberToVarBytesBE=function(e){return l(c(e))},t.ensureBytes=function(e,t,r){let n;if("string"==typeof t)try{n=l(t)}catch(r){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else{if(!o(t))throw new Error(`${e} must be hex string or Uint8Array`);n=Uint8Array.from(t)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(`${e} expected ${r} bytes, got ${i}`);return n},t.concatBytes=d,t.equalBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},t.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))},t.bitLen=function(e){let t;for(t=0;e>r;e>>=n,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&n},t.bitSet=(e,t,i)=>e|(i?n:r)<<BigInt(t),t.bitMask=e=>(i<<BigInt(e-1))-n;const h=e=>new Uint8Array(e),p=e=>Uint8Array.from(e);t.createHmacDrbg=function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=h(e),i=h(e),o=0;const s=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),c=(e=h())=>{i=a(p([0]),e),n=a(),0!==e.length&&(i=a(p([1]),e),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=a();const t=n.slice();r.push(t),e+=n.length}return d(...r)};return(e,t)=>{let r;for(s(),c(e);!(r=t(u()));)c();return s(),r}};const g={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};t.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const i=g[r];if("function"!=typeof i)throw new Error(`Invalid validator "${r}", expected function`);const o=e[t];if(!(n&&void 0===o||i(o,e)))throw new Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${r}`)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}},551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapToCurveSimpleSWU=t.SWUFpSqrtRatio=t.weierstrass=t.weierstrassPoints=t.DER=void 0;const n=r(8767),i=r(7367),o=r(7367),s=r(7824),{bytesToNumberBE:a,hexToBytes:c}=i;t.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:r}=t.DER;if(e.length<2||2!==e[0])throw new r("Invalid signature integer tag");const n=e[1],i=e.subarray(2,n+2);if(!n||i.length!==n)throw new r("Invalid signature integer: wrong length");if(128&i[0])throw new r("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new r("Invalid signature integer: unnecessary leading zero");return{d:a(i),l:e.subarray(n+2)}},toSig(e){const{Err:r}=t.DER,n="string"==typeof e?c(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let i=n.length;if(i<2||48!=n[0])throw new r("Invalid signature tag");if(n[1]!==i-2)throw new r("Invalid signature: incorrect length");const{d:o,l:s}=t.DER._parseInt(n.subarray(2)),{d:a,l:u}=t.DER._parseInt(s);if(u.length)throw new r("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),o=n.length/2,s=i.length/2,a=r(o),c=r(s);return`30${r(s+o+4)}02${c}${i}02${a}${n}`}};const u=BigInt(0),l=BigInt(1),f=BigInt(2),d=BigInt(3),h=BigInt(4);function p(e){const t=function(e){const t=(0,s.validateBasic)(e);i.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,a=t.toBytes||((e,t,n)=>{const o=t.toAffine();return i.concatBytes(Uint8Array.from([4]),r.toBytes(o.x),r.toBytes(o.y))}),c=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function f(e){const{a:n,b:i}=t,o=r.sqr(e),s=r.mul(o,e);return r.add(r.add(s,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),f(t.Gx)))throw new Error("bad generator point: equation left != right");function h(e){return"bigint"==typeof e&&u<e&&e<t.n}function p(e){if(!h(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function g(e){const{allowedPrivateKeyLengths:r,nByteLength:s,wrapPrivateKey:a,n:c}=t;if(r&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=i.bytesToHex(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*s,"0")}let u;try{u="bigint"==typeof e?e:i.bytesToNumberBE((0,o.ensureBytes)("private key",e,s))}catch(t){throw new Error(`private key must be ${s} bytes, hex or bigint, not ${typeof e}`)}return a&&(u=n.mod(u,c)),p(u),u}const y=new Map;function m(e){if(!(e instanceof b))throw new Error("ProjectivePoint expected")}class b{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required")}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof b)throw new Error("projective point not allowed");const i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?b.ZERO:new b(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(b.fromAffine)}static fromHex(e){const t=b.fromAffine(c((0,o.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return b.BASE.multiply(g(e))}_setWindowSize(e){this._WINDOW_SIZE=e,y.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw new Error("bad point: x or y not FE");const i=r.sqr(n),o=f(e);if(!r.eql(i,o))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){m(e);const{px:t,py:n,pz:i}=this,{px:o,py:s,pz:a}=e,c=r.eql(r.mul(t,a),r.mul(o,i)),u=r.eql(r.mul(n,a),r.mul(s,i));return c&&u}negate(){return new b(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,i=r.mul(n,d),{px:o,py:s,pz:a}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,f=r.mul(o,o),h=r.mul(s,s),p=r.mul(a,a),g=r.mul(o,s);return g=r.add(g,g),l=r.mul(o,a),l=r.add(l,l),c=r.mul(e,l),u=r.mul(i,p),u=r.add(c,u),c=r.sub(h,u),u=r.add(h,u),u=r.mul(c,u),c=r.mul(g,c),l=r.mul(i,l),p=r.mul(e,p),g=r.sub(f,p),g=r.mul(e,g),g=r.add(g,l),l=r.add(f,f),f=r.add(l,f),f=r.add(f,p),f=r.mul(f,g),u=r.add(u,f),p=r.mul(s,a),p=r.add(p,p),f=r.mul(p,g),c=r.sub(c,f),l=r.mul(p,h),l=r.add(l,l),l=r.add(l,l),new b(c,u,l)}add(e){m(e);const{px:n,py:i,pz:o}=this,{px:s,py:a,pz:c}=e;let u=r.ZERO,l=r.ZERO,f=r.ZERO;const h=t.a,p=r.mul(t.b,d);let g=r.mul(n,s),y=r.mul(i,a),v=r.mul(o,c),w=r.add(n,i),A=r.add(s,a);w=r.mul(w,A),A=r.add(g,y),w=r.sub(w,A),A=r.add(n,o);let E=r.add(s,c);return A=r.mul(A,E),E=r.add(g,v),A=r.sub(A,E),E=r.add(i,o),u=r.add(a,c),E=r.mul(E,u),u=r.add(y,v),E=r.sub(E,u),f=r.mul(h,A),u=r.mul(p,v),f=r.add(u,f),u=r.sub(y,f),f=r.add(y,f),l=r.mul(u,f),y=r.add(g,g),y=r.add(y,g),v=r.mul(h,v),A=r.mul(p,A),y=r.add(y,v),v=r.sub(g,v),v=r.mul(h,v),A=r.add(A,v),g=r.mul(y,A),l=r.add(l,g),g=r.mul(E,A),u=r.mul(w,u),u=r.sub(u,g),g=r.mul(w,y),f=r.mul(E,f),f=r.add(f,g),new b(u,l,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(b.ZERO)}wNAF(e){return w.wNAFCached(this,y,e,(e=>{const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(b.fromAffine)}))}multiplyUnsafe(e){const n=b.ZERO;if(e===u)return n;if(p(e),e===l)return this;const{endo:i}=t;if(!i)return w.unsafeLadder(this,e);let{k1neg:o,k1:s,k2neg:a,k2:c}=i.splitScalar(e),f=n,d=n,h=this;for(;s>u||c>u;)s&l&&(f=f.add(h)),c&l&&(d=d.add(h)),h=h.double(),s>>=l,c>>=l;return o&&(f=f.negate()),a&&(d=d.negate()),d=new b(r.mul(d.px,i.beta),d.py,d.pz),f.add(d)}multiply(e){p(e);let n,i,o=e;const{endo:s}=t;if(s){const{k1neg:e,k1:t,k2neg:a,k2:c}=s.splitScalar(o);let{p:u,f:l}=this.wNAF(t),{p:f,f:d}=this.wNAF(c);u=w.constTimeNegate(e,u),f=w.constTimeNegate(a,f),f=new b(r.mul(f.px,s.beta),f.py,f.pz),n=u.add(f),i=l.add(d)}else{const{p:e,f:t}=this.wNAF(o);n=e,i=t}return b.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){const n=b.BASE,i=(e,t)=>t!==u&&t!==l&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,r));return o.is0()?void 0:o}toAffine(e){const{px:t,py:n,pz:i}=this,o=this.is0();null==e&&(e=o?r.ONE:r.inv(i));const s=r.mul(t,e),a=r.mul(n,e),c=r.mul(i,e);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw new Error("invZ was invalid");return{x:s,y:a}}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===l)return!0;if(r)return r(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===l?this:r?r(b,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),a(b,this,e)}toHex(e=!0){return i.bytesToHex(this.toRawBytes(e))}}b.BASE=new b(t.Gx,t.Gy,r.ONE),b.ZERO=new b(r.ZERO,r.ONE,r.ZERO);const v=t.nBitLength,w=(0,s.wNAF)(b,t.endo?Math.ceil(v/2):v);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:g,weierstrassEquation:f,isWithinCurveOrder:h}}function g(e,t){const r=e.ORDER;let n=u;for(let e=r-l;e%f===u;e/=f)n+=l;const i=n,o=f<<i-l-l,s=o*f,a=(r-l)/s,c=(a-l)/f,p=s-l,g=o,y=e.pow(t,a),m=e.pow(t,(a+l)/f);let b=(t,r)=>{let n=y,o=e.pow(r,p),s=e.sqr(o);s=e.mul(s,r);let a=e.mul(t,s);a=e.pow(a,c),a=e.mul(a,o),o=e.mul(a,r),s=e.mul(a,t);let u=e.mul(s,o);a=e.pow(u,g);let d=e.eql(a,e.ONE);o=e.mul(s,m),a=e.mul(u,n),s=e.cmov(o,s,d),u=e.cmov(a,u,d);for(let t=i;t>l;t--){let r=t-f;r=f<<r-l;let i=e.pow(u,r);const a=e.eql(i,e.ONE);o=e.mul(s,n),n=e.mul(n,n),i=e.mul(u,n),s=e.cmov(o,s,a),u=e.cmov(i,u,a)}return{isValid:d,value:s}};if(e.ORDER%h===d){const r=(e.ORDER-d)/h,n=e.sqrt(e.neg(t));b=(t,i)=>{let o=e.sqr(i);const s=e.mul(t,i);o=e.mul(o,s);let a=e.pow(o,r);a=e.mul(a,s);const c=e.mul(a,n),u=e.mul(e.sqr(a),i),l=e.eql(u,t);return{isValid:l,value:e.cmov(c,a,l)}}}return b}t.weierstrassPoints=p,t.weierstrass=function(e){const r=function(e){const t=(0,s.validateBasic)(e);return i.validateObject(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:a,n:c}=r,f=a.BYTES+1,d=2*a.BYTES+1;function h(e){return n.mod(e,c)}function g(e){return n.invert(e,c)}const{ProjectivePoint:y,normPrivateKeyToScalar:m,weierstrassEquation:b,isWithinCurveOrder:v}=p({...r,toBytes(e,t,r){const n=t.toAffine(),o=a.toBytes(n.x),s=i.concatBytes;return r?s(Uint8Array.from([t.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,a.toBytes(n.y))},fromBytes(e){const t=e.length,r=e[0],n=e.subarray(1);if(t!==f||2!==r&&3!==r){if(t===d&&4===r)return{x:a.fromBytes(n.subarray(0,a.BYTES)),y:a.fromBytes(n.subarray(a.BYTES,2*a.BYTES))};throw new Error(`Point of length ${t} was invalid. Expected ${f} compressed bytes or ${d} uncompressed bytes`)}{const e=i.bytesToNumberBE(n);if(!(u<(o=e)&&o<a.ORDER))throw new Error("Point is not on curve");const t=b(e);let s=a.sqrt(t);return 1==(1&r)!=((s&l)===l)&&(s=a.neg(s)),{x:e,y:s}}var o}}),w=e=>i.bytesToHex(i.numberToBytesBE(e,r.nByteLength));function A(e){return e>c>>l}const E=(e,t,r)=>i.bytesToNumberBE(e.slice(t,r));class _{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const t=r.nByteLength;return e=(0,o.ensureBytes)("compactSignature",e,2*t),new _(E(e,0,t),E(e,t,2*t))}static fromDER(e){const{r,s:n}=t.DER.toSig((0,o.ensureBytes)("DER",e));return new _(r,n)}assertValidity(){if(!v(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!v(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){const{r:t,s:n,recovery:i}=this,s=P((0,o.ensureBytes)("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const c=2===i||3===i?t+r.n:t;if(c>=a.ORDER)throw new Error("recovery id 2 or 3 invalid");const u=0==(1&i)?"02":"03",l=y.fromHex(u+w(c)),f=g(c),d=h(-s*f),p=h(n*f),m=y.BASE.multiplyAndAddUnsafe(l,d,p);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return A(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,h(-this.s),this.recovery):this}toDERRawBytes(){return i.hexToBytes(this.toDERHex())}toDERHex(){return t.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return i.hexToBytes(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}const S={isValidPrivateKey(e){try{return m(e),!0}catch(e){return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const e=r.randomBytes(a.BYTES+8),t=n.hashToPrivateScalar(e,c);return i.numberToBytesBE(t,r.nByteLength)},precompute:(e=8,t=y.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function x(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===f||n===d:r?n===2*f||n===2*d:e instanceof y}const T=r.bits2int||function(e){const t=i.bytesToNumberBE(e),n=8*e.length-r.nBitLength;return n>0?t>>BigInt(n):t},P=r.bits2int_modN||function(e){return h(T(e))},I=i.bitMask(r.nBitLength);function k(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(u<=e&&e<I))throw new Error(`bigint expected < 2^${r.nBitLength}`);return i.numberToBytesBE(e,r.nByteLength)}const O={lowS:r.lowS,prehash:!1},C={lowS:r.lowS,prehash:!1};return y.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(e,t=!0){return y.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(x(e))throw new Error("first arg must be private key");if(!x(t))throw new Error("second arg must be public key");return y.fromHex(t).multiply(m(e)).toRawBytes(r)},sign:function(e,t,n=O){const{seed:s,k2sig:c}=function(e,t,n=O){if(["recovered","canonical"].some((e=>e in n)))throw new Error("sign() legacy options not supported");const{hash:s,randomBytes:c}=r;let{lowS:f,prehash:d,extraEntropy:p}=n;null==f&&(f=!0),e=(0,o.ensureBytes)("msgHash",e),d&&(e=(0,o.ensureBytes)("prehashed msgHash",s(e)));const b=P(e),w=m(t),E=[k(w),k(b)];if(null!=p){const e=!0===p?c(a.BYTES):p;E.push((0,o.ensureBytes)("extraEntropy",e,a.BYTES))}const S=i.concatBytes(...E),x=b;return{seed:S,k2sig:function(e){const t=T(e);if(!v(t))return;const r=g(t),n=y.BASE.multiply(t).toAffine(),i=h(n.x);if(i===u)return;const o=h(r*h(x+i*w));if(o===u)return;let s=(n.x===i?0:2)|Number(n.y&l),a=o;return f&&A(o)&&(a=function(e){return A(e)?h(-e):e}(o),s^=1),new _(i,a,s)}}}(e,t,n),f=r;return i.createHmacDrbg(f.hash.outputLen,f.nByteLength,f.hmac)(s,c)},verify:function(e,n,i,s=C){const a=e;if(n=(0,o.ensureBytes)("msgHash",n),i=(0,o.ensureBytes)("publicKey",i),"strict"in s)throw new Error("options.strict was renamed to lowS");const{lowS:c,prehash:u}=s;let l,f;try{if("string"==typeof a||a instanceof Uint8Array)try{l=_.fromDER(a)}catch(e){if(!(e instanceof t.DER.Err))throw e;l=_.fromCompact(a)}else{if("object"!=typeof a||"bigint"!=typeof a.r||"bigint"!=typeof a.s)throw new Error("PARSE");{const{r:e,s:t}=a;l=new _(e,t)}}f=y.fromHex(i)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(c&&l.hasHighS())return!1;u&&(n=r.hash(n));const{r:d,s:p}=l,m=P(n),b=g(p),v=h(m*b),w=h(d*b),A=y.BASE.multiplyAndAddUnsafe(f,v,w)?.toAffine();return!!A&&h(A.x)===d},ProjectivePoint:y,Signature:_,utils:S}},t.SWUFpSqrtRatio=g,t.mapToCurveSimpleSWU=function(e,t){if(n.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const r=g(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let i,o,s,a,c,u,l,f;i=e.sqr(n),i=e.mul(i,t.Z),o=e.sqr(i),o=e.add(o,i),s=e.add(o,e.ONE),s=e.mul(s,t.B),a=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),a=e.mul(a,t.A),o=e.sqr(s),u=e.sqr(a),c=e.mul(u,t.A),o=e.add(o,c),o=e.mul(o,s),u=e.mul(u,a),c=e.mul(u,t.B),o=e.add(o,c),l=e.mul(i,s);const{isValid:d,value:h}=r(o,u);f=e.mul(i,n),f=e.mul(f,h),l=e.cmov(l,s,d),f=e.cmov(f,h,d);const p=e.isOdd(n)===e.isOdd(f);return f=e.cmov(e.neg(f),f,p),l=e.div(l,a),{x:l,y:f}}}},2934:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.schnorr=t.secp256k1=void 0;const n=r(3426),i=r(300),o=r(8767),s=r(551),a=r(7367),c=r(9173),u=r(1019),l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),f=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),d=BigInt(1),h=BigInt(2),p=(e,t)=>(e+t/h)/t;function g(e){const t=l,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),c=BigInt(44),u=BigInt(88),f=e*e*e%t,d=f*f*e%t,p=(0,o.pow2)(d,r,t)*d%t,g=(0,o.pow2)(p,r,t)*d%t,m=(0,o.pow2)(g,h,t)*f%t,b=(0,o.pow2)(m,i,t)*m%t,v=(0,o.pow2)(b,s,t)*b%t,w=(0,o.pow2)(v,c,t)*v%t,A=(0,o.pow2)(w,u,t)*w%t,E=(0,o.pow2)(A,c,t)*v%t,_=(0,o.pow2)(E,r,t)*d%t,S=(0,o.pow2)(_,a,t)*b%t,x=(0,o.pow2)(S,n,t)*f%t,T=(0,o.pow2)(x,h,t);if(!y.eql(y.sqr(T),e))throw new Error("Cannot find square root");return T}const y=(0,o.Field)(l,void 0,void 0,{sqrt:g});t.secp256k1=(0,u.createCurve)({a:BigInt(0),b:BigInt(7),Fp:y,n:f,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=f,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-d*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),c=p(s*e,t),u=p(-n*e,t);let l=(0,o.mod)(e-c*r-u*i,t),h=(0,o.mod)(-c*n-u*s,t);const g=l>a,y=h>a;if(g&&(l=t-l),y&&(h=t-h),l>a||h>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:g,k1:l,k2neg:y,k2:h}}}},n.sha256);const m=BigInt(0),b=e=>"bigint"==typeof e&&m<e&&e<l,v=e=>"bigint"==typeof e&&m<e&&e<f,w={};function A(e,...t){let r=w[e];if(void 0===r){const t=(0,n.sha256)(Uint8Array.from(e,(e=>e.charCodeAt(0))));r=(0,a.concatBytes)(t,t),w[e]=r}return(0,n.sha256)((0,a.concatBytes)(r,...t))}const E=e=>e.toRawBytes(!0).slice(1),_=e=>(0,a.numberToBytesBE)(e,32),S=e=>(0,o.mod)(e,l),x=e=>(0,o.mod)(e,f),T=t.secp256k1.ProjectivePoint,P=(e,t,r)=>T.BASE.multiplyAndAddUnsafe(e,t,r);function I(e){let r=t.secp256k1.utils.normPrivateKeyToScalar(e),n=T.fromPrivateKey(r);return{scalar:n.hasEvenY()?r:x(-r),bytes:E(n)}}function k(e){if(!b(e))throw new Error("bad x: need 0 < x < p");const t=S(e*e);let r=g(S(t*e+BigInt(7)));r%h!==m&&(r=S(-r));const n=new T(e,r,d);return n.assertValidity(),n}function O(...e){return x((0,a.bytesToNumberBE)(A("BIP0340/challenge",...e)))}function C(e,t,r){const n=(0,a.ensureBytes)("signature",e,64),i=(0,a.ensureBytes)("message",t),o=(0,a.ensureBytes)("publicKey",r,32);try{const e=k((0,a.bytesToNumberBE)(o)),t=(0,a.bytesToNumberBE)(n.subarray(0,32));if(!b(t))return!1;const r=(0,a.bytesToNumberBE)(n.subarray(32,64));if(!v(r))return!1;const s=O(_(t),E(e),i),c=P(e,r,x(-s));return!(!c||!c.hasEvenY()||c.toAffine().x!==t)}catch(e){return!1}}t.schnorr={getPublicKey:function(e){return I(e).bytes},sign:function(e,t,r=(0,i.randomBytes)(32)){const n=(0,a.ensureBytes)("message",e),{bytes:o,scalar:s}=I(t),c=(0,a.ensureBytes)("auxRand",r,32),u=_(s^(0,a.bytesToNumberBE)(A("BIP0340/aux",c))),l=A("BIP0340/nonce",u,o,n),f=x((0,a.bytesToNumberBE)(l));if(f===m)throw new Error("sign failed: k is zero");const{bytes:d,scalar:h}=I(f),p=O(d,o,n),g=new Uint8Array(64);if(g.set(d,0),g.set(_(x(h+p*s)),32),!C(g,n,o))throw new Error("sign: Invalid signature produced");return g},verify:C,utils:{randomPrivateKey:t.secp256k1.utils.randomPrivateKey,lift_x:k,pointToBytes:E,numberToBytesBE:a.numberToBytesBE,bytesToNumberBE:a.bytesToNumberBE,taggedHash:A,mod:o.mod}};const N=(()=>(0,c.isogenyMap)(y,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((e=>e.map((e=>BigInt(e)))))))(),R=(()=>(0,s.mapToCurveSimpleSWU)(y,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:y.create(BigInt("-11"))}))(),B=(()=>(0,c.createHasher)(t.secp256k1.ProjectivePoint,(e=>{const{x:t,y:r}=R(y.create(e[0]));return N(t,r)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:y.ORDER,m:1,k:128,expand:"xmd",hash:n.sha256}))();t.hashToCurve=B.hashToCurve,t.encodeToCurve=B.encodeToCurve},1839:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=i,t.hash=o,t.exists=s,t.output=a;const c={number:r,bool:n,bytes:i,hash:o,exists:s,output:a};t.default=c},6214:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(1839),i=r(300);class o extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){n.default.exists(this);const{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){const a=Math.min(o-this.pos,s-n);if(a!==o)r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){n.default.exists(this),n.default.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:s}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(r,0),a=0);for(let e=a;e<o;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,o-8,BigInt(8*this.length),s),this.process(r,0);const c=(0,i.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,f=this.get();if(l>f.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)c.setUint32(4*e,f[e],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.SHA2=o},2426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:s,l:a}=i(e[o],t);[r[o],n[o]]=[s,a]}return[r,n]}function s(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.fromBig=i,t.split=o,t.toBig=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0),t.add=s;const a={fromBig:i,split:o,toBig:t.toBig,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:s,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};t.default=a},4937:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},520:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const n=r(1839),i=r(300);class o extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?e.create().update(r).digest():r);for(let e=0;e<s.length;e++)s[e]^=54;this.iHash.update(s),this.oHash=e.create();for(let e=0;e<s.length;e++)s[e]^=106;this.oHash.update(s),s.fill(0)}update(e){return n.default.exists(this),this.iHash.update(e),this}digestInto(e){n.default.exists(this),n.default.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=o,t.hmac=(e,t,r)=>new o(e,t).update(r).digest(),t.hmac.create=(e,t)=>new o(e,t)},3426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const n=r(6214),i=r(300),o=(e,t,r)=>e&t^e&r^t&r,s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;c[e]=o+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:a,D:u,E:l,F:f,G:d,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,i.rotr)(l,6)^(0,i.rotr)(l,11)^(0,i.rotr)(l,25))+((p=l)&f^~p&d)+s[e]+c[e]|0,g=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,a)|0;h=d,d=f,f=l,l=u+t|0,u=a,a=n,n=r,r=t+g|0}var p;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,u=u+this.D|0,l=l+this.E|0,f=f+this.F|0,d=d+this.G|0,h=h+this.H|0,this.set(r,n,a,u,l,f,d,h)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class l extends u{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)((()=>new u)),t.sha224=(0,i.wrapConstructor)((()=>new l))},3488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;const n=r(1839),i=r(2426),o=r(300),[s,a,c]=[[],[],[]],u=BigInt(0),l=BigInt(1),f=BigInt(2),d=BigInt(7),h=BigInt(256),p=BigInt(113);for(let e=0,t=l,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],s.push(2*(5*n+r)),a.push((e+1)*(e+2)/2%64);let i=u;for(let e=0;e<7;e++)t=(t<<l^(t>>d)*p)%h,t&f&&(i^=l<<(l<<BigInt(e))-l);c.push(i)}const[g,y]=i.default.split(c,!0),m=(e,t,r)=>r>32?i.default.rotlBH(e,t,r):i.default.rotlSH(e,t,r),b=(e,t,r)=>r>32?i.default.rotlBL(e,t,r):i.default.rotlSL(e,t,r);function v(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=m(o,s,1)^r[n],c=b(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=a[r],o=m(t,i,n),c=b(t,i,n),u=s[r];t=e[u],i=e[u+1],e[u]=o,e[u+1]=c}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=g[n],e[1]^=y[n]}r.fill(0)}t.keccakP=v;class w extends o.Hash{constructor(e,t,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,o.u32)(this.state)}keccak(){v(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){n.default.exists(this);const{blockLen:t,state:r}=this,i=(e=(0,o.toBytes)(e)).length;for(let n=0;n<i;){const o=Math.min(t-this.pos,i-n);for(let t=0;t<o;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,0!=(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){n.default.exists(this,!1),n.default.bytes(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return n.default.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(n.default.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new w(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}t.Keccak=w;const A=(e,t,r)=>(0,o.wrapConstructor)((()=>new w(t,e,r)));t.sha3_224=A(6,144,28),t.sha3_256=A(6,136,32),t.sha3_384=A(6,104,48),t.sha3_512=A(6,72,64),t.keccak_224=A(1,144,28),t.keccak_256=A(1,136,32),t.keccak_384=A(1,104,48),t.keccak_512=A(1,72,64);const E=(e,t,r)=>(0,o.wrapXOFConstructorWithOpts)(((n={})=>new w(t,e,void 0===n.dkLen?r:n.dkLen,!0)));t.shake128=E(31,168,16),t.shake256=E(31,136,32)},300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(4937),i=e=>e instanceof Uint8Array;if(t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function s(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function a(e){if("string"==typeof e&&(e=s(e)),!i(e))throw new Error("expected Uint8Array, got "+typeof e);return e}t.bytesToHex=function(e){if(!i(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[t]=o}return r},t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=s,t.toBytes=a,t.concatBytes=function(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!i(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new Error("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(a(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRandomBytes=t.getRandomBytesSync=void 0;const n=r(300);t.getRandomBytesSync=function(e){return(0,n.randomBytes)(e)},t.getRandomBytes=async function(e){return(0,n.randomBytes)(e)}},101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.secp256k1=void 0;var n=r(2934);Object.defineProperty(t,"secp256k1",{enumerable:!0,get:function(){return n.secp256k1}})},5806:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const n=r(3426),i=r(144);t.sha256=(0,i.wrapHash)(n.sha256)},144:function(e,t,r){"use strict";e=r.nmd(e);var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.wrapHash=t.equalsBytes=t.hexToBytes=t.bytesToUtf8=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0;const i=n(r(1839)),o=r(300),s=i.default.bool;t.assertBool=s;const a=i.default.bytes;t.assertBytes=a;var c=r(300);Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return c.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return c.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return c.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return c.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return c.utf8ToBytes}}),t.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},t.hexToBytes=function(e){const t=e.startsWith("0x")?e.substring(2):e;return(0,o.hexToBytes)(t)},t.equalsBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},t.wrapHash=function(e){return t=>(i.default.bytes(t),e(t))},t.crypto=(()=>{const t="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,r="function"==typeof e.require&&e.require.bind(e);return{node:r&&!t?r("crypto"):void 0,web:t}})()},1538:(e,t,r)=>{"use strict";var n=r(8834).Buffer,i=r(8320),o=r(9826);function s(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function a(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var t=a(e);return new n(s(t.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return n.byteLength(e,"utf8")},isHexPrefixed:i,stripHexPrefix:o,padToEven:s,intToHex:a,fromAscii:function(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r).toString(16);t+=n.length<2?"0"+n:n}return"0x"+t},fromUtf8:function(e){return"0x"+s(new n(e,"utf8").toString("hex")).replace(/^0+|0+$/g,"")},toAscii:function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){var i=parseInt(e.substr(r,2),16);t+=String.fromCharCode(i)}return t},toUtf8:function(e){return new n(s(o(e).replace(/^0+|0+$/g,"")),"hex").toString("utf8")},getKeys:function(e,t,r){if(!Array.isArray(e))throw new Error("[ethjs-util] method getKeys expecting type Array as 'params' input, got '"+typeof e+"'");if("string"!=typeof t)throw new Error("[ethjs-util] method getKeys expecting type String for input 'key' got '"+typeof t+"'.");for(var n=[],i=0;i<e.length;i++){var o=e[i][t];if(r&&!o)o="";else if("string"!=typeof o)throw new Error("invalid abi");n.push(o)}return n},isHexString:function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}}},2699: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))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)}))},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 c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,o,s,u;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=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){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 f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=p(c,u);for(r=0;r<u;++r)n(l[r],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7847:e=>{e.exports=s,s.default=s,s.stable=l,s.stableStringify=l;var t="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var a;void 0===s&&(s=o()),c(e,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(e,t,r):JSON.stringify(e,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var u=n.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function a(e,t,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:e}),n.push([o,r,t,s])):i.push([t,r,e]):(o[r]=e,n.push([o,r,t]))}function c(e,n,i,o,s,u,l){var f;if(u+=1,"object"==typeof e&&null!==e){for(f=0;f<o.length;f++)if(o[f]===e)return void a(r,e,n,s);if(void 0!==l.depthLimit&&u>l.depthLimit)return void a(t,e,n,s);if(void 0!==l.edgesLimit&&i+1>l.edgesLimit)return void a(t,e,n,s);if(o.push(e),Array.isArray(e))for(f=0;f<e.length;f++)c(e[f],f,f,o,e,u,l);else{var d=Object.keys(e);for(f=0;f<d.length;f++){var h=d[f];c(e[h],h,f,o,e,u,l)}}o.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function l(e,t,r,s){void 0===s&&(s=o());var a,c=f(e,"",0,[],void 0,0,s)||e;try{a=0===i.length?JSON.stringify(c,t,r):JSON.stringify(c,d(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var u=n.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function f(e,i,o,s,c,l,d){var h;if(l+=1,"object"==typeof e&&null!==e){for(h=0;h<s.length;h++)if(s[h]===e)return void a(r,e,i,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==d.depthLimit&&l>d.depthLimit)return void a(t,e,i,c);if(void 0!==d.edgesLimit&&o+1>d.edgesLimit)return void a(t,e,i,c);if(s.push(e),Array.isArray(e))for(h=0;h<e.length;h++)f(e[h],h,h,s,e,l,d);else{var p={},g=Object.keys(e).sort(u);for(h=0;h<g.length;h++){var y=g[h];f(e[y],y,h,s,e,l,d),p[y]=e[y]}if(void 0===c)return p;n.push([c,i,e]),c[i]=p}s.pop()}}function d(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===t&&o[0]===r){r=o[2],i.splice(n,1);break}}return e.call(this,t,r)}}},3243:(e,t,r)=>{"use strict";var n=r(9680),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,s):"string"==typeof e?function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,s):function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,s)}},7795:e=>{"use strict";var t=Array.prototype.slice,r=Object.prototype.toString;e.exports=function(e){var n=this;if("function"!=typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i,o=t.call(arguments,1),s=Math.max(0,n.length-o.length),a=[],c=0;c<s;c++)a.push("$"+c);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var r=n.apply(this,o.concat(t.call(arguments)));return Object(r)===r?r:this}return n.apply(e,o.concat(t.call(arguments)))})),n.prototype){var u=function(){};u.prototype=n.prototype,i.prototype=new u,u.prototype=null}return i}},4090:(e,t,r)=>{"use strict";var n=r(7795);e.exports=Function.prototype.bind||n},7286:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var u=function(){throw new s},l=c?function(){try{return u}catch(e){try{return c(arguments,"callee").get}catch(e){return u}}}():u,f=r(2636)(),d=r(8486)(),h=Object.getPrototypeOf||(d?function(e){return e.__proto__}:null),p={},g="undefined"!=typeof Uint8Array&&h?h(Uint8Array):n,y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f&&h?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&h?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f&&h?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f&&h?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&h?h(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":g,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(h)try{null.error}catch(e){var m=h(h(e));y["%Error.prototype%"]=m}var b=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&h&&(r=h(i.prototype))}return y[t]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},w=r(4090),A=r(3198),E=w.call(Function.call,Array.prototype.concat),_=w.call(Function.apply,Array.prototype.splice),S=w.call(Function.call,String.prototype.replace),x=w.call(Function.call,String.prototype.slice),T=w.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,k=function(e,t){var r,n=e;if(A(v,n)&&(n="%"+(r=v[n])[0]+"%"),A(y,n)){var o=y[n];if(o===p&&(o=b(n)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=x(e,0,1),r=x(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return S(e,P,(function(e,t,r,i){n[n.length]=r?S(i,I,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",o=k("%"+n+"%",t),a=o.name,u=o.value,l=!1,f=o.alias;f&&(n=f[0],_(r,E([0,1],f)));for(var d=1,h=!0;d<r.length;d+=1){var p=r[d],g=x(p,0,1),m=x(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===m||"'"===m||"`"===m)&&g!==m)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&h||(l=!0),A(y,a="%"+(n+="."+p)+"%"))u=y[a];else if(null!=u){if(!(p in u)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&d+1>=r.length){var b=c(u,p);u=(h=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[p]}else h=A(u,p),u=u[p];h&&!l&&(y[a]=u)}}return u}},326:(e,t,r)=>{"use strict";var n=r(7286)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8486:e=>{"use strict";var t={foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof r)}},2636:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(6679);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},6679:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},7226:(e,t,r)=>{"use strict";var n=r(6679);e.exports=function(){return n()&&!!Symbol.toStringTag}},3198:(e,t,r)=>{"use strict";var n=r(4090);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4485:(e,t,r)=>{var n=t;n.utils=r(212),n.common=r(4495),n.sha=r(5530),n.ripemd=r(1396),n.hmac=r(5047),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},4495:(e,t,r)=>{"use strict";var n=r(212),i=r(9561);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},5047:(e,t,r)=>{"use strict";var n=r(212),i=r(9561);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},1396:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(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 d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,u),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],l=this.h[4],b=r,v=n,w=i,A=u,E=l,_=0;_<80;_++){var S=s(o(c(r,f(_,n,i,u),e[p[_]+t],d(_)),y[_]),l);r=l,l=u,u=o(i,10),i=n,n=S,S=s(o(c(b,f(79-_,v,w,A),e[g[_]+t],h(_)),m[_]),E),b=E,E=A,A=o(w,10),w=v,v=S}S=a(this.h[1],i,A),this.h[1]=a(this.h[2],u,E),this.h[2]=a(this.h[3],l,b),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=S},l.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],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[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]},5530:(e,t,r)=>{"use strict";t.sha1=r(5079),t.sha224=r(3823),t.sha256=r(8032),t.sha384=r(5328),t.sha512=r(168)},5079:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,l=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,l),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],l=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),g=c(s(i,5),u(p,o,l,d),h,r[n],f[p]);h=d,d=l,l=s(o,30),o=i,i=g}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},3823:(e,t,r)=>{"use strict";var n=r(212),i=r(8032);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")}},8032:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),s=r(9561),a=n.sum32,c=n.sum32_4,u=n.sum32_5,l=o.ch32,f=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,g=o.g1_256,y=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;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(b,y),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=c(g(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],y=this.h[2],m=this.h[3],b=this.h[4],v=this.h[5],w=this.h[6],A=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=u(A,h(b),l(b,v,w),this.k[n],r[n]),_=a(d(i),f(i,o,y));A=w,w=v,v=b,b=a(m,E),m=y,y=o,o=i,i=a(E,_)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],y),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],b),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],A)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5328:(e,t,r)=>{"use strict";var n=r(212),i=r(168);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")}},168:(e,t,r)=>{"use strict";var n=r(212),i=r(4495),o=r(9561),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,l=n.sum64,f=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,g=n.sum64_5_hi,y=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 A(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 _(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function S(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,m),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=(y=r[n-4],m=r[n-3],b=void 0,(b=s(y,m,19)^s(m,y,29)^c(y,m,6))<0&&(b+=4294967296),b),o=k(r[n-4],r[n-3]),a=r[n-14],u=r[n-13],l=P(r[n-30],r[n-29]),f=I(r[n-30],r[n-29]),d=r[n-32],g=r[n-31];r[n]=h(i,o,a,u,l,f,d,g),r[n+1]=p(i,o,a,u,l,f,d,g)}var y,m,b},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,i,a=this.W,c=this.h[0],u=this.h[1],h=this.h[2],p=this.h[3],m=this.h[4],b=this.h[5],v=this.h[6],P=this.h[7],I=this.h[8],k=this.h[9],O=this.h[10],C=this.h[11],N=this.h[12],R=this.h[13],B=this.h[14],M=this.h[15];o(this.k.length===a.length);for(var L=0;L<a.length;L+=2){var F=B,j=M,U=(i=void 0,(i=s(r=I,n=k,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),D=T(I,k),Z=w(I,0,O,0,N),H=A(0,k,0,C,0,R),$=this.k[L],G=this.k[L+1],z=a[L],V=a[L+1],W=g(F,j,U,D,Z,H,$,G,z,V),q=y(F,j,U,D,Z,H,$,G,z,V);F=S(c,u),j=x(c,u),U=E(c,0,h,0,m),D=_(0,u,0,p,0,b);var K=f(F,j,U,D),J=d(F,j,U,D);B=N,M=R,N=O,R=C,O=I,C=k,I=f(v,P,W,q),k=d(P,P,W,q),v=m,P=b,m=h,b=p,h=c,p=u,c=f(W,q,K,J),u=d(W,q,K,J)}l(this.h,0,c,u),l(this.h,2,h,p),l(this.h,4,m,b),l(this.h,6,v,P),l(this.h,8,I,k),l(this.h,10,O,C),l(this.h,12,N,R),l(this.h,14,B,M)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},713:(e,t,r)=>{"use strict";var n=r(212).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}},212:(e,t,r)=>{"use strict";var n=r(9561),i=r(1285);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 c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var s=e.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=c(i.toString(16))}return r},t.zero2=a,t.zero8=c,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var s=new Array(o/4),a=0,c=t;a<s.length;a++,c+=4){var u;u="big"===i?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[a]=u>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,s,a,c,u){var l=0,f=t;return l+=(f=f+n>>>0)<t?1:0,l+=(f=f+o>>>0)<o?1:0,l+=(f=f+a>>>0)<a?1:0,e+r+i+s+c+(l+=(f=f+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,s,a,c,u){return t+n+o+a+u>>>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}},8873:(e,t,r)=>{"use strict";var n=r(4485),i=r(3022),o=r(9561);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},2333:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=d,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=u}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,f=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,g=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=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+f>=1?d/c:d*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*c-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+h]=255&s,h+=p,s/=256,u-=8);e[r+h-p]|=128*g}},1285: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}}},2635:(e,t,r)=>{"use strict";var n=r(7226)(),i=r(2680)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},9680:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var d=document.all;c.call(d)===c.call(document.all)&&(f=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(u)return a(e);if(s(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},3138:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(7226)(),c=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(e);if(!c)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&c(t)}return c(e)===n}},8320:e=>{e.exports=function(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}},198:(e,t,r)=>{"use strict";var n=r(2094);e.exports=function(e){return!!n(e)}},2117:(e,t,r)=>{"use strict";var n="undefined"!=typeof JSON?JSON:r(8207),i=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},o=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},r=[];for(var n in e)t.call(e,n)&&r.push(n);return r};e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var s,a="boolean"==typeof t.cycles&&t.cycles,c=t.replacer||function(e,t){return t},u=t.cmp&&(s=t.cmp,function(e){return function(t,r){var n={key:t,value:e[t]},i={key:r,value:e[r]};return s(n,i)}}),l=[];return function e(t,s,f,d){var h=r?"\n"+new Array(d+1).join(r):"",p=r?": ":":";if(f&&f.toJSON&&"function"==typeof f.toJSON&&(f=f.toJSON()),void 0!==(f=c.call(t,s,f))){if("object"!=typeof f||null===f)return n.stringify(f);if(i(f)){for(var g=[],y=0;y<f.length;y++){var m=e(f,y,f[y],d+1)||n.stringify(null);g.push(h+r+m)}return"["+g.join(",")+h+"]"}if(-1!==l.indexOf(f)){if(a)return n.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}l.push(f);var b=o(f).sort(u&&u(f));for(g=[],y=0;y<b.length;y++){var v=e(f,s=b[y],f[s],d+1);if(v){var w=n.stringify(s)+p+v;g.push(h+r+w)}}return l.splice(l.indexOf(f),1),"{"+g.join(",")+h+"}"}}({"":e},"",e,0)}},8207:(e,t,r)=>{"use strict";t.parse=r(2890),t.stringify=r(9373)},2890:e=>{"use strict";var t,r,n,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function o(e){throw{name:"SyntaxError",message:e,at:t,text:n}}function s(e){return e&&e!==r&&o("Expected '"+e+"' instead of '"+r+"'"),r=n.charAt(t),t+=1,r}function a(){var e,t="";for("-"===r&&(t="-",s("-"));r>="0"&&r<="9";)t+=r,s();if("."===r)for(t+=".";s()&&r>="0"&&r<="9";)t+=r;if("e"===r||"E"===r)for(t+=r,s(),"-"!==r&&"+"!==r||(t+=r,s());r>="0"&&r<="9";)t+=r,s();return e=Number(t),isFinite(e)||o("Bad number"),e}function c(){var e,t,n,a="";if('"'===r)for(;s();){if('"'===r)return s(),a;if("\\"===r)if(s(),"u"===r){for(n=0,t=0;t<4&&(e=parseInt(s(),16),isFinite(e));t+=1)n=16*n+e;a+=String.fromCharCode(n)}else{if("string"!=typeof i[r])break;a+=i[r]}else a+=r}o("Bad string")}function u(){for(;r&&r<=" ";)s()}function l(){switch(u(),r){case"{":return function(){var e,t={};if("{"===r){if(s("{"),u(),"}"===r)return s("}"),t;for(;r;){if(e=c(),u(),s(":"),Object.prototype.hasOwnProperty.call(t,e)&&o('Duplicate key "'+e+'"'),t[e]=l(),u(),"}"===r)return s("}"),t;s(","),u()}}o("Bad object")}();case"[":return function(){var e=[];if("["===r){if(s("["),u(),"]"===r)return s("]"),e;for(;r;){if(e.push(l()),u(),"]"===r)return s("]"),e;s(","),u()}}o("Bad array")}();case'"':return c();case"-":return a();default:return r>="0"&&r<="9"?a():function(){switch(r){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null;default:o("Unexpected '"+r+"'")}}()}}e.exports=function(e,i){var s;return n=e,t=0,r=" ",s=l(),u(),r&&o("Syntax error"),"function"==typeof i?function e(t,r){var n,o,s=t[r];if(s&&"object"==typeof s)for(n in l)Object.prototype.hasOwnProperty.call(s,n)&&(void 0===(o=e(s,n))?delete s[n]:s[n]=o);return i.call(t,r,s)}({"":s},""):s}},9373:e=>{"use strict";var t,r,n,i=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return i.lastIndex=0,i.test(e)?'"'+e.replace(i,(function(e){var t=o[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function a(e,i){var o,c,u,l,f,d=t,h=i[e];switch(h&&"object"==typeof h&&"function"==typeof h.toJSON&&(h=h.toJSON(e)),"function"==typeof n&&(h=n.call(i,e,h)),typeof h){case"string":return s(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":return String(h);case"object":if(!h)return"null";if(t+=r,f=[],"[object Array]"===Object.prototype.toString.apply(h)){for(l=h.length,o=0;o<l;o+=1)f[o]=a(o,h)||"null";return u=0===f.length?"[]":t?"[\n"+t+f.join(",\n"+t)+"\n"+d+"]":"["+f.join(",")+"]",t=d,u}if(n&&"object"==typeof n)for(l=n.length,o=0;o<l;o+=1)"string"==typeof(c=n[o])&&(u=a(c,h))&&f.push(s(c)+(t?": ":":")+u);else for(c in h)Object.prototype.hasOwnProperty.call(h,c)&&(u=a(c,h))&&f.push(s(c)+(t?": ":":")+u);return u=0===f.length?"{}":t?"{\n"+t+f.join(",\n"+t)+"\n"+d+"}":"{"+f.join(",")+"}",t=d,u}}e.exports=function(e,i,o){var s;if(t="",r="","number"==typeof o)for(s=0;s<o;s+=1)r+=" ";else"string"==typeof o&&(r=o);if(n=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return a("",{"":e})}},9412:(e,t,r)=>{"use strict";var n=r(5484),i=n.ValidatorResult,o=n.SchemaError,s={ignoreProperties:{id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0}},a=s.validators={};function c(e,t,r,n,i){var o=t.throwError,s=t.throwAll;t.throwError=!1,t.throwAll=!1;var a=this.validateSchema(e,i,t,r);return t.throwError=o,t.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}function u(e,t){if(Object.hasOwnProperty.call(e,t))return e[t];if(t in e)for(;e=Object.getPrototypeOf(e);)if(Object.propertyIsEnumerable.call(e,t))return e[t]}function l(e,t,r,n,i,o){if(this.types.object(e)&&(!t.properties||void 0===t.properties[i]))if(!1===t.additionalProperties)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=t.additionalProperties||{};"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,i,s,r,n);var a=this.validateSchema(e[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}a.type=function(e,t,r,n){if(void 0===e)return null;var o=new i(e,t,r,n),s=Array.isArray(t.type)?t.type:[t.type];if(!s.some(this.testType.bind(this,e,t,r,n))){var a=s.map((function(e){if(e){var t=e.$id||e.id;return t?"<"+t+">":e+""}}));o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o},a.anyOf=function(e,t,r,n){if(void 0===e)return null;var s=new i(e,t,r,n),a=new i(e,t,r,n);if(!Array.isArray(t.anyOf))throw new o("anyOf must be an array");if(!t.anyOf.some(c.bind(this,e,r,n,(function(e){a.importErrors(e)})))){var u=t.anyOf.map((function(e,t){var r=e.$id||e.id;return r?"<"+r+">":e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));r.nestedErrors&&s.importErrors(a),s.addError({name:"anyOf",argument:u,message:"is not any of "+u.join(",")})}return s},a.allOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.allOf))throw new o("allOf must be an array");var s=new i(e,t,r,n),a=this;return t.allOf.forEach((function(t,i){var o=a.validateSchema(e,t,r,n);if(!o.valid){var c=t.$id||t.id||t.title&&JSON.stringify(t.title)||t.$ref&&"<"+t.$ref+">"||"[subschema "+i+"]";s.addError({name:"allOf",argument:{id:c,length:o.errors.length,valid:o},message:"does not match allOf schema "+c+" with "+o.errors.length+" error[s]:"}),s.importErrors(o)}})),s},a.oneOf=function(e,t,r,n){if(void 0===e)return null;if(!Array.isArray(t.oneOf))throw new o("oneOf must be an array");var s=new i(e,t,r,n),a=new i(e,t,r,n),u=t.oneOf.filter(c.bind(this,e,r,n,(function(e){a.importErrors(e)}))).length,l=t.oneOf.map((function(e,t){return e.$id||e.id||e.title&&JSON.stringify(e.title)||e.$ref&&"<"+e.$ref+">"||"[subschema "+t+"]"}));return 1!==u&&(r.nestedErrors&&s.importErrors(a),s.addError({name:"oneOf",argument:l,message:"is not exactly one from "+l.join(",")})),s},a.if=function(e,t,r,o){if(void 0===e)return null;if(!n.isSchema(t.if))throw new Error('Expected "if" keyword to be a schema');var s,a=c.call(this,e,r,o,null,t.if),u=new i(e,t,r,o);if(a){if(void 0===t.then)return;if(!n.isSchema(t.then))throw new Error('Expected "then" keyword to be a schema');s=this.validateSchema(e,t.then,r,o.makeChild(t.then)),u.importErrors(s)}else{if(void 0===t.else)return;if(!n.isSchema(t.else))throw new Error('Expected "else" keyword to be a schema');s=this.validateSchema(e,t.else,r,o.makeChild(t.else)),u.importErrors(s)}return u},a.propertyNames=function(e,t,r,s){if(this.types.object(e)){var a=new i(e,t,r,s),c=void 0!==t.propertyNames?t.propertyNames:{};if(!n.isSchema(c))throw new o('Expected "propertyNames" to be a schema (object or boolean)');for(var l in e)if(void 0!==u(e,l)){var f=this.validateSchema(l,c,r,s.makeChild(c));a.importErrors(f)}return a}},a.properties=function(e,t,r,n){if(this.types.object(e)){var s=new i(e,t,r,n),a=t.properties||{};for(var c in a){var l=a[c];if(void 0!==l){if(null===l)throw new o('Unexpected null, expected schema in "properties"');"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,c,l,r,n);var f=u(e,c),d=this.validateSchema(f,l,r,n.makeChild(l,c));d.instance!==s.instance[c]&&(s.instance[c]=d.instance),s.importErrors(d)}}return s}},a.patternProperties=function(e,t,r,n){if(this.types.object(e)){var s=new i(e,t,r,n),a=t.patternProperties||{};for(var c in e){var u=!0;for(var f in a){var d=a[f];if(void 0!==d){if(null===d)throw new o('Unexpected null, expected schema in "patternProperties"');try{var h=new RegExp(f,"u")}catch(e){h=new RegExp(f)}if(h.test(c)){u=!1,"function"==typeof r.preValidateProperty&&r.preValidateProperty(e,c,d,r,n);var p=this.validateSchema(e[c],d,r,n.makeChild(d,c));p.instance!==s.instance[c]&&(s.instance[c]=p.instance),s.importErrors(p)}}}u&&l.call(this,e,t,r,n,c,s)}return s}},a.additionalProperties=function(e,t,r,n){if(this.types.object(e)){if(t.patternProperties)return null;var o=new i(e,t,r,n);for(var s in e)l.call(this,e,t,r,n,s,o);return o}},a.minProperties=function(e,t,r,n){if(this.types.object(e)){var o=new i(e,t,r,n);return Object.keys(e).length>=t.minProperties||o.addError({name:"minProperties",argument:t.minProperties,message:"does not meet minimum property length of "+t.minProperties}),o}},a.maxProperties=function(e,t,r,n){if(this.types.object(e)){var o=new i(e,t,r,n);return Object.keys(e).length<=t.maxProperties||o.addError({name:"maxProperties",argument:t.maxProperties,message:"does not meet maximum property length of "+t.maxProperties}),o}},a.items=function(e,t,r,n){var o=this;if(this.types.array(e)&&void 0!==t.items){var s=new i(e,t,r,n);return e.every((function(e,i){if(Array.isArray(t.items))var a=void 0===t.items[i]?t.additionalItems:t.items[i];else a=t.items;if(void 0===a)return!0;if(!1===a)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var c=o.validateSchema(e,a,r,n.makeChild(a,i));return c.instance!==s.instance[i]&&(s.instance[i]=c.instance),s.importErrors(c),!0})),s}},a.contains=function(e,t,r,o){var s=this;if(this.types.array(e)&&void 0!==t.contains){if(!n.isSchema(t.contains))throw new Error('Expected "contains" keyword to be a schema');var a=new i(e,t,r,o);return!1===e.some((function(e,n){return 0===s.validateSchema(e,t.contains,r,o.makeChild(t.contains,n)).errors.length}))&&a.addError({name:"contains",argument:t.contains,message:"must contain an item matching given schema"}),a}},a.minimum=function(e,t,r,n){if(this.types.number(e)){var o=new i(e,t,r,n);return t.exclusiveMinimum&&!0===t.exclusiveMinimum?e>t.minimum||o.addError({name:"minimum",argument:t.minimum,message:"must be greater than "+t.minimum}):e>=t.minimum||o.addError({name:"minimum",argument:t.minimum,message:"must be greater than or equal to "+t.minimum}),o}},a.maximum=function(e,t,r,n){if(this.types.number(e)){var o=new i(e,t,r,n);return t.exclusiveMaximum&&!0===t.exclusiveMaximum?e<t.maximum||o.addError({name:"maximum",argument:t.maximum,message:"must be less than "+t.maximum}):e<=t.maximum||o.addError({name:"maximum",argument:t.maximum,message:"must be less than or equal to "+t.maximum}),o}},a.exclusiveMinimum=function(e,t,r,n){if("boolean"!=typeof t.exclusiveMinimum&&this.types.number(e)){var o=new i(e,t,r,n);return e>t.exclusiveMinimum||o.addError({name:"exclusiveMinimum",argument:t.exclusiveMinimum,message:"must be strictly greater than "+t.exclusiveMinimum}),o}},a.exclusiveMaximum=function(e,t,r,n){if("boolean"!=typeof t.exclusiveMaximum&&this.types.number(e)){var o=new i(e,t,r,n);return e<t.exclusiveMaximum||o.addError({name:"exclusiveMaximum",argument:t.exclusiveMaximum,message:"must be strictly less than "+t.exclusiveMaximum}),o}};var f=function(e,t,r,s,a,c){if(this.types.number(e)){var u=t[a];if(0==u)throw new o(a+" cannot be zero");var l=new i(e,t,r,s),f=n.getDecimalPlaces(e),d=n.getDecimalPlaces(u),h=Math.max(f,d),p=Math.pow(10,h);return Math.round(e*p)%Math.round(u*p)!=0&&l.addError({name:a,argument:u,message:c+JSON.stringify(u)}),l}};function d(e,t,r){var i,o=r.length;for(i=t+1;i<o;i++)if(n.deepCompareStrict(e,r[i]))return!1;return!0}a.multipleOf=function(e,t,r,n){return f.call(this,e,t,r,n,"multipleOf","is not a multiple of (divisible by) ")},a.divisibleBy=function(e,t,r,n){return f.call(this,e,t,r,n,"divisibleBy","is not divisible by (multiple of) ")},a.required=function(e,t,r,n){var o=new i(e,t,r,n);return void 0===e&&!0===t.required?o.addError({name:"required",message:"is required"}):this.types.object(e)&&Array.isArray(t.required)&&t.required.forEach((function(t){void 0===u(e,t)&&o.addError({name:"required",argument:t,message:"requires property "+JSON.stringify(t)})})),o},a.pattern=function(e,t,r,n){if(this.types.string(e)){var o=new i(e,t,r,n),s=t.pattern;try{var a=new RegExp(s,"u")}catch(e){a=new RegExp(s)}return e.match(a)||o.addError({name:"pattern",argument:t.pattern,message:"does not match pattern "+JSON.stringify(t.pattern.toString())}),o}},a.format=function(e,t,r,o){if(void 0!==e){var s=new i(e,t,r,o);return s.disableFormat||n.isFormat(e,t.format,this)||s.addError({name:"format",argument:t.format,message:"does not conform to the "+JSON.stringify(t.format)+" format"}),s}},a.minLength=function(e,t,r,n){if(this.types.string(e)){var o=new i(e,t,r,n),s=e.match(/[\uDC00-\uDFFF]/g);return e.length-(s?s.length:0)>=t.minLength||o.addError({name:"minLength",argument:t.minLength,message:"does not meet minimum length of "+t.minLength}),o}},a.maxLength=function(e,t,r,n){if(this.types.string(e)){var o=new i(e,t,r,n),s=e.match(/[\uDC00-\uDFFF]/g);return e.length-(s?s.length:0)<=t.maxLength||o.addError({name:"maxLength",argument:t.maxLength,message:"does not meet maximum length of "+t.maxLength}),o}},a.minItems=function(e,t,r,n){if(this.types.array(e)){var o=new i(e,t,r,n);return e.length>=t.minItems||o.addError({name:"minItems",argument:t.minItems,message:"does not meet minimum length of "+t.minItems}),o}},a.maxItems=function(e,t,r,n){if(this.types.array(e)){var o=new i(e,t,r,n);return e.length<=t.maxItems||o.addError({name:"maxItems",argument:t.maxItems,message:"does not meet maximum length of "+t.maxItems}),o}},a.uniqueItems=function(e,t,r,n){if(!0===t.uniqueItems&&this.types.array(e)){var o=new i(e,t,r,n);return e.every(d)||o.addError({name:"uniqueItems",message:"contains duplicate item"}),o}},a.dependencies=function(e,t,r,n){if(this.types.object(e)){var o=new i(e,t,r,n);for(var s in t.dependencies)if(void 0!==e[s]){var a=t.dependencies[s],c=n.makeChild(a,s);if("string"==typeof a&&(a=[a]),Array.isArray(a))a.forEach((function(t){void 0===e[t]&&o.addError({name:"dependencies",argument:c.propertyPath,message:"property "+t+" not found, required by "+c.propertyPath})}));else{var u=this.validateSchema(e,a,r,c);o.instance!==u.instance&&(o.instance=u.instance),u&&u.errors.length&&(o.addError({name:"dependencies",argument:c.propertyPath,message:"does not meet dependency required by "+c.propertyPath}),o.importErrors(u))}}return o}},a.enum=function(e,t,r,s){if(void 0===e)return null;if(!Array.isArray(t.enum))throw new o("enum expects an array",t);var a=new i(e,t,r,s);return t.enum.some(n.deepCompareStrict.bind(null,e))||a.addError({name:"enum",argument:t.enum,message:"is not one of enum values: "+t.enum.map(String).join(",")}),a},a.const=function(e,t,r,o){if(void 0===e)return null;var s=new i(e,t,r,o);return n.deepCompareStrict(t.const,e)||s.addError({name:"const",argument:t.const,message:"does not exactly match expected constant: "+t.const}),s},a.not=a.disallow=function(e,t,r,n){var o=this;if(void 0===e)return null;var s=new i(e,t,r,n),a=t.not||t.disallow;return a?(Array.isArray(a)||(a=[a]),a.forEach((function(i){if(o.testType(e,t,r,n,i)){var a=i&&(i.$id||i.id)||i;s.addError({name:"not",argument:a,message:"is of prohibited type "+a})}})),s):null},e.exports=s},5484:(e,t,r)=>{"use strict";var n=r(883),i=t.ValidationError=function(e,t,r,n,i,o){if(Array.isArray(n)?(this.path=n,this.property=n.reduce((function(e,t){return e+f(t)}),"instance")):void 0!==n&&(this.property=n),e&&(this.message=e),r){var s=r.$id||r.id;this.schema=s||r}void 0!==t&&(this.instance=t),this.name=i,this.argument=o,this.stack=this.toString()};i.prototype.toString=function(){return this.property+" "+this.message};var o=t.ValidatorResult=function(e,t,r,n){this.instance=e,this.schema=t,this.options=r,this.path=n.path,this.propertyPath=n.propertyPath,this.errors=[],this.throwError=r&&r.throwError,this.throwFirst=r&&r.throwFirst,this.throwAll=r&&r.throwAll,this.disableFormat=r&&!0===r.disableFormat};function s(e,t){return t+": "+e.toString()+"\n"}function a(e){Error.captureStackTrace&&Error.captureStackTrace(this,a),this.instance=e.instance,this.schema=e.schema,this.options=e.options,this.errors=e.errors}o.prototype.addError=function(e){var t;if("string"==typeof e)t=new i(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");t=new i(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(t),this.throwFirst)throw new a(this);if(this.throwError)throw t;return t},o.prototype.importErrors=function(e){"string"==typeof e||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))},o.prototype.toString=function(e){return this.errors.map(s).join("")},Object.defineProperty(o.prototype,"valid",{get:function(){return!this.errors.length}}),e.exports.ValidatorResultError=a,a.prototype=new Error,a.prototype.constructor=a,a.prototype.name="Validation Error";var c=t.SchemaError=function e(t,r){this.message=t,this.schema=r,Error.call(this,t),Error.captureStackTrace(this,e)};c.prototype=Object.create(Error.prototype,{constructor:{value:c,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var u=t.SchemaContext=function(e,t,r,n,i){this.schema=e,this.options=t,Array.isArray(r)?(this.path=r,this.propertyPath=r.reduce((function(e,t){return e+f(t)}),"instance")):this.propertyPath=r,this.base=n,this.schemas=i};u.prototype.resolve=function(e){return n.resolve(this.base,e)},u.prototype.makeChild=function(e,t){var r=void 0===t?this.path:this.path.concat([t]),i=e.$id||e.id,o=n.resolve(this.base,i||""),s=new u(e,this.options,r,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var l=t.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(e){return"string"==typeof e&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)},regex:function(e){var t=!0;try{new RegExp(e)}catch(e){t=!1}return t},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};l.regexp=l.regex,l.pattern=l.regex,l.ipv4=l["ip-address"],t.isFormat=function(e,t,r){if("string"==typeof e&&void 0!==l[t]){if(l[t]instanceof RegExp)return l[t].test(e);if("function"==typeof l[t])return l[t](e)}else if(r&&r.customFormats&&"function"==typeof r.customFormats[t])return r.customFormats[t](e);return!0};var f=t.makeSuffix=function(e){return(e=e.toString()).match(/[.\s\[\]]/)||e.match(/^[\d]/)?e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]":"."+e};function d(e,t,r,n){"object"==typeof r?t[n]=g(e[n],r):-1===e.indexOf(r)&&t.push(r)}function h(e,t,r){t[r]=e[r]}function p(e,t,r,n){"object"==typeof t[n]&&t[n]&&e[n]?r[n]=g(e[n],t[n]):r[n]=t[n]}function g(e,t){var r=Array.isArray(t),n=r&&[]||{};return r?(e=e||[],n=n.concat(e),t.forEach(d.bind(null,e,n))):(e&&"object"==typeof e&&Object.keys(e).forEach(h.bind(null,e,n)),Object.keys(t).forEach(p.bind(null,e,t,n))),n}function y(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}t.deepCompareStrict=function e(t,r){if(typeof t!=typeof r)return!1;if(Array.isArray(t))return!!Array.isArray(r)&&t.length===r.length&&t.every((function(n,i){return e(t[i],r[i])}));if("object"==typeof t){if(!t||!r)return t===r;var n=Object.keys(t),i=Object.keys(r);return n.length===i.length&&n.every((function(n){return e(t[n],r[n])}))}return t===r},e.exports.deepMerge=g,t.objectGetPath=function(e,t){for(var r,n=t.split("/").slice(1);"string"==typeof(r=n.shift());){var i=decodeURIComponent(r.replace(/~0/,"~").replace(/~1/g,"/"));if(!(i in e))return;e=e[i]}return e},t.encodePath=function(e){return e.map(y).join("")},t.getDecimalPlaces=function(e){var t=0;if(isNaN(e))return t;"number"!=typeof e&&(e=Number(e));var r=e.toString().split("e");if(2===r.length){if("-"!==r[1][0])return t;t=Number(r[1].slice(1))}var n=r[0].split(".");return 2===n.length&&(t+=n[1].length),t},t.isSchema=function(e){return"object"==typeof e&&e||"boolean"==typeof e}},663:(e,t,r)=>{"use strict";var n=r(9852);r(5484).ValidatorResult,r(5484).ValidatorResultError,r(5484).ValidationError,r(5484).SchemaError,r(151),r(151).R,e.exports.G=function(e,t,r){return(new n).validate(e,t,r)}},151:(e,t,r)=>{"use strict";var n=r(883),i=r(5484);function o(e,t){this.id=e,this.ref=t}e.exports.R=function(e,t){function r(e,t){if(t&&"object"==typeof t)if(t.$ref){var o=n.resolve(e,t.$ref);u[o]=u[o]?u[o]+1:0}else{var l=t.$id||t.id,f=l?n.resolve(e,l):e;if(f){if(f.indexOf("#")<0&&(f+="#"),c[f]){if(!i.deepCompareStrict(c[f],t))throw new Error("Schema <"+f+"> already exists with different definition");return c[f]}c[f]=t,"#"==f[f.length-1]&&(c[f.substring(0,f.length-1)]=t)}s(f+"/items",Array.isArray(t.items)?t.items:[t.items]),s(f+"/extends",Array.isArray(t.extends)?t.extends:[t.extends]),r(f+"/additionalItems",t.additionalItems),a(f+"/properties",t.properties),r(f+"/additionalProperties",t.additionalProperties),a(f+"/definitions",t.definitions),a(f+"/patternProperties",t.patternProperties),a(f+"/dependencies",t.dependencies),s(f+"/disallow",t.disallow),s(f+"/allOf",t.allOf),s(f+"/anyOf",t.anyOf),s(f+"/oneOf",t.oneOf),r(f+"/not",t.not)}}function s(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)r(e+"/"+n,t[n])}function a(e,t){if(t&&"object"==typeof t)for(var n in t)r(e+"/"+n,t[n])}var c={},u={};return r(e,t),new o(c,u)}},9852:(e,t,r)=>{"use strict";var n=r(883),i=r(9412),o=r(5484),s=r(151).R,a=o.ValidatorResult,c=o.ValidatorResultError,u=o.SchemaError,l=o.SchemaContext,f=function e(){this.customFormats=Object.create(e.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(h),this.attributes=Object.create(i.validators)};function d(e){var t="string"==typeof e?e:e.$ref;return"string"==typeof t&&t}f.prototype.customFormats={},f.prototype.schemas=null,f.prototype.types=null,f.prototype.attributes=null,f.prototype.unresolvedRefs=null,f.prototype.addSchema=function(e,t){var r=this;if(!e)return null;var n=s(t||"/",e),i=t||e.$id||e.id;for(var o in n.id)this.schemas[o]=n.id[o];for(var o in n.ref)this.unresolvedRefs.push(o);return this.unresolvedRefs=this.unresolvedRefs.filter((function(e){return void 0===r.schemas[e]})),this.schemas[i]},f.prototype.addSubSchemaArray=function(e,t){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addSubSchema(e,t[r])},f.prototype.addSubSchemaObject=function(e,t){if(t&&"object"==typeof t)for(var r in t)this.addSubSchema(e,t[r])},f.prototype.setSchemas=function(e){this.schemas=e},f.prototype.getSchema=function(e){return this.schemas[e]},f.prototype.validate=function(e,t,r,i){if("boolean"!=typeof t&&"object"!=typeof t||null===t)throw new u("Expected `schema` to be an object or boolean");r||(r={});var o,f=t.$id||t.id,d=n.resolve(r.base||"/",f||"");if(!i){(i=new l(t,r,[],d,Object.create(this.schemas))).schemas[d]||(i.schemas[d]=t);var h=s(d,t);for(var p in h.id){var g=h.id[p];i.schemas[p]=g}}if(r.required&&void 0===e)return(o=new a(e,t,r,i)).addError("is required, but is undefined"),o;if(!(o=this.validateSchema(e,t,r,i)))throw new Error("Result undefined");if(r.throwAll&&o.errors.length)throw new c(o);return o},f.prototype.validateSchema=function(e,t,r,n){var s=new a(e,t,r,n);if("boolean"==typeof t)!0===t?t={}:!1===t&&(t={type:[]});else if(!t)throw new Error("schema is undefined");if(t.extends)if(Array.isArray(t.extends)){var c={schema:t,ctx:n};t.extends.forEach(this.schemaTraverser.bind(this,c)),t=c.schema,c.schema=null,c.ctx=null,c=null}else t=o.deepMerge(t,this.superResolve(t.extends,n));var f=d(t);if(f){var h=this.resolve(t,f,n),p=new l(h.subschema,r,n.path,h.switchSchema,n.schemas);return this.validateSchema(e,h.subschema,r,p)}var g=r&&r.skipAttributes||[];for(var y in t)if(!i.ignoreProperties[y]&&g.indexOf(y)<0){var m=null,b=this.attributes[y];if(b)m=b.call(this,e,t,r,n);else if(!1===r.allowUnknownAttributes)throw new u("Unsupported attribute: "+y,t);m&&s.importErrors(m)}if("function"==typeof r.rewrite){var v=r.rewrite.call(this,e,t,r,n);s.instance=v}return s},f.prototype.schemaTraverser=function(e,t){e.schema=o.deepMerge(e.schema,this.superResolve(t,e.ctx))},f.prototype.superResolve=function(e,t){var r=d(e);return r?this.resolve(e,r,t).subschema:e},f.prototype.resolve=function(e,t,r){if(t=r.resolve(t),r.schemas[t])return{subschema:r.schemas[t],switchSchema:t};var i=n.parse(t),s=i&&i.hash,a=s&&s.length&&t.substr(0,t.length-s.length);if(!a||!r.schemas[a])throw new u("no such schema <"+t+">",e);var c=o.objectGetPath(r.schemas[a],s.substr(1));if(void 0===c)throw new u("no such schema "+s+" located in <"+a+">",e);return{subschema:c,switchSchema:t}},f.prototype.testType=function(e,t,r,n,i){if(void 0!==i){if(null===i)throw new u('Unexpected null in "type" keyword');if("function"==typeof this.types[i])return this.types[i].call(this,e);if(i&&"object"==typeof i){var o=this.validateSchema(e,i,r,n);return void 0===o||!(o&&o.errors.length)}return!0}};var h=f.prototype.types={};h.string=function(e){return"string"==typeof e},h.number=function(e){return"number"==typeof e&&isFinite(e)},h.integer=function(e){return"number"==typeof e&&e%1==0},h.boolean=function(e){return"boolean"==typeof e},h.array=function(e){return Array.isArray(e)},h.null=function(e){return null===e},h.date=function(e){return e instanceof Date},h.any=function(e){return!0},h.object=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof Date)},e.exports=f},1344:(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",s="[object AsyncFunction]",a="[object Function]",c="[object GeneratorFunction]",u="[object Null]",l="[object Object]",f="[object Proxy]",d="[object Undefined]",h=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[o]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[a]=g["[object Map]"]=g["[object Number]"]=g[l]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var y,m,b,v="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,w="object"==typeof self&&self&&self.Object===Object&&self,A=v||w||Function("return this")(),E=t&&!t.nodeType&&t,_=E&&e&&!e.nodeType&&e,S=_&&_.exports===E,x=S&&v.process,T=function(){try{return _&&_.require&&_.require("util").types||x&&x.binding&&x.binding("util")}catch(e){}}(),P=T&&T.isTypedArray,I=Array.prototype,k=Function.prototype,O=Object.prototype,C=A["__core-js_shared__"],N=k.toString,R=O.hasOwnProperty,B=(y=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",M=O.toString,L=N.call(Object),F=RegExp("^"+N.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=S?A.Buffer:void 0,U=A.Symbol,D=A.Uint8Array,Z=(j&&j.allocUnsafe,m=Object.getPrototypeOf,b=Object,function(e){return m(b(e))}),H=Object.create,$=O.propertyIsEnumerable,G=I.splice,z=U?U.toStringTag:void 0,V=function(){try{var e=de(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),W=j?j.isBuffer:void 0,q=Math.max,K=Date.now,J=de(A,"Map"),Y=de(Object,"create"),Q=function(){function e(){}return function(t){if(!Se(t))return{};if(H)return H(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function X(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ee(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function te(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function re(e){var t=this.__data__=new ee(e);this.size=t.size}function ne(e,t,r){(void 0!==r&&!me(e[t],r)||void 0===r&&!(t in e))&&se(e,t,r)}function ie(e,t,r){var n=e[t];R.call(e,t)&&me(n,r)&&(void 0!==r||t in e)||se(e,t,r)}function oe(e,t){for(var r=e.length;r--;)if(me(e[r][0],t))return r;return-1}function se(e,t,r){"__proto__"==t&&V?V(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}X.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},X.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},X.prototype.get=function(e){var t=this.__data__;if(Y){var r=t[e];return r===n?void 0:r}return R.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return Y?void 0!==t[e]:R.call(t,e)},X.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Y&&void 0===t?n:t,this},ee.prototype.clear=function(){this.__data__=[],this.size=0},ee.prototype.delete=function(e){var t=this.__data__,r=oe(t,e);return!(r<0||(r==t.length-1?t.pop():G.call(t,r,1),--this.size,0))},ee.prototype.get=function(e){var t=this.__data__,r=oe(t,e);return r<0?void 0:t[r][1]},ee.prototype.has=function(e){return oe(this.__data__,e)>-1},ee.prototype.set=function(e,t){var r=this.__data__,n=oe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},te.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(J||ee),string:new X}},te.prototype.delete=function(e){var t=fe(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return fe(this,e).get(e)},te.prototype.has=function(e){return fe(this,e).has(e)},te.prototype.set=function(e,t){var r=fe(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},re.prototype.clear=function(){this.__data__=new ee,this.size=0},re.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},re.prototype.get=function(e){return this.__data__.get(e)},re.prototype.has=function(e){return this.__data__.has(e)},re.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ee){var n=r.__data__;if(!J||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new te(n)}return r.set(e,t),this.size=r.size,this};function ae(e){return null==e?void 0===e?d:u:z&&z in Object(e)?function(e){var t=R.call(e,z),r=e[z];try{e[z]=void 0;var n=!0}catch(e){}var i=M.call(e);return n&&(t?e[z]=r:delete e[z]),i}(e):function(e){return M.call(e)}(e)}function ce(e){return xe(e)&&ae(e)==o}function ue(e,t,r,n,i){e!==t&&function(e,t,r){for(var n=-1,i=Object(e),o=r(e),s=o.length;s--;){var a=o[++n];if(!1===t(i[a],a,i))break}}(t,(function(o,s){if(i||(i=new re),Se(o))!function(e,t,r,n,i,o,s){var a=ge(e,r),c=ge(t,r),u=s.get(c);if(u)ne(e,r,u);else{var f,d,h,p,g,y=o?o(a,c,r+"",e,t,s):void 0,m=void 0===y;if(m){var b=ve(c),v=!b&&Ae(c),w=!b&&!v&&Te(c);y=c,b||v||w?ve(a)?y=a:xe(g=a)&&we(g)?y=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(a):v?(m=!1,y=function(e,t){return e.slice()}(c)):w?(m=!1,p=new(h=(f=c).buffer).constructor(h.byteLength),new D(p).set(new D(h)),d=p,y=new f.constructor(d,f.byteOffset,f.length)):y=[]:function(e){if(!xe(e)||ae(e)!=l)return!1;var t=Z(e);if(null===t)return!0;var r=R.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&N.call(r)==L}(c)||be(c)?(y=a,be(a)?y=function(e){return function(e,t,r,n){var i=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var a=t[o],c=void 0;void 0===c&&(c=e[a]),i?se(r,a,c):ie(r,a,c)}return r}(e,Pe(e))}(a):Se(a)&&!Ee(a)||(y=function(e){return"function"!=typeof e.constructor||pe(e)?{}:Q(Z(e))}(c))):m=!1}m&&(s.set(c,y),i(y,c,n,o,s),s.delete(c)),ne(e,r,y)}}(e,t,s,r,ue,n,i);else{var a=n?n(ge(e,s),o,s+"",e,t,i):void 0;void 0===a&&(a=o),ne(e,s,a)}}),Pe)}var le=V?function(e,t){return V(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:Oe;function fe(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function de(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Se(e)||function(e){return!!B&&B in e}(e))&&(Ee(e)?F:h).test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(r)?r:void 0}function he(e,t){var r=typeof e;return!!(t=null==t?i:t)&&("number"==r||"symbol"!=r&&p.test(e))&&e>-1&&e%1==0&&e<t}function pe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||O)}function ge(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ye=function(e){var t=0,r=0;return function(){var n=K(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(le);function me(e,t){return e===t||e!=e&&t!=t}var be=ce(function(){return arguments}())?ce:function(e){return xe(e)&&R.call(e,"callee")&&!$.call(e,"callee")},ve=Array.isArray;function we(e){return null!=e&&_e(e.length)&&!Ee(e)}var Ae=W||function(){return!1};function Ee(e){if(!Se(e))return!1;var t=ae(e);return t==a||t==c||t==s||t==f}function _e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Se(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var Te=P?function(e){return function(t){return e(t)}}(P):function(e){return xe(e)&&_e(e.length)&&!!g[ae(e)]};function Pe(e){return we(e)?function(e,t){var r=ve(e),n=!r&&be(e),i=!r&&!n&&Ae(e),o=!r&&!n&&!i&&Te(e),s=r||n||i||o,a=s?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=a.length;for(var u in e)!t&&!R.call(e,u)||s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||he(u,c))||a.push(u);return a}(e,!0):function(e){if(!Se(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=pe(e),r=[];for(var n in e)("constructor"!=n||!t&&R.call(e,n))&&r.push(n);return r}(e)}var Ie,ke=(Ie=function(e,t,r){ue(e,t,r)},function(e,t){return ye(function(e,t,r){return t=q(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=q(n.length-t,0),s=Array(o);++i<o;)s[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=r(s),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,a)}}(e,t,Oe),e+"")}((function(e,t){var r=-1,n=t.length,i=n>1?t[n-1]:void 0,o=n>2?t[2]:void 0;for(i=Ie.length>3&&"function"==typeof i?(n--,i):void 0,o&&function(e,t,r){if(!Se(r))return!1;var n=typeof t;return!!("number"==n?we(r)&&he(t,r.length):"string"==n&&t in r)&&me(r[t],e)}(t[0],t[1],o)&&(i=n<3?void 0:i,n=1),e=Object(e);++r<n;){var s=t[r];s&&Ie(e,s,r)}return e})));function Oe(e){return e}e.exports=ke},9640:function(e,t,r){var n,i;!function(o,s){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function i(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(t,r){for(var i=0;i<n.length;i++){var o=n[i];this[o]=i<t?e:this.methodFactory(o,t,r)}this.log=this.debug}function a(e,r,n){return function(){typeof console!==t&&(s.call(this,r,n),this[e].apply(this,arguments))}}function c(n,s,c){return function(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&r?o:void 0!==console[n]?i(console,n):void 0!==console.log?i(console,"log"):e)}(n)||a.apply(this,arguments)}function u(e,r,i){var o,a=this;r=null==r?"WARN":r;var u="loglevel";function l(){var e;if(typeof window!==t&&u){try{e=window.localStorage[u]}catch(e){}if(typeof e===t)try{var r=window.document.cookie,n=r.indexOf(encodeURIComponent(u)+"=");-1!==n&&(e=/^([^;]+)/.exec(r.slice(n))[1])}catch(e){}return void 0===a.levels[e]&&(e=void 0),e}}"string"==typeof e?u+=":"+e:"symbol"==typeof e&&(u=void 0),a.name=e,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=i||c,a.getLevel=function(){return o},a.setLevel=function(r,i){if("string"==typeof r&&void 0!==a.levels[r.toUpperCase()]&&(r=a.levels[r.toUpperCase()]),!("number"==typeof r&&r>=0&&r<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(o=r,!1!==i&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&u){try{return void(window.localStorage[u]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(u)+"="+r+";"}catch(e){}}}(r),s.call(a,r,e),typeof console===t&&r<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(e){r=e,l()||a.setLevel(e,!1)},a.resetLevel=function(){a.setLevel(r,!1),function(){if(typeof window!==t&&u){try{return void window.localStorage.removeItem(u)}catch(e){}try{window.document.cookie=encodeURIComponent(u)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},a.enableAll=function(e){a.setLevel(a.levels.TRACE,e)},a.disableAll=function(e){a.setLevel(a.levels.SILENT,e)};var f=l();null==f&&(f=r),a.setLevel(f,!1)}var l=new u,f={};l.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=f[e];return t||(t=f[e]=new u(e,l.getLevel(),l.methodFactory)),t};var d=typeof window!==t?window.log:void 0;return l.noConflict=function(){return typeof window!==t&&window.log===l&&(window.log=d),l},l.getLoggers=function(){return f},l.default=l,l},void 0===(i=n.call(t,r,t,e))||(e.exports=i)}()},2973:(e,t,r)=>{"use strict";var n=r(8834).Buffer,i=r(4406);Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidStatusCodeError=t.InvalidCertError=void 0;const o=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class s extends Error{constructor(e,t){super(e),this.fingerprint256=t}}t.InvalidCertError=s;class a extends Error{constructor(e){super(`Request Failed. Status Code: ${e}`),this.statusCode=e}}function c(e,t){if(!t||"text"===t||"json"===t)try{let r=new TextDecoder("utf8",{fatal:!0}).decode(e);if("text"===t)return r;try{return JSON.parse(r)}catch(e){if("json"===t)throw e;return r}}catch(e){if("text"===t||"json"===t)throw e}return e}t.InvalidStatusCodeError=a;let u={};function l(e,t){let i={...o,...t};const f=r(732),d=r(6312),h=r(4087),{promisify:p}=r(3335),{resolve:g}=r(883),y=!!/^https/.test(e);let m={method:i.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const b=e=>e.replace(/:| /g,"").toLowerCase();if(i.keepAlive){const e={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},t=[y,y&&i.sslPinnedCertificates?.map((e=>b(e))).sort()].join();m.agent=u[t]||(u[t]=new(y?d:f).Agent(e))}return"json"===i.type&&(m.headers["Content-Type"]="application/json"),i.data&&(i.method||(m.method="POST"),m.body="json"===i.type?JSON.stringify(i.data):i.data),m.headers={...m.headers,...i.headers},i.sslAllowSelfSigned&&(m.rejectUnauthorized=!1),new Promise(((t,r)=>{const o=async t=>{if(t&&"DEPTH_ZERO_SELF_SIGNED_CERT"===t.code)try{await l(e,{...i,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(e){e&&e.fingerprint256&&(t=new s(`Self-signed SSL certificate: ${e.fingerprint256}`,e.fingerprint256))}r(t)},u=(y?d:f).request(e,m,(s=>{s.on("error",o),(async()=>{try{t(await(async t=>{const r=t.statusCode;if(i.redirect&&300<=r&&r<400&&t.headers.location){if(10==i._redirectCount)throw new Error("Request failed. Too much redirects.");return i._redirectCount+=1,await l(g(e,t.headers.location),i)}if(i.expectStatusCode&&r!==i.expectStatusCode)throw t.resume(),new a(r);let o=[];for await(const e of t)o.push(e);let s=n.concat(o);const u=t.headers["content-encoding"];"br"===u&&(s=await p(h.brotliDecompress)(s)),"gzip"!==u&&"deflate"!==u||(s=await p(h.unzip)(s));const f=c(s,i.type);return i.full?{headers:t.headers,status:r,body:f}:f})(s))}catch(e){r(e)}})()}));u.on("error",o);const v=i.sslPinnedCertificates?.map((e=>b(e))),w=e=>{const t=b(e.getPeerCertificate()?.fingerprint256||"");if((t||!e.isSessionReused())&&!v.includes(t))return u.emit("error",new s(`Invalid SSL certificate: ${t} Expected: ${v}`,t)),u.abort()};i.sslPinnedCertificates&&u.on("socket",(e=>{e.listeners("secureConnect").map((e=>(e.name||"").replace("bound ",""))).includes("mfetchSecureConnect")||e.on("secureConnect",w.bind(null,e))})),i.keepAlive&&u.setNoDelay(!0),m.body&&u.write(m.body),u.end()}))}const f=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map((e=>e.toLowerCase()))),d=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map((e=>e.toLowerCase())));async function h(e,t){let r={...o,...t};const n=new Headers;"json"===r.type&&n.set("Content-Type","application/json");let i=new URL(e);if(i.username){const e=btoa(`${i.username}:${i.password}`);n.set("Authorization",`Basic ${e}`),i.username="",i.password=""}e=""+i;for(let e in r.headers){const t=e.toLowerCase();(f.has(t)||r.cors&&!d.has(t))&&n.set(e,r.headers[e])}let s={headers:n,redirect:r.redirect?"follow":"manual"};r.referrer||(s.referrerPolicy="no-referrer"),r.cors&&(s.mode="cors"),r.data&&(r.method||(s.method="POST"),s.body="json"===r.type?JSON.stringify(r.data):r.data);const u=await fetch(e,s);if(r.expectStatusCode&&u.status!==r.expectStatusCode)throw new a(u.status);const l=c(new Uint8Array(await u.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(u.headers.entries()),status:u.status,body:l}:l}const p=!!("object"==typeof i&&i.versions&&i.versions.node&&i.versions.v8);t.default=function(e,t){return(p?l:h)(e,t)}},9561: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)}},3022:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},1378:e=>{var t=1e3,r=60*t,n=60*r,i=24*n;function o(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,s){s=s||{};var a,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===u&&isFinite(e))return s.long?(a=e,(c=Math.abs(a))>=i?o(a,c,i,"day"):c>=n?o(a,c,n,"hour"):c>=r?o(a,c,r,"minute"):c>=t?o(a,c,t,"second"):a+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9500:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,g=Object.prototype.toString,y=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,A=String.prototype.toLowerCase,E=RegExp.prototype.test,_=Array.prototype.concat,S=Array.prototype.join,x=Array.prototype.slice,T=Math.floor,P="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,O="function"==typeof Symbol&&"object"==typeof Symbol.iterator,C="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function B(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||E.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-T(-e):T(e);if(n!==e){var i=String(n),o=b.call(t,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(t,r,"$&_")}var M=r(3260),L=M.custom,F=H(L)?L:null;function j(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function U(e){return v.call(String(e),/"/g,"&quot;")}function D(e){return!("[object Array]"!==z(e)||C&&"object"==typeof e&&C in e)}function Z(e){return!("[object RegExp]"!==z(e)||C&&"object"==typeof e&&C in e)}function H(e){if(O)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!k)return!1;try{return k.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,n,i){var a=r||{};if(G(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!G(a,"customInspect")||a.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=a.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return W(t,a);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return g?B(t,w):w}if("bigint"==typeof t){var E=String(t)+"n";return g?B(t,E):E}var T=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=T&&T>0&&"object"==typeof t)return D(t)?"[Array]":"[Object]";var I,L=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=S.call(Array(e.indent+1)," ")}return{base:r,prev:S.call(Array(t+1),r)}}(a,n);if(void 0===i)i=[];else if(V(i,t)>=0)return"[Circular]";function $(t,r,o){if(r&&(i=x.call(i)).push(r),o){var s={depth:a.depth};return G(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),e(t,s,n+1,i)}return e(t,a,n+1,i)}if("function"==typeof t&&!Z(t)){var q=function(e){if(e.name)return e.name;var t=m.call(y.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ee=X(t,$);return"[Function"+(q?": "+q:" (anonymous)")+"]"+(ee.length>0?" { "+S.call(ee,", ")+" }":"")}if(H(t)){var te=O?v.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):k.call(t);return"object"!=typeof t||O?te:K(te)}if((I=t)&&"object"==typeof I&&("undefined"!=typeof HTMLElement&&I instanceof HTMLElement||"string"==typeof I.nodeName&&"function"==typeof I.getAttribute)){for(var re="<"+A.call(String(t.nodeName)),ne=t.attributes||[],ie=0;ie<ne.length;ie++)re+=" "+ne[ie].name+"="+j(U(ne[ie].value),"double",a);return re+=">",t.childNodes&&t.childNodes.length&&(re+="..."),re+"</"+A.call(String(t.nodeName))+">"}if(D(t)){if(0===t.length)return"[]";var oe=X(t,$);return L&&!function(e){for(var t=0;t<e.length;t++)if(V(e[t],"\n")>=0)return!1;return!0}(oe)?"["+Q(oe,L)+"]":"[ "+S.call(oe,", ")+" ]"}if(function(e){return!("[object Error]"!==z(e)||C&&"object"==typeof e&&C in e)}(t)){var se=X(t,$);return"cause"in Error.prototype||!("cause"in t)||N.call(t,"cause")?0===se.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(se,", ")+" }":"{ ["+String(t)+"] "+S.call(_.call("[cause]: "+$(t.cause),se),", ")+" }"}if("object"==typeof t&&c){if(F&&"function"==typeof t[F]&&M)return M(t,{depth:T-n});if("symbol"!==c&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!o||!e||"object"!=typeof e)return!1;try{o.call(e);try{u.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ae=[];return s&&s.call(t,(function(e,r){ae.push($(r,t,!0)+" => "+$(e,t))})),Y("Map",o.call(t),ae,L)}if(function(e){if(!u||!e||"object"!=typeof e)return!1;try{u.call(e);try{o.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return l&&l.call(t,(function(e){ce.push($(e,t))})),Y("Set",u.call(t),ce,L)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return J("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return J("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return J("WeakRef");if(function(e){return!("[object Number]"!==z(e)||C&&"object"==typeof e&&C in e)}(t))return K($(Number(t)));if(function(e){if(!e||"object"!=typeof e||!P)return!1;try{return P.call(e),!0}catch(e){}return!1}(t))return K($(P.call(t)));if(function(e){return!("[object Boolean]"!==z(e)||C&&"object"==typeof e&&C in e)}(t))return K(p.call(t));if(function(e){return!("[object String]"!==z(e)||C&&"object"==typeof e&&C in e)}(t))return K($(String(t)));if(!function(e){return!("[object Date]"!==z(e)||C&&"object"==typeof e&&C in e)}(t)&&!Z(t)){var ue=X(t,$),le=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,fe=t instanceof Object?"":"null prototype",de=!le&&C&&Object(t)===t&&C in t?b.call(z(t),8,-1):fe?"Object":"",he=(le||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(de||fe?"["+S.call(_.call([],de||[],fe||[]),": ")+"] ":"");return 0===ue.length?he+"{}":L?he+"{"+Q(ue,L)+"}":he+"{ "+S.call(ue,", ")+" }"}return String(t)};var $=Object.prototype.hasOwnProperty||function(e){return e in this};function G(e,t){return $.call(e,t)}function z(e){return g.call(e)}function V(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function W(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return W(b.call(e,0,t.maxStringLength),t)+n}return j(v.call(v.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,q),"single",t)}function q(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function K(e){return"Object("+e+")"}function J(e){return e+" { ? }"}function Y(e,t,r,n){return e+" ("+t+") {"+(n?Q(r,n):S.call(r,", "))+"}"}function Q(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+S.call(e,","+r)+"\n"+t.prev}function X(e,t){var r=D(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=G(e,i)?t(e[i],e):""}var o,s="function"==typeof I?I(e):[];if(O){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var c in e)G(e,c)&&(r&&String(Number(c))===c&&c<e.length||O&&o["$"+c]instanceof Symbol||(E.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if("function"==typeof I)for(var u=0;u<s.length;u++)N.call(e,s[u])&&n.push("["+t(s[u])+"]: "+t(e[s[u]],e));return n}},4626:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ObliviousSet:()=>n,now:()=>o,removeTooOldValues:()=>i});var n=function(){function e(e){this.ttl=e,this.map=new Map,this._to=!1}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.add=function(e){var t=this;this.map.set(e,o()),this._to||(this._to=!0,setTimeout((function(){t._to=!1,i(t)}),0))},e.prototype.clear=function(){this.map.clear()},e}();function i(e){for(var t=o()-e.ttl,r=e.map[Symbol.iterator]();;){var n=r.next().value;if(!n)return;var i=n[0];if(!(n[1]<t))return;e.map.delete(i)}}function o(){return(new Date).getTime()}},9928:(e,t,r)=>{var n=r(8892);function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function o(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}e.exports=n(i),e.exports.strict=n(o),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},4406: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,c=[],u=!1,l=-1;function f(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&d())}function d(){if(!u){var e=s(f);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new h(e,t)),1!==c.length||u||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},3171:(e,t,r)=>{var n=r(4406),i=r(9928),o=r(8797),s=r(3558),a=function(){},c=/^v?\.0/.test(n.version),u=function(e){return"function"==typeof e},l=function(e){e()},f=function(e,t){return e.pipe(t)};e.exports=function(){var e,t=Array.prototype.slice.call(arguments),r=u(t[t.length-1]||a)&&t.pop()||a;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var n=t.map((function(f,d){var h=d<t.length-1;return function(e,t,r,n){n=i(n);var l=!1;e.on("close",(function(){l=!0})),o(e,{readable:t,writable:r},(function(e){if(e)return n(e);l=!0,n()}));var f=!1;return function(t){if(!l&&!f)return f=!0,function(e){return!!c&&!!s&&(e instanceof(s.ReadStream||a)||e instanceof(s.WriteStream||a))&&u(e.close)}(e)?e.close(a):function(e){return e.setHeader&&u(e.abort)}(e)?e.abort():u(e.destroy)?e.destroy():void n(t||new Error("stream was destroyed"))}}(f,h,d>0,(function(t){e||(e=t),t&&n.forEach(l),h||(n.forEach(l),r(e))}))}));return t.reduce(f)}},5527:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},9126:(e,t,r)=>{"use strict";var n=r(6845),i=r(9166),o=r(5527);e.exports={formats:o,parse:i,stringify:n}},9166:(e,t,r)=>{"use strict";var n=r(2493),i=Object.prototype.hasOwnProperty,o=Array.isArray,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},u=function(e,t,r,n){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(o),u=a?o.slice(0,a.index):o,l=[];if(u){if(!r.plainObjects&&i.call(Object.prototype,u)&&!r.allowPrototypes)return;l.push(u)}for(var f=0;r.depth>0&&null!==(a=s.exec(o))&&f<r.depth;){if(f+=1,!r.plainObjects&&i.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;l.push(a[1])}return a&&l.push("["+o.slice(a.index)+"]"),function(e,t,r,n){for(var i=n?t:c(t,r),o=e.length-1;o>=0;--o){var s,a=e[o];if("[]"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,l=parseInt(u,10);r.parseArrays||""!==u?!isNaN(l)&&a!==u&&String(l)===u&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(s=[])[l]=i:"__proto__"!==u&&(s[u]=i):s={0:i}}i=s}return i}(l,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,u={__proto__:null},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,d=l.split(t.delimiter,f),h=-1,p=t.charset;if(t.charsetSentinel)for(r=0;r<d.length;++r)0===d[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[r]?p="utf-8":"utf8=%26%2310003%3B"===d[r]&&(p="iso-8859-1"),h=r,r=d.length);for(r=0;r<d.length;++r)if(r!==h){var g,y,m=d[r],b=m.indexOf("]="),v=-1===b?m.indexOf("="):b+1;-1===v?(g=t.decoder(m,s.decoder,p,"key"),y=t.strictNullHandling?null:""):(g=t.decoder(m.slice(0,v),s.decoder,p,"key"),y=n.maybeMap(c(m.slice(v+1),t),(function(e){return t.decoder(e,s.decoder,p,"value")}))),y&&t.interpretNumericEntities&&"iso-8859-1"===p&&(y=a(y)),m.indexOf("[]=")>-1&&(y=o(y)?[y]:y),i.call(u,g)?u[g]=n.combine(u[g],y):u[g]=y}return u}(e,r):e,f=r.plainObjects?Object.create(null):{},d=Object.keys(l),h=0;h<d.length;++h){var p=d[h],g=u(p,l[p],r,"string"==typeof e);f=n.merge(f,g,r)}return!0===r.allowSparse?f:n.compact(f)}},6845:(e,t,r)=>{"use strict";var n=r(4294),i=r(2493),o=r(5527),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,u=Array.prototype.push,l=function(e,t){u.apply(e,c(t)?t:[t])},f=Date.prototype.toISOString,d=o.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:d,formatter:o.formatters[d],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},p={},g=function e(t,r,o,s,a,u,f,d,g,y,m,b,v,w,A,E){for(var _,S=t,x=E,T=0,P=!1;void 0!==(x=x.get(p))&&!P;){var I=x.get(t);if(T+=1,void 0!==I){if(I===T)throw new RangeError("Cyclic object value");P=!0}void 0===x.get(p)&&(T=0)}if("function"==typeof d?S=d(r,S):S instanceof Date?S=m(S):"comma"===o&&c(S)&&(S=i.maybeMap(S,(function(e){return e instanceof Date?m(e):e}))),null===S){if(a)return f&&!w?f(r,h.encoder,A,"key",b):r;S=""}if("string"==typeof(_=S)||"number"==typeof _||"boolean"==typeof _||"symbol"==typeof _||"bigint"==typeof _||i.isBuffer(S))return f?[v(w?r:f(r,h.encoder,A,"key",b))+"="+v(f(S,h.encoder,A,"value",b))]:[v(r)+"="+v(String(S))];var k,O=[];if(void 0===S)return O;if("comma"===o&&c(S))w&&f&&(S=i.maybeMap(S,f)),k=[{value:S.length>0?S.join(",")||null:void 0}];else if(c(d))k=d;else{var C=Object.keys(S);k=g?C.sort(g):C}for(var N=s&&c(S)&&1===S.length?r+"[]":r,R=0;R<k.length;++R){var B=k[R],M="object"==typeof B&&void 0!==B.value?B.value:S[B];if(!u||null!==M){var L=c(S)?"function"==typeof o?o(N,B):N:N+(y?"."+B:"["+B+"]");E.set(t,T);var F=n();F.set(p,E),l(O,e(M,L,o,s,a,u,"comma"===o&&w&&c(S)?null:f,d,g,y,m,b,v,w,A,F))}}return O};e.exports=function(e,t){var r,i=e,u=function(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=o.default;if(void 0!==e.format){if(!s.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=o.formatters[r],i=h.filter;return("function"==typeof e.filter||c(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof u.filter?i=(0,u.filter)("",i):c(u.filter)&&(r=u.filter);var f,d=[];if("object"!=typeof i||null===i)return"";f=t&&t.arrayFormat in a?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var p=a[f];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var y="comma"===p&&t&&t.commaRoundTrip;r||(r=Object.keys(i)),u.sort&&r.sort(u.sort);for(var m=n(),b=0;b<r.length;++b){var v=r[b];u.skipNulls&&null===i[v]||l(d,g(i[v],v,p,y,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.format,u.formatter,u.encodeValuesOnly,u.charset,m))}var w=d.join(u.delimiter),A=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?A+="utf8=%26%2310003%3B&":A+="utf8=%E2%9C%93&"),w.length>0?A+w:""}},2493:(e,t,r)=>{"use strict";var n=r(5527),i=Object.prototype.hasOwnProperty,o=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],s=i.obj[i.prop],a=Object.keys(s),c=0;c<a.length;++c){var u=a[c],l=s[u];"object"==typeof l&&null!==l&&-1===r.indexOf(l)&&(t.push({obj:s,prop:u}),r.push(l))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,i,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var c="",u=0;u<a.length;++u){var l=a.charCodeAt(u);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||o===n.RFC1738&&(40===l||41===l)?c+=a.charAt(u):l<128?c+=s[l]:l<2048?c+=s[192|l>>6]+s[128|63&l]:l<55296||l>=57344?c+=s[224|l>>12]+s[128|l>>6&63]+s[128|63&l]:(u+=1,l=65536+((1023&l)<<10|1023&a.charCodeAt(u)),c+=s[240|l>>18]+s[128|l>>12&63]+s[128|l>>6&63]+s[128|63&l])}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(o(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return o(t)&&!o(r)&&(s=a(t,n)),o(t)&&o(r)?(r.forEach((function(r,o){if(i.call(t,o)){var s=t[o];s&&"object"==typeof s&&r&&"object"==typeof r?t[o]=e(s,r,n):t.push(r)}else t[o]=r})),t):Object.keys(r).reduce((function(t,o){var s=r[o];return i.call(t,o)?t[o]=e(t[o],s,n):t[o]=s,t}),s)}}},3952:(e,t,r)=>{"use strict";const{AbortError:n,codes:i}=r(9865),{isNodeStream:o,isWebStream:s,kControllerErrorFunction:a}=r(2211),c=r(9885),{ERR_INVALID_ARG_TYPE:u}=i;e.exports.addAbortSignal=function(t,r){if(((e,t)=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!o(r)&&!s(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const r=o(t)?()=>{t.destroy(new n(void 0,{cause:e.reason}))}:()=>{t[a](new n(void 0,{cause:e.reason}))};return e.aborted?r():(e.addEventListener("abort",r),c(t,(()=>e.removeEventListener("abort",r)))),t}},6637:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:i,TypedArrayPrototypeSet:o,Uint8Array:s}=r(1122),{Buffer:a}=r(8834),{inspect:c}=r(2092);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)o(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,i=0;do{const o=r.data;if(!(e>o.length)){e===o.length?(t+=o,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(o,0,e),this.head=r,r.data=n(o,e));break}t+=o,e-=o.length,++i}while(null!==(r=r.next));return this.length-=i,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let n=this.head,i=0;do{const a=n.data;if(!(e>a.length)){e===a.length?(o(t,a,r-e),++i,n.next?this.head=n.next:this.head=this.tail=null):(o(t,new s(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}o(t,a,r-e),e-=a.length,++i}while(null!==(n=n.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return c(this,{...t,depth:0,customInspect:!1})}}},9732:(e,t,r)=>{"use strict";const{pipeline:n}=r(3495),i=r(2852),{destroyer:o}=r(2262),{isNodeStream:s,isReadable:a,isWritable:c,isWebStream:u,isTransformStream:l,isWritableStream:f,isReadableStream:d}=r(2211),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:g}}=r(9865),y=r(9885);e.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return i.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=i.from(e[t])}for(let r=0;r<e.length;++r)if(s(e[r])||u(e[r])){if(r<e.length-1&&!(a(e[r])||d(e[r])||l(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(c(e[r])||f(e[r])||l(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,m,b,v,w;const A=e[0],E=n(e,(function(e){const t=v;v=null,t?t(e):e?w.destroy(e):S||_||w.destroy()})),_=!!(c(A)||f(A)||l(A)),S=!!(a(E)||d(E)||l(E));if(w=new i({writableObjectMode:!(null==A||!A.writableObjectMode),readableObjectMode:!(null==E||!E.writableObjectMode),writable:_,readable:S}),_){if(s(A))w._write=function(e,t,n){A.write(e,t)?n():r=n},w._final=function(e){A.end(),m=e},A.on("drain",(function(){if(r){const e=r;r=null,e()}}));else if(u(A)){const e=(l(A)?A.writable:A).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch((()=>{})),n()}catch(e){n(e)}},w._final=async function(t){try{await e.ready,e.close().catch((()=>{})),m=t}catch(e){t(e)}}}const e=l(E)?E.readable:E;y(e,(()=>{if(m){const e=m;m=null,e()}}))}if(S)if(s(E))E.on("readable",(function(){if(b){const e=b;b=null,e()}})),E.on("end",(function(){w.push(null)})),w._read=function(){for(;;){const e=E.read();if(null===e)return void(b=w._read);if(!w.push(e))return}};else if(u(E)){const e=(l(E)?E.readable:E).getReader();w._read=async function(){for(;;)try{const{value:t,done:r}=await e.read();if(!w.push(t))return;if(r)return void w.push(null)}catch{return}}}return w._destroy=function(e,t){e||null===v||(e=new h),b=null,r=null,m=null,null===v?t(e):(v=t,s(E)&&o(E,e))},w}},2262:(e,t,r)=>{"use strict";const n=r(4406),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:s}=r(9865),{Symbol:a}=r(1122),{kDestroyed:c,isDestroyed:u,isFinished:l,isServerRequest:f}=r(2211),d=a("kDestroy"),h=a("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function g(e,t,r){let i=!1;function o(t){if(i)return;i=!0;const o=e._readableState,s=e._writableState;p(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(y,e,t):n.nextTick(m,e)}try{e._destroy(t||null,o)}catch(t){o(t)}}function y(e,t){b(e,t),m(e)}function m(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function b(e,t){const r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function v(e,t,r){const i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(b,e,t):b(e,t))}function w(e){let t=!1;function r(r){if(t)return void v(e,null!=r?r:new o);t=!0;const i=e._readableState,s=e._writableState,a=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(d,r):r?v(e,r,!0):n.nextTick(A,e)}try{e._construct((e=>{n.nextTick(r,e)}))}catch(e){n.nextTick(r,e)}}function A(e){e.emit(h)}function E(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function _(e){e.emit("close")}function S(e,t){e.emit("error",t),n.nextTick(_,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(h,t),e.listenerCount(h)>1||n.nextTick(w,e)},destroyer:function(e,t){e&&!u(e)&&(t||l(e)||(t=new s),f(e)?(e.socket=null,e.destroy(t)):E(e)?e.abort():E(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?n.nextTick(S,e,t):n.nextTick(_,e),e.destroyed||(e[c]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,o=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),o.constructed?g(this,e,t):this.once(d,(function(r){g(this,i(r,e),t)})),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:v}},2852:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:o,ObjectSetPrototypeOf:s}=r(1122);e.exports=u;const a=r(182),c=r(80);s(u.prototype,a.prototype),s(u,a);{const e=o(c.prototype);for(let t=0;t<e.length;t++){const r=e[t];u.prototype[r]||(u.prototype[r]=c.prototype[r])}}function u(e){if(!(this instanceof u))return new u(e);a.call(this,e),c.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let l,f;function d(){return void 0===l&&(l={}),l}n(u.prototype,{writable:{__proto__:null,...i(c.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(c.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(c.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(c.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(c.prototype,"writableLength")},writableFinished:{__proto__:null,...i(c.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(c.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(c.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(c.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),u.fromWeb=function(e,t){return d().newStreamDuplexFromReadableWritablePair(e,t)},u.toWeb=function(e){return d().newReadableWritablePairFromDuplex(e)},u.from=function(e){return f||(f=r(2116)),f(e,"body")}},2116:(e,t,r)=>{const n=r(4406),i=r(8834),{isReadable:o,isWritable:s,isIterable:a,isNodeStream:c,isReadableNodeStream:u,isWritableNodeStream:l,isDuplexNodeStream:f}=r(2211),d=r(9885),{AbortError:h,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g}}=r(9865),{destroyer:y}=r(2262),m=r(2852),b=r(182),{createDeferredPromise:v}=r(2092),w=r(7549),A=globalThis.Blob||i.Blob,E=void 0!==A?function(e){return e instanceof A}:function(e){return!1},_=globalThis.AbortController||r(7948).AbortController,{FunctionPrototypeCall:S}=r(1122);class x extends m{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function T(e){const t=e.readable&&"function"!=typeof e.readable.read?b.wrap(e.readable):e.readable,r=e.writable;let n,i,a,c,u,l=!!o(t),f=!!s(r);function p(e){const t=c;c=null,t?t(e):e&&u.destroy(e)}return u=new x({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:l,writable:f}),f&&(d(r,(e=>{f=!1,e&&y(t,e),p(e)})),u._write=function(e,t,i){r.write(e,t)?i():n=i},u._final=function(e){r.end(),i=e},r.on("drain",(function(){if(n){const e=n;n=null,e()}})),r.on("finish",(function(){if(i){const e=i;i=null,e()}}))),l&&(d(t,(e=>{l=!1,e&&y(t,e),p(e)})),t.on("readable",(function(){if(a){const e=a;a=null,e()}})),t.on("end",(function(){u.push(null)})),u._read=function(){for(;;){const e=t.read();if(null===e)return void(a=u._read);if(!u.push(e))return}}),u._destroy=function(e,o){e||null===c||(e=new h),a=null,n=null,i=null,null===c?o(e):(c=o,y(r,e),y(t,e))},u}e.exports=function e(t,r){if(f(t))return t;if(u(t))return T({readable:t});if(l(t))return T({writable:t});if(c(t))return T({writable:!1,readable:!1});if("function"==typeof t){const{value:e,write:i,final:o,destroy:s}=function(e){let{promise:t,resolve:r}=v();const i=new _,o=i.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:s,cb:a}=await e;if(n.nextTick(a),s)return;if(o.aborted)throw new h(void 0,{cause:o.reason});({promise:t,resolve:r}=v()),yield i}}(),{signal:o}),write(e,t,n){const i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(a(e))return w(x,e,{objectMode:!0,write:i,final:o,destroy:s});const c=null==e?void 0:e.then;if("function"==typeof c){let t;const r=S(c,e,(e=>{if(null!=e)throw new g("nully","body",e)}),(e=>{y(t,e)}));return t=new x({objectMode:!0,readable:!1,write:i,final(e){o((async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}}))},destroy:s})}throw new g("Iterable, AsyncIterable or AsyncFunction",r,e)}if(E(t))return e(t.arrayBuffer());if(a(t))return w(x,t,{objectMode:!0,writable:!1});if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return T({readable:null!=t&&t.readable?u(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?l(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const i=null==t?void 0:t.then;if("function"==typeof i){let e;return S(i,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{y(e,t)})),e=new x({objectMode:!0,writable:!1,read(){}})}throw new p(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},9885:(e,t,r)=>{const n=r(4406),{AbortError:i,codes:o}=r(9865),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:c,once:u}=r(2092),{validateAbortSignal:l,validateFunction:f,validateObject:d,validateBoolean:h}=r(2209),{Promise:p,PromisePrototypeThen:g}=r(1122),{isClosed:y,isReadable:m,isReadableNodeStream:b,isReadableStream:v,isReadableFinished:w,isReadableErrored:A,isWritable:E,isWritableNodeStream:_,isWritableStream:S,isWritableFinished:x,isWritableErrored:T,isNodeStream:P,willEmitClose:I,kIsClosedPromise:k}=r(2211),O=()=>{};function C(e,t,r){var o,h;if(2===arguments.length?(r=t,t=c):null==t?t=c:d(t,"options"),f(r,"callback"),l(t.signal,"options.signal"),r=u(r),v(e)||S(e))return function(e,t,r){let o=!1,s=O;if(t.signal)if(s=()=>{o=!0,r.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(s);else{const n=r;r=u(((...r)=>{t.signal.removeEventListener("abort",s),n.apply(e,r)})),t.signal.addEventListener("abort",s)}const a=(...t)=>{o||n.nextTick((()=>r.apply(e,t)))};return g(e[k].promise,a,a),O}(e,t,r);if(!P(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);const p=null!==(o=t.readable)&&void 0!==o?o:b(e),C=null!==(h=t.writable)&&void 0!==h?h:_(e),N=e._writableState,R=e._readableState,B=()=>{e.writable||F()};let M=I(e)&&b(e)===p&&_(e)===C,L=x(e,!1);const F=()=>{L=!0,e.destroyed&&(M=!1),(!M||e.readable&&!p)&&(p&&!j||r.call(e))};let j=w(e,!1);const U=()=>{j=!0,e.destroyed&&(M=!1),(!M||e.writable&&!C)&&(C&&!L||r.call(e))},D=t=>{r.call(e,t)};let Z=y(e);const H=()=>{Z=!0;const t=T(e)||A(e);return t&&"boolean"!=typeof t?r.call(e,t):p&&!j&&b(e,!0)&&!w(e,!1)?r.call(e,new a):!C||L||x(e,!1)?void r.call(e):r.call(e,new a)},$=()=>{Z=!0;const t=T(e)||A(e);if(t&&"boolean"!=typeof t)return r.call(e,t);r.call(e)},G=()=>{e.req.on("finish",F)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?C&&!N&&(e.on("end",B),e.on("close",B)):(e.on("complete",F),M||e.on("abort",H),e.req?G():e.on("request",G)),M||"boolean"!=typeof e.aborted||e.on("aborted",H),e.on("end",U),e.on("finish",F),!1!==t.error&&e.on("error",D),e.on("close",H),Z?n.nextTick(H):null!=N&&N.errorEmitted||null!=R&&R.errorEmitted?M||n.nextTick($):(p||M&&!m(e)||!L&&!1!==E(e))&&(C||M&&!E(e)||!j&&!1!==m(e))?R&&e.req&&e.aborted&&n.nextTick($):n.nextTick($);const z=()=>{r=O,e.removeListener("aborted",H),e.removeListener("complete",F),e.removeListener("abort",H),e.removeListener("request",G),e.req&&e.req.removeListener("finish",F),e.removeListener("end",B),e.removeListener("close",B),e.removeListener("finish",F),e.removeListener("end",U),e.removeListener("error",D),e.removeListener("close",H)};if(t.signal&&!Z){const o=()=>{const n=r;z(),n.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(o);else{const n=r;r=u(((...r)=>{t.signal.removeEventListener("abort",o),n.apply(e,r)})),t.signal.addEventListener("abort",o)}}return z}e.exports=C,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=c),null!==(r=t)&&void 0!==r&&r.cleanup&&(h(t.cleanup,"cleanup"),n=t.cleanup),new p(((r,i)=>{const o=C(e,t,(e=>{n&&o(),e?i(e):r()}))}))}},7549:(e,t,r)=>{"use strict";const n=r(4406),{PromisePrototypeThen:i,SymbolAsyncIterator:o,SymbolIterator:s}=r(1122),{Buffer:a}=r(8834),{ERR_INVALID_ARG_TYPE:c,ERR_STREAM_NULL_VALUES:u}=r(9865).codes;e.exports=function(e,t,r){let l,f;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[o])f=!0,l=t[o]();else{if(!t||!t[s])throw new c("iterable",["Iterable"],t);f=!1,l=t[s]()}const d=new e({objectMode:!0,highWaterMark:1,...r});let h=!1;return d._read=function(){h||(h=!0,async function(){for(;;){try{const{value:e,done:t}=f?await l.next():l.next();if(t)d.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw h=!1,new u;if(d.push(t))continue;h=!1}}catch(e){d.destroy(e)}break}}())},d._destroy=function(e,t){i(async function(e){const t=null!=e,r="function"==typeof l.throw;if(t&&r){const{value:t,done:r}=await l.throw(e);if(await t,r)return}if("function"==typeof l.return){const{value:e}=await l.return();await e}}(e),(()=>n.nextTick(t,e)),(r=>n.nextTick(t,r||e)))},d}},3798:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:i}=r(1122),{EventEmitter:o}=r(2699);function s(e){o.call(this,e)}function a(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}i(s.prototype,o.prototype),i(s,o),s.prototype.pipe=function(e,t){const r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",c),r.on("close",u));let s=!1;function c(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){f(),0===o.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",c),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return a(r,"error",l),a(e,"error",l),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:s,prependListener:a}},1273:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(7948).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:c}=r(9865),{validateAbortSignal:u,validateInteger:l,validateObject:f}=r(2209),d=r(1122).Symbol("kWeak"),{finished:h}=r(9885),p=r(9732),{addAbortSignalNoValidate:g}=r(3952),{isWritable:y,isNodeStream:m}=r(2211),{ArrayPrototypePush:b,MathFloor:v,Number:w,NumberIsNaN:A,Promise:E,PromiseReject:_,PromisePrototypeThen:S,Symbol:x}=r(1122),T=x("kEmpty"),P=x("kEof");function I(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal");let r=1;return null!=(null==t?void 0:t.concurrency)&&(r=v(t.concurrency)),l(r,"concurrency",1),async function*(){var i,o;const s=new n,a=this,u=[],l=s.signal,f={signal:l},d=()=>s.abort();let h,p;null!=t&&null!==(i=t.signal)&&void 0!==i&&i.aborted&&d(),null==t||null===(o=t.signal)||void 0===o||o.addEventListener("abort",d);let g=!1;function y(){g=!0}!async function(){try{for await(let t of a){var n;if(g)return;if(l.aborted)throw new c;try{t=e(t,f)}catch(e){t=_(e)}t!==T&&("function"==typeof(null===(n=t)||void 0===n?void 0:n.catch)&&t.catch(y),u.push(t),h&&(h(),h=null),!g&&u.length&&u.length>=r&&await new E((e=>{p=e})))}u.push(P)}catch(e){const t=_(e);S(t,void 0,y),u.push(t)}finally{var i;g=!0,h&&(h(),h=null),null==t||null===(i=t.signal)||void 0===i||i.removeEventListener("abort",d)}}();try{for(;;){for(;u.length>0;){const e=await u[0];if(e===P)return;if(l.aborted)throw new c;e!==T&&(yield e),u.shift(),p&&(p(),p=null)}await new E((e=>{h=e}))}}finally{s.abort(),g=!0,p&&(p(),p=null)}}.call(this)}async function k(e,t=void 0){for await(const r of O.call(this,e,t))return!0;return!1}function O(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return I.call(this,(async function(t,r){return await e(t,r)?t:T}),t)}class C extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function N(e){if(e=w(e),A(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new c({cause:e.signal.reason});yield[t++,n]}}.call(this)},drop:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),e=N(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new c;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new c;e--<=0&&(yield r)}}.call(this)},filter:O,flatMap:function(e,t){const r=I.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:I,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),e=N(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new c;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new c;if(!(e-- >0))return;yield r}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),m(e)&&!y(e))throw new i("stream",e,"must be writable");const r=p(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return!await k.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);for await(const r of I.call(this,(async function(t,r){return await e(t,r),T}),t));},reduce:async function(e,t,r){var i;if("function"!=typeof e)throw new o("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&u(r.signal,"options.signal");let s=arguments.length>1;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted){const e=new c(void 0,{cause:r.signal.reason});throw this.once("error",(()=>{})),await h(this.destroy(e)),e}const a=new n,l=a.signal;if(null!=r&&r.signal){const e={once:!0,[d]:this};r.signal.addEventListener("abort",(()=>a.abort()),e)}let p=!1;try{for await(const n of this){var g;if(p=!0,null!=r&&null!==(g=r.signal)&&void 0!==g&&g.aborted)throw new c;s?t=await e(t,n,{signal:l}):(t=n,s=!0)}if(!p&&!s)throw new C}finally{a.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new c(void 0,{cause:e.signal.reason});b(t,n)}return t},some:k,find:async function(e,t){for await(const r of O.call(this,e,t))return r}}},4584:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(1122);e.exports=o;const i=r(1112);function o(e){if(!(this instanceof o))return new o(e);i.call(this,e)}n(o.prototype,i.prototype),n(o,i),o.prototype._transform=function(e,t,r){r(null,e)}},3495:(e,t,r)=>{const n=r(4406),{ArrayIsArray:i,Promise:o,SymbolAsyncIterator:s}=r(1122),a=r(9885),{once:c}=r(2092),u=r(2262),l=r(2852),{aggregateTwoErrors:f,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:h,ERR_MISSING_ARGS:p,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:m}=r(9865),{validateFunction:b,validateAbortSignal:v}=r(2209),{isIterable:w,isReadable:A,isReadableNodeStream:E,isNodeStream:_,isTransformStream:S,isWebStream:x,isReadableStream:T,isReadableEnded:P}=r(2211),I=globalThis.AbortController||r(7948).AbortController;let k,O;function C(e,t,r){let n=!1;return e.on("close",(()=>{n=!0})),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new g("pipe")))},cleanup:a(e,{readable:t,writable:r},(e=>{n=!e}))}}function N(e){if(w(e))return e;if(E(e))return async function*(e){O||(O=r(182)),yield*O.prototype[s].call(e)}(e);throw new d("val",["Readable","Iterable","AsyncIterable"],e)}async function R(e,t,r,{end:n}){let i,s=null;const c=e=>{if(e&&(i=e),s){const e=s;s=null,e()}},u=()=>new o(((e,t)=>{i?t(i):s=()=>{i?t(i):e()}}));t.on("drain",c);const l=a(t,{readable:!1},c);try{t.writableNeedDrain&&await u();for await(const r of e)t.write(r)||await u();n&&t.end(),await u(),r()}catch(e){r(i!==e?f(i,e):e)}finally{l(),t.off("drain",c)}}async function B(e,t,r,{end:n}){S(t)&&(t=t.writable);const i=t.getWriter();try{for await(const t of e)await i.ready,i.write(t).catch((()=>{}));await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function M(e,t,o){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new p("streams");const s=new I,a=s.signal,c=null==o?void 0:o.signal,u=[];function f(){F(new m)}let g,y;v(c,"options.signal"),null==c||c.addEventListener("abort",f);const b=[];let P,O=0;function M(e){F(e,0==--O)}function F(e,r){if(!e||g&&"ERR_STREAM_PREMATURE_CLOSE"!==g.code||(g=e),g||r){for(;b.length;)b.shift()(g);null==c||c.removeEventListener("abort",f),s.abort(),r&&(g||u.forEach((e=>e())),n.nextTick(t,g,y))}}for(let Z=0;Z<e.length;Z++){const H=e[Z],$=Z<e.length-1,G=Z>0,z=$||!1!==(null==o?void 0:o.end),V=Z===e.length-1;if(_(H)){if(z){const{destroy:W,cleanup:q}=C(H,$,G);b.push(W),A(H)&&V&&u.push(q)}function j(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&M(e)}H.on("error",j),A(H)&&V&&u.push((()=>{H.removeListener("error",j)}))}if(0===Z)if("function"==typeof H){if(P=H({signal:a}),!w(P))throw new h("Iterable, AsyncIterable or Stream","source",P)}else P=w(H)||E(H)||S(H)?H:l.from(H);else if("function"==typeof H){var U;if(P=S(P)?N(null===(U=P)||void 0===U?void 0:U.readable):N(P),P=H(P,{signal:a}),$){if(!w(P,!0))throw new h("AsyncIterable",`transform[${Z-1}]`,P)}else{var D;k||(k=r(4584));const K=new k({objectMode:!0}),J=null===(D=P)||void 0===D?void 0:D.then;if("function"==typeof J)O++,J.call(P,(e=>{y=e,null!=e&&K.write(e),z&&K.end(),n.nextTick(M)}),(e=>{K.destroy(e),n.nextTick(M,e)}));else if(w(P,!0))O++,R(P,K,M,{end:z});else{if(!T(P)&&!S(P))throw new h("AsyncIterable or Promise","destination",P);{const X=P.readable||P;O++,R(X,K,M,{end:z})}}P=K;const{destroy:Y,cleanup:Q}=C(P,!1,!0);b.push(Y),V&&u.push(Q)}}else if(_(H)){if(E(P)){O+=2;const ee=L(P,H,M,{end:z});A(H)&&V&&u.push(ee)}else if(S(P)||T(P)){const te=P.readable||P;O++,R(te,H,M,{end:z})}else{if(!w(P))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);O++,R(P,H,M,{end:z})}P=H}else if(x(H)){if(E(P))O++,B(N(P),H,M,{end:z});else if(T(P)||w(P))O++,B(P,H,M,{end:z});else{if(!S(P))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);O++,B(P.readable,H,M,{end:z})}P=H}else P=l.from(H)}return(null!=a&&a.aborted||null!=c&&c.aborted)&&n.nextTick(f),P}function L(e,t,r,{end:i}){let o=!1;if(t.on("close",(()=>{o||r(new y)})),e.pipe(t,{end:!1}),i){function s(){o=!0,t.end()}P(e)?n.nextTick(s):e.once("end",s)}else r();return a(e,{readable:!0,writable:!1},(t=>{const n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)})),a(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:M,pipeline:function(...e){return M(e,c(function(e){return b(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},182:(e,t,r)=>{const n=r(4406),{ArrayPrototypeIndexOf:i,NumberIsInteger:o,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:c,ObjectKeys:u,ObjectSetPrototypeOf:l,Promise:f,SafeSet:d,SymbolAsyncIterator:h,Symbol:p}=r(1122);e.exports=U,U.ReadableState=j;const{EventEmitter:g}=r(2699),{Stream:y,prependListener:m}=r(3798),{Buffer:b}=r(8834),{addAbortSignal:v}=r(3952),w=r(9885);let A=r(2092).debuglog("stream",(e=>{A=e}));const E=r(6637),_=r(2262),{getHighWaterMark:S,getDefaultHighWaterMark:x}=r(7605),{aggregateTwoErrors:T,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:I,ERR_OUT_OF_RANGE:k,ERR_STREAM_PUSH_AFTER_EOF:O,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:C}}=r(9865),{validateObject:N}=r(2209),R=p("kPaused"),{StringDecoder:B}=r(214),M=r(7549);l(U.prototype,y.prototype),l(U,y);const L=()=>{},{errorOrDestroy:F}=_;function j(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(2852)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.readableObjectMode)),this.highWaterMark=e?S(this,e,"readableHighWaterMark",n):x(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[R]=null,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new B(e.encoding),this.encoding=e.encoding)}function U(e){if(!(this instanceof U))return new U(e);const t=this instanceof r(2852);this._readableState=new j(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&v(e.signal,this)),y.call(this,e),_.construct(this,(()=>{this._readableState.needReadable&&z(this,this._readableState)}))}function D(e,t,r,n){A("readableAddChunk",t);const i=e._readableState;let o;if(i.objectMode||("string"==typeof t?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=b.from(t,r).toString(i.encoding):(t=b.from(t,r),r=""))):t instanceof b?r="":y._isUint8Array(t)?(t=y._uint8ArrayToBuffer(t),r=""):null!=t&&(o=new P("chunk",["string","Buffer","Uint8Array"],t))),o)F(e,o);else if(null===t)i.reading=!1,function(e,t){if(A("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?$(e):(t.needReadable=!1,t.emittedReadable=!0,G(e))}}(e,i);else if(i.objectMode||t&&t.length>0)if(n)if(i.endEmitted)F(e,new C);else{if(i.destroyed||i.errored)return!1;Z(e,i,t,!0)}else if(i.ended)F(e,new O);else{if(i.destroyed||i.errored)return!1;i.reading=!1,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?Z(e,i,t,!1):z(e,i)):Z(e,i,t,!1)}else n||(i.reading=!1,z(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function Z(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&$(e)),z(e,t)}function H(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:s(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function $(e){const t=e._readableState;A("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(A("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(G,e))}function G(e){const t=e._readableState;A("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,J(e)}function z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(V,e,t))}function V(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(A("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function W(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[R]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function q(e){A("readable nexttick read 0"),e.read(0)}function K(e,t){A("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),J(e),t.flowing&&!t.reading&&e.read(0)}function J(e){const t=e._readableState;for(A("flow",t.flowing);t.flowing&&null!==e.read(););}function Y(e,t){"function"!=typeof e.read&&(e=U.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=L;function i(t){this===e?(n(),n=L):n=t}e.on("readable",i);const o=w(e,{writable:!1},(e=>{r=e?T(r,e):null,n(),n=L}));try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new f(i)}}}catch(e){throw r=T(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",i),o()):_.destroyer(e,null)}}(e,t);return r.stream=e,r}function Q(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function X(e){const t=e._readableState;A("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(ee,t,e))}function ee(e,t){if(A("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(te,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function te(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let re;function ne(){return void 0===re&&(re={}),re}U.prototype.destroy=_.destroy,U.prototype._undestroy=_.undestroy,U.prototype._destroy=function(e,t){t(e)},U.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},U.prototype.push=function(e,t){return D(this,e,t,!1)},U.prototype.unshift=function(e,t){return D(this,e,t,!0)},U.prototype.isPaused=function(){const e=this._readableState;return!0===e[R]||!1===e.flowing},U.prototype.setEncoding=function(e){const t=new B(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},U.prototype.read=function(e){A("read",e),void 0===e?e=NaN:o(e)||(e=a(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new k("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return A("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?X(this):$(this),null;if(0===(e=H(e,t))&&t.ended)return 0===t.length&&X(this),null;let n,i=t.needReadable;if(A("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,A("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,A("reading, ended or constructing",i);else if(i){A("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0);try{this._read(t.highWaterMark)}catch(e){F(this,e)}t.sync=!1,t.reading||(e=H(r,t))}return n=e>0?Q(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&X(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},U.prototype._read=function(e){throw new I("_read()")},U.prototype.pipe=function(e,t){const r=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new d(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),A("pipe count=%d opts=%j",i.pipes.length,t);const o=t&&!1===t.end||e===n.stdout||e===n.stderr?g:s;function s(){A("onend"),e.end()}let a;i.endEmitted?n.nextTick(o):r.once("end",o),e.on("unpipe",(function t(n,o){A("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,A("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",g),r.removeListener("data",l),c=!0,a&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())}));let c=!1;function u(){c||(1===i.pipes.length&&i.pipes[0]===e?(A("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(A("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),a||(a=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(A("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(A("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",a))}function l(t){A("ondata");const r=e.write(t);A("dest.write",r),!1===r&&u()}function f(t){if(A("onerror",t),g(),e.removeListener("error",f),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?F(e,t):e.emit("error",t)}}function h(){e.removeListener("finish",p),g()}function p(){A("onfinish"),e.removeListener("close",h),g()}function g(){A("unpipe"),r.unpipe(e)}return r.on("data",l),m(e,"error",f),e.once("close",h),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?i.flowing&&u():i.flowing||(A("pipe resume"),r.resume()),e},U.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const r=i(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},U.prototype.on=function(e,t){const r=y.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,A("on readable",i.length,i.reading),i.length?$(this):i.reading||n.nextTick(q,this))),r},U.prototype.addListener=U.prototype.on,U.prototype.removeListener=function(e,t){const r=y.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(W,this),r},U.prototype.off=U.prototype.removeListener,U.prototype.removeAllListeners=function(e){const t=y.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(W,this),t},U.prototype.resume=function(){const e=this._readableState;return e.flowing||(A("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(K,e,t))}(this,e)),e[R]=!1,this},U.prototype.pause=function(){return A("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(A("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[R]=!0,this},U.prototype.wrap=function(e){let t=!1;e.on("data",(r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{F(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const r=u(e);for(let t=1;t<r.length;t++){const n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},U.prototype[h]=function(){return Y(this)},U.prototype.iterator=function(e){return void 0!==e&&N(e,"options"),Y(this,e)},c(U.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),c(j.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[R]},set(e){this[R]=!!e}}}),U._fromList=Q,U.from=function(e,t){return M(U,e,t)},U.fromWeb=function(e,t){return ne().newStreamReadableFromReadableStream(e,t)},U.toWeb=function(e,t){return ne().newReadableStreamFromStreamReadable(e,t)},U.wrap=function(e,t){var r,n;return new U({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){_.destroyer(e,t),r(t)}}).wrap(e)}},7605:(e,t,r)=>{"use strict";const{MathFloor:n,NumberIsInteger:i}=r(1122),{ERR_INVALID_ARG_VALUE:o}=r(9865).codes;function s(e){return e?16:16384}e.exports={getHighWaterMark:function(e,t,r,a){const c=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=c){if(!i(c)||c<0)throw new o(a?`options.${r}`:"options.highWaterMark",c);return n(c)}return s(e.objectMode)},getDefaultHighWaterMark:s}},1112:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:i}=r(1122);e.exports=u;const{ERR_METHOD_NOT_IMPLEMENTED:o}=r(9865).codes,s=r(2852),{getHighWaterMark:a}=r(7605);n(u.prototype,s.prototype),n(u,s);const c=i("kCallback");function u(e){if(!(this instanceof u))return new u(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),s.call(this,e),this._readableState.sync=!1,this[c]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function l(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())}))}function f(){this._final!==l&&l.call(this)}u.prototype._final=l,u.prototype._transform=function(e,t,r){throw new o("_transform()")},u.prototype._write=function(e,t,r){const n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,((e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||o===n.length||n.length<n.highWaterMark?r():this[c]=r)}))},u.prototype._read=function(){if(this[c]){const e=this[c];this[c]=null,e()}}},2211:(e,t,r)=>{"use strict";const{Symbol:n,SymbolAsyncIterator:i,SymbolIterator:o,SymbolFor:s}=r(1122),a=n("kDestroyed"),c=n("kIsErrored"),u=n("kIsReadable"),l=n("kIsDisturbed"),f=s("nodejs.webstream.isClosedPromise"),d=s("nodejs.webstream.controllerErrorFunction");function h(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function y(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function m(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function v(e){if(!g(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[a]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function A(e,t){if(!h(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function E(e){return e&&null!=e[u]?e[u]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!v(e)&&h(e)&&e.readable&&!A(e)}function _(e){return"boolean"!=typeof(null==e?void 0:e.writable)?null:!v(e)&&p(e)&&e.writable&&!w(e)}function S(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function x(e){return"boolean"==typeof e._sent100&&S(e)}e.exports={kDestroyed:a,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[l])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:l,isErrored:function(e){var t,r,n,i,o,s,a,u,l,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(s=e[c])&&void 0!==s?s:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(a=e._readableState)||void 0===a?void 0:a.errorEmitted)&&void 0!==n?n:null===(u=e._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==r?r:null===(l=e._readableState)||void 0===l?void 0:l.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:c,isReadable:E,kIsReadable:u,kIsClosedPromise:f,kControllerErrorFunction:d,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&S(e)?e._closed:null},isDestroyed:v,isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!(!v(e)&&(!1!==(null==t?void 0:t.readable)&&E(e)||!1!==(null==t?void 0:t.writable)&&_(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[i]:!1===t?"function"==typeof e[o]:"function"==typeof e[i]||"function"==typeof e[o])},isReadableNodeStream:h,isReadableStream:y,isReadableEnded:function(e){if(!h(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:A,isReadableErrored:function(e){var t,r;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return y(e)||m(e)||b(e)},isWritable:_,isWritableNodeStream:p,isWritableStream:m,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:x,willEmitClose:function(e){if(!g(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&x(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:b}},80:(e,t,r)=>{const n=r(4406),{ArrayPrototypeSlice:i,Error:o,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:c,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:l,Symbol:f,SymbolHasInstance:d}=r(1122);e.exports=B,B.WritableState=N;const{EventEmitter:h}=r(2699),p=r(3798).Stream,{Buffer:g}=r(8834),y=r(2262),{addAbortSignal:m}=r(3952),{getHighWaterMark:b,getDefaultHighWaterMark:v}=r(7605),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:A,ERR_MULTIPLE_CALLBACK:E,ERR_STREAM_CANNOT_PIPE:_,ERR_STREAM_DESTROYED:S,ERR_STREAM_ALREADY_FINISHED:x,ERR_STREAM_NULL_VALUES:T,ERR_STREAM_WRITE_AFTER_END:P,ERR_UNKNOWN_ENCODING:I}=r(9865).codes,{errorOrDestroy:k}=y;function O(){}u(B.prototype,p.prototype),u(B,p);const C=f("kOnFinished");function N(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(2852)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",n):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=j.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,R(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[C]=[]}function R(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function B(e){const t=this instanceof r(2852);if(!t&&!s(B,this))return new B(e);this._writableState=new N(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&m(e.signal,this)),p.call(this,e),y.construct(this,(()=>{const e=this._writableState;e.writing||H(this,e),G(this,e)}))}function M(e,t,r,i){const o=e._writableState;if("function"==typeof r)i=r,r=o.defaultEncoding;else{if(r){if("buffer"!==r&&!g.isEncoding(r))throw new I(r)}else r=o.defaultEncoding;"function"!=typeof i&&(i=O)}if(null===t)throw new T;if(!o.objectMode)if("string"==typeof t)!1!==o.decodeStrings&&(t=g.from(t,r),r="buffer");else if(t instanceof g)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let s;return o.ending?s=new P:o.destroyed&&(s=new S("write")),s?(n.nextTick(i,s),k(e,s,!0),s):(o.pendingcb++,function(e,t,r,n,i){const o=t.objectMode?1:r.length;t.length+=o;const s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&i!==O&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,o,t,r,i))}function L(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new S("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function F(e,t,r,n){--t.pendingcb,n(r),Z(t),k(e,r)}function j(e,t){const r=e._writableState,i=r.sync,o=r.writecb;"function"==typeof o?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?n.nextTick(F,e,r,t,o):F(e,r,t,o)):(r.buffered.length>r.bufferedIndex&&H(e,r),i?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===o?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:o,stream:e,state:r},n.nextTick(U,r.afterWriteTickInfo)):D(e,r,1,o))):k(e,new E)}function U({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,D(e,t,r,n)}function D(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&Z(t),G(e,t)}function Z(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:i}=e.buffered[r],o=e.objectMode?1:n.length;e.length-=o,i(null!==(t=e.errored)&&void 0!==t?t:new S("write"))}const r=e[C].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new S("end"))}R(e)}function H(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:o}=t,s=r.length-n;if(!s)return;let a=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;const n=t.allNoop?O:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},o=t.allNoop&&0===a?r:i(r,a);o.allBuffers=t.allBuffers,L(e,t,!0,t.length,o,"",n),R(t)}else{do{const{chunk:n,encoding:i,callback:s}=r[a];r[a++]=null,L(e,t,!1,o?1:n.length,n,i,s)}while(a<r.length&&!t.writing);a===r.length?R(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function $(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function G(e,t,r){$(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function i(i){if(r)k(e,null!=i?i:E());else if(r=!0,t.pendingcb--,i){const r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e](i);k(e,i,t.sync)}else $(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick(((e,t)=>{$(t)?z(e,t):t.pendingcb--}),e,t)):$(t)&&(t.pendingcb++,z(e,t))))}function z(e,t){t.pendingcb--,t.finished=!0;const r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}N.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},a(N.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(B,d,{__proto__:null,value:function(e){return!!s(this,e)||this===B&&e&&e._writableState instanceof N}}),B.prototype.pipe=function(){k(this,new _)},B.prototype.write=function(e,t,r){return!0===M(this,e,t,r)},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||H(this,e))},B.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=l(e)),!g.isEncoding(e))throw new I(e);return this._writableState.defaultEncoding=e,this},B.prototype._write=function(e,t,r){if(!this._writev)throw new A("_write()");this._writev([{chunk:e,encoding:t}],r)},B.prototype._writev=null,B.prototype.end=function(e,t,r){const i=this._writableState;let s;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=M(this,e,t);r instanceof o&&(s=r)}return i.corked&&(i.corked=1,this.uncork()),s||(i.errored||i.ending?i.finished?s=new x("end"):i.destroyed&&(s=new S("end")):(i.ending=!0,G(this,i,!0),i.ended=!0)),"function"==typeof r&&(s||i.finished?n.nextTick(r,s):i[C].push(r)),this},c(B.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const V=y.destroy;let W;function q(){return void 0===W&&(W={}),W}B.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[C].length)&&n.nextTick(Z,r),V.call(this,e,t),this},B.prototype._undestroy=y.undestroy,B.prototype._destroy=function(e,t){t(e)},B.prototype[h.captureRejectionSymbol]=function(e){this.destroy(e)},B.fromWeb=function(e,t){return q().newStreamWritableFromWritableStream(e,t)},B.toWeb=function(e){return q().newWritableStreamFromStreamWritable(e)}},2209:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:o,ArrayPrototypeMap:s,NumberIsInteger:a,NumberIsNaN:c,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:l,NumberParseInt:f,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:h,String:p,StringPrototypeToUpperCase:g,StringPrototypeTrim:y}=r(1122),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:A,ERR_UNKNOWN_SIGNAL:E}}=r(9865),{normalizeEncoding:_}=r(2092),{isAsyncFunction:S,isArrayBufferView:x}=r(2092).types,T={},P=/^[0-7]+$/,I=m(((e,t,r=l,n=u)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new A(t,"an integer",e);if(e<r||e>n)throw new A(t,`>= ${r} && <= ${n}`,e)})),k=m(((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new A(t,"an integer",e);if(e<r||e>n)throw new A(t,`>= ${r} && <= ${n}`,e)})),O=m(((e,t,r=!1)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new A(t,"an integer",e);const n=r?1:0,i=4294967295;if(e<n||e>i)throw new A(t,`>= ${n} && <= ${i}`,e)}));function C(e,t){if("string"!=typeof e)throw new v(t,"string",e)}const N=m(((e,t,r)=>{if(!i(r,e)){const n=o(s(r,(e=>"string"==typeof e?`'${e}'`:p(e))),", ");throw new w(t,e,"must be one of: "+n)}}));function R(e,t){if("boolean"!=typeof e)throw new v(t,"boolean",e)}function B(e,t,r){return null!=e&&d(e,t)?e[t]:r}const M=m(((e,t,r=null)=>{const i=B(r,"allowArray",!1),o=B(r,"allowFunction",!1);if(!B(r,"nullable",!1)&&null===e||!i&&n(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new v(t,"Object",e)})),L=m(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new v(t,"a dictionary",e)})),F=m(((e,t,r=0)=>{if(!n(e))throw new v(t,"Array",e);if(e.length<r)throw new w(t,e,`must be longer than ${r}`)})),j=m(((e,t="buffer")=>{if(!x(e))throw new v(t,["Buffer","TypedArray","DataView"],e)})),U=m(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new v(t,"AbortSignal",e)})),D=m(((e,t)=>{if("function"!=typeof e)throw new v(t,"Function",e)})),Z=m(((e,t)=>{if("function"!=typeof e||S(e))throw new v(t,"Function",e)})),H=m(((e,t)=>{if(void 0!==e)throw new v(t,"undefined",e)})),$=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function G(e,t){if(void 0===e||!h($,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===h(P,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=f(e,8)}return O(e,t),e},validateArray:F,validateStringArray:function(e,t){F(e,t);for(let r=0;r<e.length;r++)C(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){F(e,t);for(let r=0;r<e.length;r++)R(e[r],`${t}[${r}]`)},validateBoolean:R,validateBuffer:j,validateDictionary:L,validateEncoding:function(e,t){const r=_(t),n=e.length;if("hex"===r&&n%2!=0)throw new w("encoding",t,`is invalid for data of length ${n}`)},validateFunction:D,validateInt32:k,validateInteger:I,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new v(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&c(e))throw new A(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:M,validateOneOf:N,validatePlainFunction:Z,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===y(e).length||+e!=+e>>>0||e>65535||0===e&&!r)throw new b(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(C(e,t),void 0===T[e]){if(void 0!==T[g(e)])throw new E(e+" (signals must use all capital letters)");throw new E(e)}},validateString:C,validateUint32:O,validateUndefined:H,validateUnion:function(e,t,r){if(!i(r,e))throw new v(t,`('${o(r,"|")}')`,e)},validateAbortSignal:U,validateLinkHeaderValue:function(e){if("string"==typeof e)return G(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n<t;n++){const i=e[n];G(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},1887:(e,t,r)=>{"use strict";const n=r(2955),i=r(9419),o=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=o,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=n.Stream,e.exports.default=e.exports},9865:(e,t,r)=>{"use strict";const{format:n,inspect:i,AggregateError:o}=r(2092),s=globalThis.AggregateError||o,a=Symbol("kIsNodeError"),c=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,l={};function f(e,t){if(!e)throw new l.ERR_INTERNAL_ASSERTION(t)}function d(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function h(e,t,r){r||(r=Error);class i extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return f(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const i=(t.match(/%[dfijoOs]/g)||[]).length;return f(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[a]=!0,l[e]=i}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class g extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new l.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",((e,t,r)=>{f("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const o=[],s=[],a=[];for(const e of t)f("string"==typeof e,"All expected entries have to be of type string"),c.includes(e)?o.push(e.toLowerCase()):u.test(e)?s.push(e):(f("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(s.length>0){const e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:n+=`of type ${o[0]}`;break;case 2:n+=`one of type ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();n+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||a.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`an instance of ${s.join(", ")}, or ${e}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`one of ${a.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var l;null!==(l=r.constructor)&&void 0!==l&&l.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${i(r,{depth:-1})}`}else{let e=i(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n}),TypeError),h("ERR_INVALID_ARG_VALUE",((e,t,r="is invalid")=>{let n=i(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`}),TypeError),h("ERR_INVALID_RETURN_VALUE",((e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`}),TypeError),h("ERR_MISSING_ARGS",((...e)=>{let t;f(e.length>0,"At least one arg needs to be specified");const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map((e=>`"${e}"`)).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`}),TypeError),h("ERR_OUT_OF_RANGE",((e,t,r)=>{let n;return f(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32?n=d(String(r)):"bigint"==typeof r?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=d(n)),n+="n"):n=i(r),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`}),RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:g,aggregateTwoErrors:p((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new s([t,e],t.message);return r.code=t.code,r}return e||t})),hideStackFrames:p,codes:l}},1122:e=>{"use strict";e.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Uint8Array}},2092:(e,t,r)=>{"use strict";const n=r(8834),i=Object.getPrototypeOf((async function(){})).constructor,o=globalThis.Blob||n.Blob,s=void 0!==o?function(e){return e instanceof o}:function(e){return!1};class a extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}},promisify:e=>new Promise(((t,r)=>{e(((e,...n)=>e?r(e):t(...n)))})),debuglog:()=>function(){},format:(e,...t)=>e.replace(/%([sdifj])/g,(function(...[e,r]){const n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof i,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:s},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},2955:(e,t,r)=>{const{Buffer:n}=r(8834),{ObjectDefineProperty:i,ObjectKeys:o,ReflectApply:s}=r(1122),{promisify:{custom:a}}=r(2092),{streamReturningOperators:c,promiseReturningOperators:u}=r(1273),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=r(9865),f=r(9732),{pipeline:d}=r(3495),{destroyer:h}=r(2262),p=r(9885),g=r(9419),y=r(2211),m=e.exports=r(3798).Stream;m.isDisturbed=y.isDisturbed,m.isErrored=y.isErrored,m.isReadable=y.isReadable,m.Readable=r(182);for(const w of o(c)){const A=c[w];function b(...e){if(new.target)throw l();return m.Readable.from(s(A,this,e))}i(b,"name",{__proto__:null,value:A.name}),i(b,"length",{__proto__:null,value:A.length}),i(m.Readable.prototype,w,{__proto__:null,value:b,enumerable:!1,configurable:!0,writable:!0})}for(const E of o(u)){const _=u[E];function b(...e){if(new.target)throw l();return s(_,this,e)}i(b,"name",{__proto__:null,value:_.name}),i(b,"length",{__proto__:null,value:_.length}),i(m.Readable.prototype,E,{__proto__:null,value:b,enumerable:!1,configurable:!0,writable:!0})}m.Writable=r(80),m.Duplex=r(2852),m.Transform=r(1112),m.PassThrough=r(4584),m.pipeline=d;const{addAbortSignal:v}=r(3952);m.addAbortSignal=v,m.finished=p,m.destroy=h,m.compose=f,i(m,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>g}),i(d,a,{__proto__:null,enumerable:!0,get:()=>g.pipeline}),i(p,a,{__proto__:null,enumerable:!0,get:()=>g.finished}),m.Stream=m,m._isUint8Array=function(e){return e instanceof Uint8Array},m._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},9419:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:i}=r(1122),{isIterable:o,isNodeStream:s,isWebStream:a}=r(2211),{pipelineImpl:c}=r(3495),{finished:u}=r(9885);r(2955),e.exports={finished:u,pipeline:function(...e){return new i(((t,r)=>{let i,u;const l=e[e.length-1];if(l&&"object"==typeof l&&!s(l)&&!o(l)&&!a(l)){const t=n(e);i=t.signal,u=t.end}c(e,((e,n)=>{e?r(e):t(n)}),{signal:i,end:u})}))}}},7834:(e,t,r)=>{var n=r(8834),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)}},4294:(e,t,r)=>{"use strict";var n=r(7286),i=r(2680),o=r(9500),s=n("%TypeError%"),a=n("%WeakMap%",!0),c=n("%Map%",!0),u=i("WeakMap.prototype.get",!0),l=i("WeakMap.prototype.set",!0),f=i("WeakMap.prototype.has",!0),d=i("Map.prototype.get",!0),h=i("Map.prototype.set",!0),p=i("Map.prototype.has",!0),g=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new s("Side channel does not contain "+o(e))},get:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(e)return u(e,n)}else if(c){if(t)return d(t,n)}else if(r)return function(e,t){var r=g(e,t);return r&&r.value}(r,n)},has:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(e)return f(e,n)}else if(c){if(t)return p(t,n)}else if(r)return function(e,t){return!!g(e,t)}(r,n);return!1},set:function(n,i){a&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new a),l(e,n,i)):c?(t||(t=new c),h(t,n,i)):(r||(r={key:{},next:null}),function(e,t,r){var n=g(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,i))}};return n}},214:(e,t,r)=>{"use strict";var n=r(7834).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},9826:(e,t,r)=>{var n=r(8320);e.exports=function(e){return"string"!=typeof e?e:n(e)?e.slice(2):e}},251:function(e,t,r){var n=r(6396).Buffer;!function(t,r){"use strict";e.exports?e.exports=r():(t.nacl||(t.nacl={}),t.nacl.util=r())}(this,(function(){"use strict";var e={};function t(e){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e))throw new TypeError("invalid encoding")}return e.decodeUTF8=function(e){if("string"!=typeof e)throw new TypeError("expected string");var t,r=unescape(encodeURIComponent(e)),n=new Uint8Array(r.length);for(t=0;t<r.length;t++)n[t]=r.charCodeAt(t);return n},e.encodeUTF8=function(e){var t,r=[];for(t=0;t<e.length;t++)r.push(String.fromCharCode(e[t]));return decodeURIComponent(escape(r.join("")))},"undefined"==typeof atob?void 0!==n.from?(e.encodeBase64=function(e){return n.from(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(n.from(e,"base64"),0))}):(e.encodeBase64=function(e){return new n(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(new n(e,"base64"),0))}):(e.encodeBase64=function(e){var t,r=[],n=e.length;for(t=0;t<n;t++)r.push(String.fromCharCode(e[t]));return btoa(r.join(""))},e.decodeBase64=function(e){t(e);var r,n=atob(e),i=new Uint8Array(n.length);for(r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return i}),e}))},717:(e,t,r)=>{!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),a=t([1]),c=t([56129,1]),u=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),l=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function g(e,t,r,n,i){var o,s=0;for(o=0;o<i;o++)s|=e[t+o]^r[n+o];return(1&s-1>>>8)-1}function y(e,t,r,n){return g(e,t,r,n,16)}function m(e,t,r,n){return g(e,t,r,n,32)}function b(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,y=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,m=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,A=o,E=s,_=a,S=c,x=u,T=l,P=f,I=d,k=h,O=p,C=g,N=y,R=m,B=b,M=v,L=w,F=0;F<20;F+=2)A^=(i=(R^=(i=(k^=(i=(x^=(i=A+R|0)<<7|i>>>25)+A|0)<<9|i>>>23)+x|0)<<13|i>>>19)+k|0)<<18|i>>>14,T^=(i=(E^=(i=(B^=(i=(O^=(i=T+E|0)<<7|i>>>25)+T|0)<<9|i>>>23)+O|0)<<13|i>>>19)+B|0)<<18|i>>>14,C^=(i=(P^=(i=(_^=(i=(M^=(i=C+P|0)<<7|i>>>25)+C|0)<<9|i>>>23)+M|0)<<13|i>>>19)+_|0)<<18|i>>>14,L^=(i=(N^=(i=(I^=(i=(S^=(i=L+N|0)<<7|i>>>25)+L|0)<<9|i>>>23)+S|0)<<13|i>>>19)+I|0)<<18|i>>>14,A^=(i=(S^=(i=(_^=(i=(E^=(i=A+S|0)<<7|i>>>25)+A|0)<<9|i>>>23)+E|0)<<13|i>>>19)+_|0)<<18|i>>>14,T^=(i=(x^=(i=(I^=(i=(P^=(i=T+x|0)<<7|i>>>25)+T|0)<<9|i>>>23)+P|0)<<13|i>>>19)+I|0)<<18|i>>>14,C^=(i=(O^=(i=(k^=(i=(N^=(i=C+O|0)<<7|i>>>25)+C|0)<<9|i>>>23)+N|0)<<13|i>>>19)+k|0)<<18|i>>>14,L^=(i=(M^=(i=(B^=(i=(R^=(i=L+M|0)<<7|i>>>25)+L|0)<<9|i>>>23)+R|0)<<13|i>>>19)+B|0)<<18|i>>>14;A=A+o|0,E=E+s|0,_=_+a|0,S=S+c|0,x=x+u|0,T=T+l|0,P=P+f|0,I=I+d|0,k=k+h|0,O=O+p|0,C=C+g|0,N=N+y|0,R=R+m|0,B=B+b|0,M=M+v|0,L=L+w|0,e[0]=A>>>0&255,e[1]=A>>>8&255,e[2]=A>>>16&255,e[3]=A>>>24&255,e[4]=E>>>0&255,e[5]=E>>>8&255,e[6]=E>>>16&255,e[7]=E>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=S>>>0&255,e[13]=S>>>8&255,e[14]=S>>>16&255,e[15]=S>>>24&255,e[16]=x>>>0&255,e[17]=x>>>8&255,e[18]=x>>>16&255,e[19]=x>>>24&255,e[20]=T>>>0&255,e[21]=T>>>8&255,e[22]=T>>>16&255,e[23]=T>>>24&255,e[24]=P>>>0&255,e[25]=P>>>8&255,e[26]=P>>>16&255,e[27]=P>>>24&255,e[28]=I>>>0&255,e[29]=I>>>8&255,e[30]=I>>>16&255,e[31]=I>>>24&255,e[32]=k>>>0&255,e[33]=k>>>8&255,e[34]=k>>>16&255,e[35]=k>>>24&255,e[36]=O>>>0&255,e[37]=O>>>8&255,e[38]=O>>>16&255,e[39]=O>>>24&255,e[40]=C>>>0&255,e[41]=C>>>8&255,e[42]=C>>>16&255,e[43]=C>>>24&255,e[44]=N>>>0&255,e[45]=N>>>8&255,e[46]=N>>>16&255,e[47]=N>>>24&255,e[48]=R>>>0&255,e[49]=R>>>8&255,e[50]=R>>>16&255,e[51]=R>>>24&255,e[52]=B>>>0&255,e[53]=B>>>8&255,e[54]=B>>>16&255,e[55]=B>>>24&255,e[56]=M>>>0&255,e[57]=M>>>8&255,e[58]=M>>>16&255,e[59]=M>>>24&255,e[60]=L>>>0&255,e[61]=L>>>8&255,e[62]=L>>>16&255,e[63]=L>>>24&255}(e,t,r,n)}function v(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,u=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,g=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,y=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,m=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,b=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,A=0;A<20;A+=2)o^=(i=(m^=(i=(h^=(i=(u^=(i=o+m|0)<<7|i>>>25)+o|0)<<9|i>>>23)+u|0)<<13|i>>>19)+h|0)<<18|i>>>14,l^=(i=(s^=(i=(b^=(i=(p^=(i=l+s|0)<<7|i>>>25)+l|0)<<9|i>>>23)+p|0)<<13|i>>>19)+b|0)<<18|i>>>14,g^=(i=(f^=(i=(a^=(i=(v^=(i=g+f|0)<<7|i>>>25)+g|0)<<9|i>>>23)+v|0)<<13|i>>>19)+a|0)<<18|i>>>14,w^=(i=(y^=(i=(d^=(i=(c^=(i=w+y|0)<<7|i>>>25)+w|0)<<9|i>>>23)+c|0)<<13|i>>>19)+d|0)<<18|i>>>14,o^=(i=(c^=(i=(a^=(i=(s^=(i=o+c|0)<<7|i>>>25)+o|0)<<9|i>>>23)+s|0)<<13|i>>>19)+a|0)<<18|i>>>14,l^=(i=(u^=(i=(d^=(i=(f^=(i=l+u|0)<<7|i>>>25)+l|0)<<9|i>>>23)+f|0)<<13|i>>>19)+d|0)<<18|i>>>14,g^=(i=(p^=(i=(h^=(i=(y^=(i=g+p|0)<<7|i>>>25)+g|0)<<9|i>>>23)+y|0)<<13|i>>>19)+h|0)<<18|i>>>14,w^=(i=(v^=(i=(b^=(i=(m^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+m|0)<<13|i>>>19)+b|0)<<18|i>>>14;e[0]=o>>>0&255,e[1]=o>>>8&255,e[2]=o>>>16&255,e[3]=o>>>24&255,e[4]=l>>>0&255,e[5]=l>>>8&255,e[6]=l>>>16&255,e[7]=l>>>24&255,e[8]=g>>>0&255,e[9]=g>>>8&255,e[10]=g>>>16&255,e[11]=g>>>24&255,e[12]=w>>>0&255,e[13]=w>>>8&255,e[14]=w>>>16&255,e[15]=w>>>24&255,e[16]=f>>>0&255,e[17]=f>>>8&255,e[18]=f>>>16&255,e[19]=f>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=h>>>0&255,e[25]=h>>>8&255,e[26]=h>>>16&255,e[27]=h>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function A(e,t,r,n,i,o,s){var a,c,u=new Uint8Array(16),l=new Uint8Array(64);for(c=0;c<16;c++)u[c]=0;for(c=0;c<8;c++)u[c]=o[c];for(;i>=64;){for(b(l,u,s,w),c=0;c<64;c++)e[t+c]=r[n+c]^l[c];for(a=1,c=8;c<16;c++)a=a+(255&u[c])|0,u[c]=255&a,a>>>=8;i-=64,t+=64,n+=64}if(i>0)for(b(l,u,s,w),c=0;c<i;c++)e[t+c]=r[n+c]^l[c];return 0}function E(e,t,r,n,i){var o,s,a=new Uint8Array(16),c=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=n[s];for(;r>=64;){for(b(c,a,i,w),s=0;s<64;s++)e[t+s]=c[s];for(o=1,s=8;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,t+=64}if(r>0)for(b(c,a,i,w),s=0;s<r;s++)e[t+s]=c[s];return 0}function _(e,t,r,n,i){var o=new Uint8Array(32);v(o,n,i,w);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=n[a+16];return E(e,t,r,s,o)}function S(e,t,r,n,i,o,s){var a=new Uint8Array(32);v(a,o,s,w);for(var c=new Uint8Array(8),u=0;u<8;u++)c[u]=o[u+16];return A(e,t,r,n,i,c,a)}var x=function(e){var t,r,n,i,o,s,a,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,s=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(o>>>14|s<<2),a=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(s>>>11|a<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(a>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function T(e,t,r,n,i,o){var s=new x(o);return s.update(r,n,i),s.finish(e,t),0}function P(e,t,r,n,i,o){var s=new Uint8Array(16);return T(s,0,r,n,i,o),y(e,t,s,0)}function I(e,t,r,n,i){var o;if(r<32)return-1;for(S(e,0,t,0,r,n,i),T(e,16,e,32,r-32,e),o=0;o<16;o++)e[o]=0;return 0}function k(e,t,r,n,i){var o,s=new Uint8Array(32);if(r<32)return-1;if(_(s,0,32,n,i),0!==P(t,16,t,32,r-32,s))return-1;for(S(e,0,t,0,r,n,i),o=0;o<32;o++)e[o]=0;return 0}function O(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function C(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function N(e,t,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function R(e,r){var n,i,o,s=t(),a=t();for(n=0;n<16;n++)a[n]=r[n];for(C(a),C(a),C(a),i=0;i<2;i++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,N(a,s,1-o)}for(n=0;n<16;n++)e[2*n]=255&a[n],e[2*n+1]=a[n]>>8}function B(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return R(r,e),R(n,t),m(r,0,n,0)}function M(e){var t=new Uint8Array(32);return R(t,e),1&t[0]}function L(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function F(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function j(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function U(e,t,r){var n,i,o=0,s=0,a=0,c=0,u=0,l=0,f=0,d=0,h=0,p=0,g=0,y=0,m=0,b=0,v=0,w=0,A=0,E=0,_=0,S=0,x=0,T=0,P=0,I=0,k=0,O=0,C=0,N=0,R=0,B=0,M=0,L=r[0],F=r[1],j=r[2],U=r[3],D=r[4],Z=r[5],H=r[6],$=r[7],G=r[8],z=r[9],V=r[10],W=r[11],q=r[12],K=r[13],J=r[14],Y=r[15];o+=(n=t[0])*L,s+=n*F,a+=n*j,c+=n*U,u+=n*D,l+=n*Z,f+=n*H,d+=n*$,h+=n*G,p+=n*z,g+=n*V,y+=n*W,m+=n*q,b+=n*K,v+=n*J,w+=n*Y,s+=(n=t[1])*L,a+=n*F,c+=n*j,u+=n*U,l+=n*D,f+=n*Z,d+=n*H,h+=n*$,p+=n*G,g+=n*z,y+=n*V,m+=n*W,b+=n*q,v+=n*K,w+=n*J,A+=n*Y,a+=(n=t[2])*L,c+=n*F,u+=n*j,l+=n*U,f+=n*D,d+=n*Z,h+=n*H,p+=n*$,g+=n*G,y+=n*z,m+=n*V,b+=n*W,v+=n*q,w+=n*K,A+=n*J,E+=n*Y,c+=(n=t[3])*L,u+=n*F,l+=n*j,f+=n*U,d+=n*D,h+=n*Z,p+=n*H,g+=n*$,y+=n*G,m+=n*z,b+=n*V,v+=n*W,w+=n*q,A+=n*K,E+=n*J,_+=n*Y,u+=(n=t[4])*L,l+=n*F,f+=n*j,d+=n*U,h+=n*D,p+=n*Z,g+=n*H,y+=n*$,m+=n*G,b+=n*z,v+=n*V,w+=n*W,A+=n*q,E+=n*K,_+=n*J,S+=n*Y,l+=(n=t[5])*L,f+=n*F,d+=n*j,h+=n*U,p+=n*D,g+=n*Z,y+=n*H,m+=n*$,b+=n*G,v+=n*z,w+=n*V,A+=n*W,E+=n*q,_+=n*K,S+=n*J,x+=n*Y,f+=(n=t[6])*L,d+=n*F,h+=n*j,p+=n*U,g+=n*D,y+=n*Z,m+=n*H,b+=n*$,v+=n*G,w+=n*z,A+=n*V,E+=n*W,_+=n*q,S+=n*K,x+=n*J,T+=n*Y,d+=(n=t[7])*L,h+=n*F,p+=n*j,g+=n*U,y+=n*D,m+=n*Z,b+=n*H,v+=n*$,w+=n*G,A+=n*z,E+=n*V,_+=n*W,S+=n*q,x+=n*K,T+=n*J,P+=n*Y,h+=(n=t[8])*L,p+=n*F,g+=n*j,y+=n*U,m+=n*D,b+=n*Z,v+=n*H,w+=n*$,A+=n*G,E+=n*z,_+=n*V,S+=n*W,x+=n*q,T+=n*K,P+=n*J,I+=n*Y,p+=(n=t[9])*L,g+=n*F,y+=n*j,m+=n*U,b+=n*D,v+=n*Z,w+=n*H,A+=n*$,E+=n*G,_+=n*z,S+=n*V,x+=n*W,T+=n*q,P+=n*K,I+=n*J,k+=n*Y,g+=(n=t[10])*L,y+=n*F,m+=n*j,b+=n*U,v+=n*D,w+=n*Z,A+=n*H,E+=n*$,_+=n*G,S+=n*z,x+=n*V,T+=n*W,P+=n*q,I+=n*K,k+=n*J,O+=n*Y,y+=(n=t[11])*L,m+=n*F,b+=n*j,v+=n*U,w+=n*D,A+=n*Z,E+=n*H,_+=n*$,S+=n*G,x+=n*z,T+=n*V,P+=n*W,I+=n*q,k+=n*K,O+=n*J,C+=n*Y,m+=(n=t[12])*L,b+=n*F,v+=n*j,w+=n*U,A+=n*D,E+=n*Z,_+=n*H,S+=n*$,x+=n*G,T+=n*z,P+=n*V,I+=n*W,k+=n*q,O+=n*K,C+=n*J,N+=n*Y,b+=(n=t[13])*L,v+=n*F,w+=n*j,A+=n*U,E+=n*D,_+=n*Z,S+=n*H,x+=n*$,T+=n*G,P+=n*z,I+=n*V,k+=n*W,O+=n*q,C+=n*K,N+=n*J,R+=n*Y,v+=(n=t[14])*L,w+=n*F,A+=n*j,E+=n*U,_+=n*D,S+=n*Z,x+=n*H,T+=n*$,P+=n*G,I+=n*z,k+=n*V,O+=n*W,C+=n*q,N+=n*K,R+=n*J,B+=n*Y,w+=(n=t[15])*L,s+=38*(E+=n*j),a+=38*(_+=n*U),c+=38*(S+=n*D),u+=38*(x+=n*Z),l+=38*(T+=n*H),f+=38*(P+=n*$),d+=38*(I+=n*G),h+=38*(k+=n*z),p+=38*(O+=n*V),g+=38*(C+=n*W),y+=38*(N+=n*q),m+=38*(R+=n*K),b+=38*(B+=n*J),v+=38*(M+=n*Y),o=(n=(o+=38*(A+=n*F))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=d,e[8]=h,e[9]=p,e[10]=g,e[11]=y,e[12]=m,e[13]=b,e[14]=v,e[15]=w}function D(e,t){U(e,t,t)}function Z(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)D(i,i),2!==n&&4!==n&&U(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function H(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)D(i,i),1!==n&&U(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function $(e,r,n){var i,o,s=new Uint8Array(32),a=new Float64Array(80),u=t(),l=t(),f=t(),d=t(),h=t(),p=t();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,L(a,n),o=0;o<16;o++)l[o]=a[o],d[o]=u[o]=f[o]=0;for(u[0]=d[0]=1,o=254;o>=0;--o)N(u,l,i=s[o>>>3]>>>(7&o)&1),N(f,d,i),F(h,u,f),j(u,u,f),F(f,l,d),j(l,l,d),D(d,h),D(p,u),U(u,f,u),U(f,l,h),F(h,u,f),j(u,u,f),D(l,u),j(f,d,p),U(u,f,c),F(u,u,d),U(f,f,u),U(u,d,p),U(d,l,a),D(l,h),N(u,l,i),N(f,d,i);for(o=0;o<16;o++)a[o+16]=u[o],a[o+32]=f[o],a[o+48]=l[o],a[o+64]=d[o];var g=a.subarray(32),y=a.subarray(16);return Z(g,g),U(y,y,g),R(e,y),0}function G(e,t){return $(e,t,o)}function z(e,t){return n(t,32),G(e,t)}function V(e,t,r){var n=new Uint8Array(32);return $(n,r,t),v(e,i,n,w)}x.prototype.blocks=function(e,t,r){for(var n,i,o,s,a,c,u,l,f,d,h,p,g,y,m,b,v,w,A,E=this.fin?0:2048,_=this.h[0],S=this.h[1],x=this.h[2],T=this.h[3],P=this.h[4],I=this.h[5],k=this.h[6],O=this.h[7],C=this.h[8],N=this.h[9],R=this.r[0],B=this.r[1],M=this.r[2],L=this.r[3],F=this.r[4],j=this.r[5],U=this.r[6],D=this.r[7],Z=this.r[8],H=this.r[9];r>=16;)d=f=0,d+=(_+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*R,d+=(S+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*H),d+=(x+=8191&(i>>>10|(o=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*Z),d+=(T+=8191&(o>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*D),f=(d+=(P+=8191&(s>>>4|(a=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*U))>>>13,d&=8191,d+=(I+=a>>>1&8191)*(5*j),d+=(k+=8191&(a>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*F),d+=(O+=8191&(c>>>11|(u=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*L),d+=(C+=8191&(u>>>8|(l=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*M),h=f+=(d+=(N+=l>>>5|E)*(5*B))>>>13,h+=_*B,h+=S*R,h+=x*(5*H),h+=T*(5*Z),f=(h+=P*(5*D))>>>13,h&=8191,h+=I*(5*U),h+=k*(5*j),h+=O*(5*F),h+=C*(5*L),f+=(h+=N*(5*M))>>>13,h&=8191,p=f,p+=_*M,p+=S*B,p+=x*R,p+=T*(5*H),f=(p+=P*(5*Z))>>>13,p&=8191,p+=I*(5*D),p+=k*(5*U),p+=O*(5*j),p+=C*(5*F),g=f+=(p+=N*(5*L))>>>13,g+=_*L,g+=S*M,g+=x*B,g+=T*R,f=(g+=P*(5*H))>>>13,g&=8191,g+=I*(5*Z),g+=k*(5*D),g+=O*(5*U),g+=C*(5*j),y=f+=(g+=N*(5*F))>>>13,y+=_*F,y+=S*L,y+=x*M,y+=T*B,f=(y+=P*R)>>>13,y&=8191,y+=I*(5*H),y+=k*(5*Z),y+=O*(5*D),y+=C*(5*U),m=f+=(y+=N*(5*j))>>>13,m+=_*j,m+=S*F,m+=x*L,m+=T*M,f=(m+=P*B)>>>13,m&=8191,m+=I*R,m+=k*(5*H),m+=O*(5*Z),m+=C*(5*D),b=f+=(m+=N*(5*U))>>>13,b+=_*U,b+=S*j,b+=x*F,b+=T*L,f=(b+=P*M)>>>13,b&=8191,b+=I*B,b+=k*R,b+=O*(5*H),b+=C*(5*Z),v=f+=(b+=N*(5*D))>>>13,v+=_*D,v+=S*U,v+=x*j,v+=T*F,f=(v+=P*L)>>>13,v&=8191,v+=I*M,v+=k*B,v+=O*R,v+=C*(5*H),w=f+=(v+=N*(5*Z))>>>13,w+=_*Z,w+=S*D,w+=x*U,w+=T*j,f=(w+=P*F)>>>13,w&=8191,w+=I*L,w+=k*M,w+=O*B,w+=C*R,A=f+=(w+=N*(5*H))>>>13,A+=_*H,A+=S*Z,A+=x*D,A+=T*U,f=(A+=P*j)>>>13,A&=8191,A+=I*F,A+=k*L,A+=O*M,A+=C*B,_=d=8191&(f=(f=((f+=(A+=N*R)>>>13)<<2)+f|0)+(d&=8191)|0),S=h+=f>>>=13,x=p&=8191,T=g&=8191,P=y&=8191,I=m&=8191,k=b&=8191,O=v&=8191,C=w&=8191,N=A&=8191,t+=16,r-=16;this.h[0]=_,this.h[1]=S,this.h[2]=x,this.h[3]=T,this.h[4]=P,this.h[5]=I,this.h[6]=k,this.h[7]=O,this.h[8]=C,this.h[9]=N},x.prototype.finish=function(e,t){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},x.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var W=I,q=k,K=[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 J(e,t,r,n){for(var i,o,s,a,c,u,l,f,d,h,p,g,y,m,b,v,w,A,E,_,S,x,T,P,I,k,O=new Int32Array(16),C=new Int32Array(16),N=e[0],R=e[1],B=e[2],M=e[3],L=e[4],F=e[5],j=e[6],U=e[7],D=t[0],Z=t[1],H=t[2],$=t[3],G=t[4],z=t[5],V=t[6],W=t[7],q=0;n>=128;){for(E=0;E<16;E++)_=8*E+q,O[E]=r[_+0]<<24|r[_+1]<<16|r[_+2]<<8|r[_+3],C[E]=r[_+4]<<24|r[_+5]<<16|r[_+6]<<8|r[_+7];for(E=0;E<80;E++)if(i=N,o=R,s=B,a=M,c=L,u=F,l=j,d=D,h=Z,p=H,g=$,y=G,m=z,b=V,T=65535&(x=W),P=x>>>16,I=65535&(S=U),k=S>>>16,T+=65535&(x=(G>>>14|L<<18)^(G>>>18|L<<14)^(L>>>9|G<<23)),P+=x>>>16,I+=65535&(S=(L>>>14|G<<18)^(L>>>18|G<<14)^(G>>>9|L<<23)),k+=S>>>16,T+=65535&(x=G&z^~G&V),P+=x>>>16,I+=65535&(S=L&F^~L&j),k+=S>>>16,S=K[2*E],T+=65535&(x=K[2*E+1]),P+=x>>>16,I+=65535&S,k+=S>>>16,S=O[E%16],P+=(x=C[E%16])>>>16,I+=65535&S,k+=S>>>16,I+=(P+=(T+=65535&x)>>>16)>>>16,T=65535&(x=A=65535&T|P<<16),P=x>>>16,I=65535&(S=w=65535&I|(k+=I>>>16)<<16),k=S>>>16,T+=65535&(x=(D>>>28|N<<4)^(N>>>2|D<<30)^(N>>>7|D<<25)),P+=x>>>16,I+=65535&(S=(N>>>28|D<<4)^(D>>>2|N<<30)^(D>>>7|N<<25)),k+=S>>>16,P+=(x=D&Z^D&H^Z&H)>>>16,I+=65535&(S=N&R^N&B^R&B),k+=S>>>16,f=65535&(I+=(P+=(T+=65535&x)>>>16)>>>16)|(k+=I>>>16)<<16,v=65535&T|P<<16,T=65535&(x=g),P=x>>>16,I=65535&(S=a),k=S>>>16,P+=(x=A)>>>16,I+=65535&(S=w),k+=S>>>16,R=i,B=o,M=s,L=a=65535&(I+=(P+=(T+=65535&x)>>>16)>>>16)|(k+=I>>>16)<<16,F=c,j=u,U=l,N=f,Z=d,H=h,$=p,G=g=65535&T|P<<16,z=y,V=m,W=b,D=v,E%16==15)for(_=0;_<16;_++)S=O[_],T=65535&(x=C[_]),P=x>>>16,I=65535&S,k=S>>>16,S=O[(_+9)%16],T+=65535&(x=C[(_+9)%16]),P+=x>>>16,I+=65535&S,k+=S>>>16,w=O[(_+1)%16],T+=65535&(x=((A=C[(_+1)%16])>>>1|w<<31)^(A>>>8|w<<24)^(A>>>7|w<<25)),P+=x>>>16,I+=65535&(S=(w>>>1|A<<31)^(w>>>8|A<<24)^w>>>7),k+=S>>>16,w=O[(_+14)%16],P+=(x=((A=C[(_+14)%16])>>>19|w<<13)^(w>>>29|A<<3)^(A>>>6|w<<26))>>>16,I+=65535&(S=(w>>>19|A<<13)^(A>>>29|w<<3)^w>>>6),k+=S>>>16,k+=(I+=(P+=(T+=65535&x)>>>16)>>>16)>>>16,O[_]=65535&I|k<<16,C[_]=65535&T|P<<16;T=65535&(x=D),P=x>>>16,I=65535&(S=N),k=S>>>16,S=e[0],P+=(x=t[0])>>>16,I+=65535&S,k+=S>>>16,k+=(I+=(P+=(T+=65535&x)>>>16)>>>16)>>>16,e[0]=N=65535&I|k<<16,t[0]=D=65535&T|P<<16,T=65535&(x=Z),P=x>>>16,I=65535&(S=R),k=S>>>16,S=e[1],P+=(x=t[1])>>>16,I+=65535&S,k+=S>>>16,k+=(I+=(P+=(T+=65535&x)>>>16)>>>16)>>>16,e[1]=R=65535&I|k<<16,t[1]=Z=65535&T|P<<16,T=65535&(x=H),P=x>>>16,I=65535&(S=B),k=S>>>16,S=e[2],P+=(x=t[2])>>>16,I+=65535&S,k+=S>>>16,k+=(I+=(P+=(T+=65535&x)>>>16)>>>16)>>>16,e[2]=B=65535&I|k<<16,t[2]=H=65535&T|P<<16,T=65535&(x=$),P=x>>>16,I=65535&(S=M),k=S>>>16,S=e[3],P+=(x=t[3])>>>16,I+=65535&S,k+=S>>>16,k+=(I+=(P+=(T+=65535&x)>>>16)>>>16)>>>16,e[3]=M=65535&I|k<<16,t[3]=$=65535&T|P<<16,T=65535&(x=G),P=x>>>16,I=65535&(S=L),k=S>>>16,S=e[4],P+=(x=t[4])>>>16,I+=65535&S,k+=S>>>16,k+=(I+=(P+=(T+=65535&x)>>>16)>>>16)>>>16,e[4]=L=65535&I|k<<16,t[4]=G=65535&T|P<<16,T=65535&(x=z),P=x>>>16,I=65535&(S=F),k=S>>>16,S=e[5],P+=(x=t[5])>>>16,I+=65535&S,k+=S>>>16,k+=(I+=(P+=(T+=65535&x)>>>16)>>>16)>>>16,e[5]=F=65535&I|k<<16,t[5]=z=65535&T|P<<16,T=65535&(x=V),P=x>>>16,I=65535&(S=j),k=S>>>16,S=e[6],P+=(x=t[6])>>>16,I+=65535&S,k+=S>>>16,k+=(I+=(P+=(T+=65535&x)>>>16)>>>16)>>>16,e[6]=j=65535&I|k<<16,t[6]=V=65535&T|P<<16,T=65535&(x=W),P=x>>>16,I=65535&(S=U),k=S>>>16,S=e[7],P+=(x=t[7])>>>16,I+=65535&S,k+=S>>>16,k+=(I+=(P+=(T+=65535&x)>>>16)>>>16)>>>16,e[7]=U=65535&I|k<<16,t[7]=W=65535&T|P<<16,q+=128,n-=128}return n}function Y(e,t,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,J(i,o,t,r),r%=128,n=0;n<r;n++)s[n]=t[a-r+n];for(s[r]=128,s[(r=256-128*(r<112?1:0))-9]=0,p(s,r-8,a/536870912|0,a<<3),J(i,o,s,r),n=0;n<8;n++)p(e,8*n,i[n],o[n]);return 0}function Q(e,r){var n=t(),i=t(),o=t(),s=t(),a=t(),c=t(),u=t(),f=t(),d=t();j(n,e[1],e[0]),j(d,r[1],r[0]),U(n,n,d),F(i,e[0],e[1]),F(d,r[0],r[1]),U(i,i,d),U(o,e[3],r[3]),U(o,o,l),U(s,e[2],r[2]),F(s,s,s),j(a,i,n),j(c,s,o),F(u,s,o),F(f,i,n),U(e[0],a,c),U(e[1],f,u),U(e[2],u,c),U(e[3],a,f)}function X(e,t,r){var n;for(n=0;n<4;n++)N(e[n],t[n],r)}function ee(e,r){var n=t(),i=t(),o=t();Z(o,r[2]),U(n,r[0],o),U(i,r[1],o),R(e,i),e[31]^=M(n)<<7}function te(e,t,r){var n,i;for(O(e[0],s),O(e[1],a),O(e[2],a),O(e[3],s),i=255;i>=0;--i)X(e,t,n=r[i/8|0]>>(7&i)&1),Q(t,e),Q(e,e),X(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];O(n[0],f),O(n[1],d),O(n[2],a),U(n[3],f,d),te(e,n,r)}function ne(e,r,i){var o,s=new Uint8Array(64),a=[t(),t(),t(),t()];for(i||n(r,32),Y(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,re(a,s),ee(e,a),o=0;o<32;o++)r[o+32]=e[o];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function oe(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*ie[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*ie[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ie[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function se(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;oe(e,r)}function ae(e,r,n,i){var o,s,a=new Uint8Array(64),c=new Uint8Array(64),u=new Uint8Array(64),l=new Float64Array(64),f=[t(),t(),t(),t()];Y(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var d=n+64;for(o=0;o<n;o++)e[64+o]=r[o];for(o=0;o<32;o++)e[32+o]=a[32+o];for(Y(u,e.subarray(32),n+32),se(u),re(f,u),ee(e,f),o=32;o<64;o++)e[o]=i[o];for(Y(c,e,n+64),se(c),o=0;o<64;o++)l[o]=0;for(o=0;o<32;o++)l[o]=u[o];for(o=0;o<32;o++)for(s=0;s<32;s++)l[o+s]+=c[o]*a[s];return oe(e.subarray(32),l),d}function ce(e,r,n,i){var o,c=new Uint8Array(32),l=new Uint8Array(64),f=[t(),t(),t(),t()],d=[t(),t(),t(),t()];if(n<64)return-1;if(function(e,r){var n=t(),i=t(),o=t(),c=t(),l=t(),f=t(),d=t();return O(e[2],a),L(e[1],r),D(o,e[1]),U(c,o,u),j(o,o,e[2]),F(c,e[2],c),D(l,c),D(f,l),U(d,f,l),U(n,d,o),U(n,n,c),H(n,n),U(n,n,o),U(n,n,c),U(n,n,c),U(e[0],n,c),D(i,e[0]),U(i,i,c),B(i,o)&&U(e[0],e[0],h),D(i,e[0]),U(i,i,c),B(i,o)?-1:(M(e[0])===r[31]>>7&&j(e[0],s,e[0]),U(e[3],e[0],e[1]),0)}(d,i))return-1;for(o=0;o<n;o++)e[o]=r[o];for(o=0;o<32;o++)e[o+32]=i[o];if(Y(l,e,n),se(l),te(f,d,l),re(d,r.subarray(32)),Q(f,d),ee(c,f),n-=64,m(r,0,c,0)){for(o=0;o<n;o++)e[o]=0;return-1}for(o=0;o<n;o++)e[o]=r[o+64];return n}var ue=64,le=32,fe=64;function de(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function he(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function pe(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:v,crypto_stream_xor:S,crypto_stream:_,crypto_stream_salsa20_xor:A,crypto_stream_salsa20:E,crypto_onetimeauth:T,crypto_onetimeauth_verify:P,crypto_verify_16:y,crypto_verify_32:m,crypto_secretbox:I,crypto_secretbox_open:k,crypto_scalarmult:$,crypto_scalarmult_base:G,crypto_box_beforenm:V,crypto_box_afternm:W,crypto_box:function(e,t,r,n,i,o){var s=new Uint8Array(32);return V(s,i,o),W(e,t,r,n,s)},crypto_box_open:function(e,t,r,n,i,o){var s=new Uint8Array(32);return V(s,i,o),q(e,t,r,n,s)},crypto_box_keypair:z,crypto_hash:Y,crypto_sign:ae,crypto_sign_keypair:ne,crypto_sign_open:ce,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ue,crypto_sign_PUBLICKEYBYTES:le,crypto_sign_SECRETKEYBYTES:fe,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:u,L:ie,pack25519:R,unpack25519:L,M:U,A:F,S:D,Z:j,pow2523:H,add:Q,set25519:O,modL:oe,scalarmult:te,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,r){he(e,t,r),de(r,t);for(var n=new Uint8Array(32+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+32]=e[o];return I(i,n,n.length,t,r),i.subarray(16)},e.secretbox.open=function(e,t,r){he(e,t,r),de(r,t);for(var n=new Uint8Array(16+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+16]=e[o];return n.length<32||0!==k(i,n,n.length,t,r)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(he(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return $(r,e,t),r},e.scalarMult.base=function(e){if(he(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return G(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox(t,r,o)},e.box.before=function(e,t){he(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return V(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox.open(t,r,o)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return z(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(he(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return G(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(he(e,t),t.length!==fe)throw new Error("bad secret key size");var r=new Uint8Array(ue+e.length);return ae(r,e,e.length,t),r},e.sign.open=function(e,t){if(he(e,t),t.length!==le)throw new Error("bad public key size");var r=new Uint8Array(e.length),n=ce(r,e,e.length,t);if(n<0)return null;for(var i=new Uint8Array(n),o=0;o<i.length;o++)i[o]=r[o];return i},e.sign.detached=function(t,r){for(var n=e.sign(t,r),i=new Uint8Array(ue),o=0;o<i.length;o++)i[o]=n[o];return i},e.sign.detached.verify=function(e,t,r){if(he(e,t,r),t.length!==ue)throw new Error("bad signature size");if(r.length!==le)throw new Error("bad public key size");var n,i=new Uint8Array(ue+e.length),o=new Uint8Array(ue+e.length);for(n=0;n<ue;n++)i[n]=t[n];for(n=0;n<e.length;n++)i[n+ue]=e[n];return ce(o,i,i.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(le),t=new Uint8Array(fe);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(he(e),e.length!==fe)throw new Error("bad secret key size");for(var t=new Uint8Array(le),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(he(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(le),r=new Uint8Array(fe),n=0;n<32;n++)r[n]=e[n];return ne(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=le,e.sign.secretKeyLength=fe,e.sign.seedLength=32,e.sign.signatureLength=ue,e.hash=function(e){he(e);var t=new Uint8Array(64);return Y(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return he(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===g(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=i[n];pe(i)})):(t=r(5338))&&t.randomBytes&&e.setPRNG((function(e,r){var n,i=t.randomBytes(r);for(n=0;n<r;n++)e[n]=i[n];pe(i)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},9639:function(e,t,r){var n;e=r.nmd(e),function(i){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var s,a=2147483647,c=36,u=26,l=38,f=700,d=/^xn--/,h=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=c-1,m=Math.floor,b=String.fromCharCode;function v(e){throw new RangeError(g[e])}function w(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function A(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+w((e=e.replace(p,".")).split("."),t).join(".")}function E(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function _(e){return w(e,(function(e){var t="";return e>65535&&(t+=b((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+b(e)})).join("")}function S(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?m(e/f):e>>1,e+=m(e/t);e>y*u>>1;n+=c)e=m(e/y);return m(n+(y+1)*e/(e+l))}function T(e){var t,r,n,i,o,s,l,f,d,h,p,g=[],y=e.length,b=0,w=128,A=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&v("not-basic"),g.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<y;){for(o=b,s=1,l=c;i>=y&&v("invalid-input"),((f=(p=e.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:c)>=c||f>m((a-b)/s))&&v("overflow"),b+=f*s,!(f<(d=l<=A?1:l>=A+u?u:l-A));l+=c)s>m(a/(h=c-d))&&v("overflow"),s*=h;A=x(b-o,t=g.length+1,0==o),m(b/t)>a-w&&v("overflow"),w+=m(b/t),b%=t,g.splice(b++,0,w)}return _(g)}function P(e){var t,r,n,i,o,s,l,f,d,h,p,g,y,w,A,_=[];for(g=(e=E(e)).length,t=128,r=0,o=72,s=0;s<g;++s)(p=e[s])<128&&_.push(b(p));for(n=i=_.length,i&&_.push("-");n<g;){for(l=a,s=0;s<g;++s)(p=e[s])>=t&&p<l&&(l=p);for(l-t>m((a-r)/(y=n+1))&&v("overflow"),r+=(l-t)*y,t=l,s=0;s<g;++s)if((p=e[s])<t&&++r>a&&v("overflow"),p==t){for(f=r,d=c;!(f<(h=d<=o?1:d>=o+u?u:d-o));d+=c)A=f-h,w=c-h,_.push(b(S(h+A%w,0))),f=m(A/w);_.push(b(S(f,0))),o=x(r,y,n==i),r=0,++n}++r,++t}return _.join("")}s={version:"1.4.1",ucs2:{decode:E,encode:_},decode:T,encode:P,toASCII:function(e){return A(e,(function(e){return h.test(e)?"xn--"+P(e):e}))},toUnicode:function(e){return A(e,(function(e){return d.test(e)?T(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},883:(e,t,r)=>{"use strict";var n=r(9639);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),l=["%","/","?",";","#"].concat(u),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(9126);function b(e,t,r){if(e&&"object"==typeof e&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var b=e=c.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var v=a.exec(b);if(v)return this.path=b,this.href=b,this.pathname=v[1],v[2]?(this.search=v[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=o.exec(b);if(w){var A=(w=w[0]).toLowerCase();this.protocol=A,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@/]+@[^@/]+/)){var E="//"===b.substr(0,2);!E||w&&g[w]||(b=b.substr(2),this.slashes=!0)}if(!g[w]&&(E||w&&!y[w])){for(var _,S,x=-1,T=0;T<f.length;T++)-1!==(P=b.indexOf(f[T]))&&(-1===x||P<x)&&(x=P);for(-1!==(S=-1===x?b.lastIndexOf("@"):b.lastIndexOf("@",x))&&(_=b.slice(0,S),b=b.slice(S+1),this.auth=decodeURIComponent(_)),x=-1,T=0;T<l.length;T++){var P;-1!==(P=b.indexOf(l[T]))&&(-1===x||P<x)&&(x=P)}-1===x&&(x=b.length),this.host=b.slice(0,x),b=b.slice(x),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var k=this.hostname.split(/\./),O=(T=0,k.length);T<O;T++){var C=k[T];if(C&&!C.match(d)){for(var N="",R=0,B=C.length;R<B;R++)C.charCodeAt(R)>127?N+="x":N+=C[R];if(!N.match(d)){var M=k.slice(0,T),L=k.slice(T+1),F=C.match(h);F&&(M.push(F[1]),L.unshift(F[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=n.toASCII(this.hostname));var j=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+j,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!p[A])for(T=0,O=u.length;T<O;T++){var D=u[T];if(-1!==b.indexOf(D)){var Z=encodeURIComponent(D);Z===D&&(Z=escape(D)),b=b.split(D).join(Z)}}var H=b.indexOf("#");-1!==H&&(this.hash=b.substr(H),b=b.slice(0,H));var $=b.indexOf("?");if(-1!==$?(this.search=b.substr($),this.query=b.substr($+1),t&&(this.query=m.parse(this.query)),b=b.slice(0,$)):t&&(this.search="",this.query={}),b&&(this.pathname=b),y[A]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){j=this.pathname||"";var G=this.search||"";this.path=j+G}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(o=m.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},i.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if("string"==typeof e){var t=new i;t.parse(e,!1,!0),e=t}for(var r=new i,n=Object.keys(this),o=0;o<n.length;o++){var s=n[o];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),c=0;c<a.length;c++){var u=a[c];"protocol"!==u&&(r[u]=e[u])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!y[e.protocol]){for(var l=Object.keys(e),f=0;f<l.length;f++){var d=l[f];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||g[e.protocol])r.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),r.pathname=h.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var p=r.pathname||"",m=r.search||"";r.path=p+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=v||b||r.host&&e.pathname,A=w,E=r.pathname&&r.pathname.split("/")||[],_=(h=e.pathname&&e.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(_&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),w=w&&(""===h[0]||""===E[0])),v)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,E=h;else if(h.length)E||(E=[]),E.pop(),E=E.concat(h),r.search=e.search,r.query=e.query;else if(null!=e.search)return _&&(r.host=E.shift(),r.hostname=r.host,(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.hostname=I.shift(),r.host=r.hostname)),r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=E.slice(-1)[0],x=(r.host||e.host||E.length>1)&&("."===S||".."===S)||""===S,T=0,P=E.length;P>=0;P--)"."===(S=E[P])?E.splice(P,1):".."===S?(E.splice(P,1),T++):T&&(E.splice(P,1),T--);if(!w&&!A)for(;T--;T)E.unshift("..");!w||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),x&&"/"!==E.join("/").substr(-1)&&E.push("");var I,k=""===E[0]||E[0]&&"/"===E[0].charAt(0);return _&&(r.hostname=k?"":E.length?E.shift():"",r.host=r.hostname,(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.hostname=I.shift(),r.host=r.hostname)),(w=w||r.host&&E.length)&&!k&&E.unshift(""),E.length>0?r.pathname=E.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=b(e)),e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i},82:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},4895:(e,t,r)=>{"use strict";var n=r(2635),i=r(3138),o=r(2094),s=r(198);function a(e){return e.call.bind(e)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,l=a(Object.prototype.toString),f=a(Number.prototype.valueOf),d=a(String.prototype.valueOf),h=a(Boolean.prototype.valueOf);if(c)var p=a(BigInt.prototype.valueOf);if(u)var g=a(Symbol.prototype.valueOf);function y(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===l(e)}function b(e){return"[object Set]"===l(e)}function v(e){return"[object WeakMap]"===l(e)}function w(e){return"[object WeakSet]"===l(e)}function A(e){return"[object ArrayBuffer]"===l(e)}function E(e){return"undefined"!=typeof ArrayBuffer&&(A.working?A(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===l(e)}function S(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||S(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(v.working?v(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},A.working="undefined"!=typeof ArrayBuffer&&A(new ArrayBuffer),t.isArrayBuffer=E,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=S;var x="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(e){return"[object SharedArrayBuffer]"===l(e)}function P(e){return void 0!==x&&(void 0===T.working&&(T.working=T(new x)),T.working?T(e):e instanceof x)}function I(e){return y(e,f)}function k(e){return y(e,d)}function O(e){return y(e,h)}function C(e){return c&&y(e,p)}function N(e){return u&&y(e,g)}t.isSharedArrayBuffer=P,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=I,t.isStringObject=k,t.isBooleanObject=O,t.isBigIntObject=C,t.isSymbolObject=N,t.isBoxedPrimitive=function(e){return I(e)||k(e)||O(e)||C(e)||N(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(E(e)||P(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},3335:(e,t,r)=>{var n=r(4406),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},o=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(e).replace(o,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r<i;a=n[++r])m(a)||!E(a)?s+=" "+a:s+=" "+u(a);return s},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}};var s={},a=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+c+"$","i")}function u(e,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),d(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function f(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&x(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return v(i)||(i=d(e,i,n)),i}var o=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),S(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(r);if(0===s.length){if(x(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(A(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(S(r))return h(r)}var u,l="",f=!1,E=["{","}"];return g(r)&&(f=!0,E=["[","]"]),x(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),A(r)&&(l=" "+RegExp.prototype.toString.call(r)),_(r)&&(l=" "+Date.prototype.toUTCString.call(r)),S(r)&&(l=" "+h(r)),0!==s.length||f&&0!=r.length?n<0?A(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=f?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)k(t,String(s))?o.push(p(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(p(e,t,r,n,i,!0))})),o}(e,r,n,a,s):s.map((function(t){return p(e,r,n,a,t,f)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(u,l,E)):E[0]+l+E[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,o){var s,a,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),k(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(c.value)<0?(a=m(r)?d(e,c.value,null):d(e,c.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function g(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function m(e){return null===e}function b(e){return"number"==typeof e}function v(e){return"string"==typeof e}function w(e){return void 0===e}function A(e){return E(e)&&"[object RegExp]"===T(e)}function E(e){return"object"==typeof e&&null!==e}function _(e){return E(e)&&"[object Date]"===T(e)}function S(e){return E(e)&&("[object Error]"===T(e)||e instanceof Error)}function x(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function P(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(a.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(4895),t.isArray=g,t.isBoolean=y,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=A,t.types.isRegExp=A,t.isObject=E,t.isDate=_,t.types.isDate=_,t.isError=S,t.types.isNativeError=S,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(82);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[P((e=new Date).getHours()),P(e.getMinutes()),P(e.getSeconds())].join(":"),[e.getDate(),I[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(1285),t._extend=function(e,t){if(!t||!E(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var O="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(O&&e[O]){var t;if("function"!=typeof(t=e[O]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,O,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),O&&Object.defineProperty(t,O,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=O,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(s.bind(null,null,e))}),(function(e){n.nextTick(C.bind(null,e,s))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},2094:(e,t,r)=>{"use strict";var n=r(3243),i=r(2191),o=r(9429),s=r(2680),a=r(326),c=s("Object.prototype.toString"),u=r(7226)(),l="undefined"==typeof globalThis?r.g:globalThis,f=i(),d=s("String.prototype.slice"),h=Object.getPrototypeOf,p=s("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},g={__proto__:null};n(f,u&&a&&h?function(e){var t=new l[e];if(Symbol.toStringTag in t){var r=h(t),n=a(r,Symbol.toStringTag);if(!n){var i=h(r);n=a(i,Symbol.toStringTag)}g["$"+e]=o(n.get)}}:function(e){var t=new l[e];g["$"+e]=o(t.slice)}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var t=d(c(e),8,-1);return p(f,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(g,(function(r,n){if(!t)try{r(e),t=d(n,1)}catch(e){}})),t}(e)}return a?function(e){var t=!1;return n(g,(function(r,n){if(!t)try{"$"+r(e)===n&&(t=d(n,1))}catch(e){}})),t}(e):null}},8892:e=>{e.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((function(e){n[e]=i[e]})),n}}},9505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OPEN_BROADCAST_CHANNELS=t.BroadcastChannel=void 0,t.enforceOptions=function(e){a=e};var n=r(1366),i=r(1233),o=r(824),s=new Set;t.OPEN_BROADCAST_CHANNELS=s;var a,c=0,u=function(e,t){var r,u;this.id=c++,s.add(this),this.name=e,a&&(t=a),this.options=(0,o.fillOptionsWithDefaults)(t),this.method=(0,i.chooseMethod)(this.options),this._iL=!1,this._onML=null,this._addEL={message:[],internal:[]},this._uMP=new Set,this._befC=[],this._prepP=null,u=(r=this).method.create(r.name,r.options),(0,n.isPromise)(u)?(r._prepP=u,u.then((function(e){r._state=e}))):r._state=u};function l(e,t,r){var i={time:e.method.microSeconds(),type:t,data:r};return(e._prepP?e._prepP:n.PROMISE_RESOLVED_VOID).then((function(){var t=e.method.postMessage(e._state,i);return e._uMP.add(t),t.catch().then((function(){return e._uMP.delete(t)})),t}))}function f(e){return e._addEL.message.length>0||e._addEL.internal.length>0}function d(e,t,r){e._addEL[t].push(r),function(e){if(!e._iL&&f(e)){var t=function(t){e._addEL[t.type].forEach((function(r){var n=r.time-1e5;(t.time>=n||"server"===e.method.type)&&r.fn(t.data)}))},r=e.method.microSeconds();e._prepP?e._prepP.then((function(){e._iL=!0,e.method.onMessage(e._state,t,r)})):(e._iL=!0,e.method.onMessage(e._state,t,r))}}(e)}function h(e,t,r){e._addEL[t]=e._addEL[t].filter((function(e){return e!==r})),function(e){if(e._iL&&!f(e)){e._iL=!1;var t=e.method.microSeconds();e.method.onMessage(e._state,null,t)}}(e)}t.BroadcastChannel=u,u._pubkey=!0,u.prototype={postMessage:function(e){if(this.closed)throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed "+JSON.stringify(e));return l(this,"message",e)},postInternal:function(e){return l(this,"internal",e)},set onmessage(e){var t={time:this.method.microSeconds(),fn:e};h(this,"message",this._onML),e&&"function"==typeof e?(this._onML=t,d(this,"message",t)):this._onML=null},addEventListener:function(e,t){d(this,e,{time:this.method.microSeconds(),fn:t})},removeEventListener:function(e,t){h(this,e,this._addEL[e].find((function(e){return e.fn===t})))},close:function(){var e=this;if(!this.closed){s.delete(this),this.closed=!0;var t=this._prepP?this._prepP:n.PROMISE_RESOLVED_VOID;return this._onML=null,this._addEL.message=[],t.then((function(){return Promise.all(Array.from(e._uMP))})).then((function(){return Promise.all(e._befC.map((function(e){return e()})))})).then((function(){return e.method.close(e._state)}))}},get type(){return this.method.type},get isClosed(){return this.closed}}},7501:(e,t,r)=>{"use strict";var n=r(945);e.exports={BroadcastChannel:n.BroadcastChannel,enforceOptions:n.enforceOptions}},945:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BroadcastChannel",{enumerable:!0,get:function(){return n.BroadcastChannel}}),Object.defineProperty(t,"OPEN_BROADCAST_CHANNELS",{enumerable:!0,get:function(){return n.OPEN_BROADCAST_CHANNELS}}),Object.defineProperty(t,"enforceOptions",{enumerable:!0,get:function(){return n.enforceOptions}});var n=r(9505)},1233:(e,t,r)=>{"use strict";var n=r(1600);Object.defineProperty(t,"__esModule",{value:!0}),t.chooseMethod=function(e){var t=[].concat(e.methods,u).filter(Boolean);if(e.type){if("simulate"===e.type)return c.default;var r=t.find((function(t){return t.type===e.type}));if(r)return r;throw new Error("method-type "+e.type+" not found")}e.webWorkerSupport||(t=t.filter((function(e){return"idb"!==e.type})));var n=t.find((function(t){return t.canBeUsed(e)}));if(n)return n;throw new Error("No useable method found in "+JSON.stringify(u.map((function(e){return e.type}))))};var i=n(r(2199)),o=n(r(6721)),s=n(r(3699)),a=n(r(2269)),c=n(r(8765)),u=[i.default,o.default,s.default,a.default]},6721:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TRANSACTION_SETTINGS=void 0,t.averageResponseTime=x,t.canBeUsed=S,t.cleanOldMessages=m,t.close=A,t.commitIndexedDBTransaction=f,t.create=b,t.createDatabase=d,t.default=void 0,t.getAllMessages=function(e){var t=e.transaction(c,"readonly",u),r=t.objectStore(c),n=[];return new Promise((function(e){r.openCursor().onsuccess=function(r){var i=r.target.result;i?(n.push(i.value),i.continue()):(f(t),e(n))}}))},t.getIdb=l,t.getMessagesHigherThan=p,t.getOldMessages=y,t.microSeconds=void 0,t.onMessage=_,t.postMessage=E,t.removeMessagesById=g,t.type=void 0,t.writeMessage=h;var n=r(1366),i=r(4626),o=r(824),s=n.microSeconds;t.microSeconds=s;var a="pubkey.broadcast-channel-0-",c="messages",u={durability:"relaxed"};function l(){if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof window){if(void 0!==window.mozIndexedDB)return window.mozIndexedDB;if(void 0!==window.webkitIndexedDB)return window.webkitIndexedDB;if(void 0!==window.msIndexedDB)return window.msIndexedDB}return!1}function f(e){e.commit&&e.commit()}function d(e){var t=l(),r=a+e,n=t.open(r);return n.onupgradeneeded=function(e){e.target.result.createObjectStore(c,{keyPath:"id",autoIncrement:!0})},new Promise((function(e,t){n.onerror=function(e){return t(e)},n.onsuccess=function(){e(n.result)}}))}function h(e,t,r){var n={uuid:t,time:(new Date).getTime(),data:r},i=e.transaction([c],"readwrite",u);return new Promise((function(e,t){i.oncomplete=function(){return e()},i.onerror=function(e){return t(e)},i.objectStore(c).add(n),f(i)}))}function p(e,t){var r=e.transaction(c,"readonly",u),n=r.objectStore(c),i=[],o=IDBKeyRange.bound(t+1,1/0);if(n.getAll){var s=n.getAll(o);return new Promise((function(e,t){s.onerror=function(e){return t(e)},s.onsuccess=function(t){e(t.target.result)}}))}return new Promise((function(e,s){var a=function(){try{return o=IDBKeyRange.bound(t+1,1/0),n.openCursor(o)}catch(e){return n.openCursor()}}();a.onerror=function(e){return s(e)},a.onsuccess=function(n){var o=n.target.result;o?o.value.id<t+1?o.continue(t+1):(i.push(o.value),o.continue()):(f(r),e(i))}}))}function g(e,t){var r=e.transaction([c],"readwrite",u).objectStore(c);return Promise.all(t.map((function(e){var t=r.delete(e);return new Promise((function(e){t.onsuccess=function(){return e()}}))})))}function y(e,t){var r=(new Date).getTime()-t,n=e.transaction(c,"readonly",u),i=n.objectStore(c),o=[];return new Promise((function(e){i.openCursor().onsuccess=function(t){var i=t.target.result;if(i){var s=i.value;if(!(s.time<r))return f(n),void e(o);o.push(s),i.continue()}else e(o)}}))}function m(e,t){return y(e,t).then((function(t){return g(e,t.map((function(e){return e.id})))}))}function b(e,t){return t=(0,o.fillOptionsWithDefaults)(t),d(e).then((function(r){var o={closed:!1,lastCursorId:0,channelName:e,options:t,uuid:(0,n.randomToken)(),eMIs:new i.ObliviousSet(2*t.idb.ttl),writeBlockPromise:n.PROMISE_RESOLVED_VOID,messagesCallback:null,readQueuePromises:[],db:r};return r.onclose=function(){o.closed=!0,t.idb.onclose&&t.idb.onclose()},v(o),o}))}function v(e){e.closed||w(e).then((function(){return(0,n.sleep)(e.options.idb.fallbackInterval)})).then((function(){return v(e)}))}function w(e){return e.closed?n.PROMISE_RESOLVED_VOID:e.messagesCallback?p(e.db,e.lastCursorId).then((function(t){var r=t.filter((function(e){return!!e})).map((function(t){return t.id>e.lastCursorId&&(e.lastCursorId=t.id),t})).filter((function(t){return function(e,t){return!(e.uuid===t.uuid||t.eMIs.has(e.id)||e.data.time<t.messagesCallbackTime)}(t,e)})).sort((function(e,t){return e.time-t.time}));return r.forEach((function(t){e.messagesCallback&&(e.eMIs.add(t.id),e.messagesCallback(t.data))})),n.PROMISE_RESOLVED_VOID})):n.PROMISE_RESOLVED_VOID}function A(e){e.closed=!0,e.db.close()}function E(e,t){return e.writeBlockPromise=e.writeBlockPromise.then((function(){return h(e.db,e.uuid,t)})).then((function(){0===(0,n.randomInt)(0,10)&&m(e.db,e.options.idb.ttl)})),e.writeBlockPromise}function _(e,t,r){e.messagesCallbackTime=r,e.messagesCallback=t,w(e)}function S(e){return!!e.support3PC&&!!l()}function x(e){return 2*e.idb.fallbackInterval}t.TRANSACTION_SETTINGS=u,t.type="idb";var T={create:b,close:A,onMessage:_,postMessage:E,canBeUsed:S,type:"idb",averageResponseTime:x,microSeconds:s};t.default=T},3699:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addStorageEventListener=d,t.averageResponseTime=b,t.canBeUsed=m,t.close=g,t.create=p,t.default=void 0,t.getLocalStorage=u,t.microSeconds=void 0,t.onMessage=y,t.postMessage=f,t.removeStorageEventListener=h,t.storageKey=l,t.type=void 0;var n=r(4626),i=r(824),o=r(1366),s=o.microSeconds;t.microSeconds=s;var a="pubkey.broadcastChannel-",c="localstorage";function u(){var e;if("undefined"==typeof window)return null;try{e=window.localStorage,e=window["ie8-eventlistener/storage"]||window.localStorage}catch(e){}return e}function l(e){return a+e}function f(e,t){return new Promise((function(r){(0,o.sleep)().then((function(){var n=l(e.channelName),i={token:(0,o.randomToken)(),time:(new Date).getTime(),data:t,uuid:e.uuid},s=JSON.stringify(i);u().setItem(n,s);var a=document.createEvent("Event");a.initEvent("storage",!0,!0),a.key=n,a.newValue=s,window.dispatchEvent(a),r()}))}))}function d(e,t){var r=l(e),n=function(e){e.key===r&&t(JSON.parse(e.newValue))};return window.addEventListener("storage",n),n}function h(e){window.removeEventListener("storage",e)}function p(e,t){if(!m(t=(0,i.fillOptionsWithDefaults)(t)))throw new Error("BroadcastChannel: localstorage cannot be used");var r=(0,o.randomToken)(),s=new n.ObliviousSet(t.localstorage.removeTimeout),a={channelName:e,uuid:r,eMIs:s};return a.listener=d(e,(function(e){a.messagesCallback&&e.uuid!==r&&e.token&&!s.has(e.token)&&(e.data.time&&e.data.time<a.messagesCallbackTime||(s.add(e.token),a.messagesCallback(e.data)))})),a}function g(e){h(e.listener)}function y(e,t,r){e.messagesCallbackTime=r,e.messagesCallback=t}function m(e){if(!e.support3PC)return!1;var t=u();if(!t)return!1;try{var r="__broadcastchannel_check";t.setItem(r,"works"),t.removeItem(r)}catch(e){return!1}return!0}function b(){var e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")?240:120}t.type=c;var v={create:p,close:g,onMessage:y,postMessage:f,canBeUsed:m,type:c,averageResponseTime:b,microSeconds:s};t.default=v},2199:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.averageResponseTime=f,t.canBeUsed=l,t.close=a,t.create=s,t.microSeconds=t.default=void 0,t.onMessage=u,t.postMessage=c,t.type=void 0;var n=r(1366),i=n.microSeconds;t.microSeconds=i;var o="native";function s(e){var t={messagesCallback:null,bc:new BroadcastChannel(e),subFns:[]};return t.bc.onmessage=function(e){t.messagesCallback&&t.messagesCallback(e.data)},t}function a(e){e.bc.close(),e.subFns=[]}function c(e,t){try{return e.bc.postMessage(t,!1),n.PROMISE_RESOLVED_VOID}catch(e){return Promise.reject(e)}}function u(e,t){e.messagesCallback=t}function l(e){if("undefined"==typeof window)return!1;if(!e.support3PC)return!1;if("function"==typeof BroadcastChannel){if(BroadcastChannel._pubkey)throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");return!0}return!1}function f(){return 150}t.type=o;var d={create:s,close:a,onMessage:u,postMessage:c,canBeUsed:l,type:o,averageResponseTime:f,microSeconds:i};t.default=d},2269:(e,t,r)=>{"use strict";var n=r(8834).Buffer,i=r(1600);Object.defineProperty(t,"__esModule",{value:!0}),t.averageResponseTime=T,t.canBeUsed=x,t.close=_,t.create=E,t.default=void 0,t.getSocketInstance=w,t.microSeconds=void 0,t.onMessage=S,t.postMessage=v,t.removeStorageEventListener=function(){y&&y.disconnect()},t.setupSocketConnection=A,t.storageKey=b,t.type=void 0;var o=i(r(2841)),s=i(r(1461)),a=r(4626),c=r(6580),u=r(2569),l=r(5784),f=r(1366),d=r(824),h=f.microSeconds;t.microSeconds=h;var p="pubkey.broadcastChannel-",g="server";t.type=g;var y=null,m=new Set;function b(e){return p+e}function v(e,t){return new Promise((function(r,i){(0,f.sleep)().then((0,s.default)(o.default.mark((function s(){var a,c,d,h;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=b(e.channelName),c=(0,l.keccak256)(n.from(a,"utf8")),o.next=4,(0,l.encryptData)(c.toString("hex"),{token:(0,f.randomToken)(),time:(new Date).getTime(),data:t,uuid:e.uuid});case 4:return d=o.sent,o.t0=(0,u.getPublic)(c).toString("hex"),o.t1=d,o.next=9,(0,u.sign)(c,(0,l.keccak256)(n.from(d,"utf8")));case 9:return o.t2=o.sent.toString("hex"),h={key:o.t0,data:o.t1,signature:o.t2},e.timeout&&(h.timeout=e.timeout),o.abrupt("return",fetch(e.serverUrl+"/channel/set",{method:"POST",body:JSON.stringify(h),headers:{"Content-Type":"application/json; charset=utf-8"}}).then(r).catch(i));case 13:case"end":return o.stop()}}),s)}))))}))}function w(e){if(y)return y;var t=(0,c.io)(e,{transports:["websocket","polling"],withCredentials:!0,reconnectionDelayMax:1e4,reconnectionAttempts:10});return t.on("connect_error",(function(e){t.io.opts.transports=["polling","websocket"],f.log.error("connect error",e)})),t.on("connect",(0,s.default)(o.default.mark((function e(){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.io.engine,f.log.debug("initially connected to",r.transport.name),r.once("upgrade",(function(){f.log.debug("upgraded",r.transport.name)})),r.once("close",(function(e){f.log.debug("connection closed",e)}));case 4:case"end":return e.stop()}}),e)})))),t.on("error",(function(e){f.log.error("socket errored",e),t.disconnect()})),y=t,t}function A(e,t,r){var i=w(e),a=b(t),c=(0,l.keccak256)(n.from(a,"utf8")),d=(0,u.getPublic)(c).toString("hex");i.connected?i.emit("check_auth_status",d):i.once("connect",(function(){f.log.debug("connected with socket"),i.emit("check_auth_status",d)}));var h=function(){i.once("connect",(0,s.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i.emit("check_auth_status",d);case 1:case"end":return e.stop()}}),e)}))))},p=function(){var e=(0,s.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,l.decryptData)(c.toString("hex"),t);case 3:n=e.sent,f.log.info(n),r(n),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),f.log.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}();return i.on("disconnect",(function(){f.log.debug("socket disconnected"),m.has(t)&&(f.log.error("socket disconnected unexpectedly, reconnecting socket"),h())})),i.on(d+"_success",p),"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function e(){i?i.connected||"visible"!==document.visibilityState||h():document.removeEventListener("visibilitychange",e)})),i}function E(e,t){t=(0,d.fillOptionsWithDefaults)(t);var r={channelName:e,uuid:(0,f.randomToken)(),eMIs:new a.ObliviousSet(t.server.removeTimeout),serverUrl:t.server.url};return t.server.timeout&&(r.timeout=t.server.timeout),A(t.server.url,e,(function(e){r.messagesCallback&&e.uuid!==r.uuid&&e.token&&!r.eMIs.has(e.token)&&(r.eMIs.add(e.token),r.messagesCallback(e.data))})),m.add(e),r}function _(e){m.delete(e.channelName)}function S(e,t,r){e.messagesCallbackTime=r,e.messagesCallback=t}function x(){return!0}function T(){return 500}var P={create:E,close:_,onMessage:S,postMessage:v,canBeUsed:x,type:g,averageResponseTime:T,microSeconds:h};t.default=P},8765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.averageResponseTime=f,t.canBeUsed=l,t.close=a,t.create=s,t.microSeconds=t.default=void 0,t.onMessage=u,t.postMessage=c,t.type=void 0;var n=r(1366).microSeconds;t.microSeconds=n;var i="simulate";t.type=i;var o=new Set;function s(e){var t={name:e,messagesCallback:null};return o.add(t),t}function a(e){o.delete(e)}function c(e,t){return new Promise((function(r){return setTimeout((function(){Array.from(o).filter((function(t){return t.name===e.name})).filter((function(t){return t!==e})).filter((function(e){return!!e.messagesCallback})).forEach((function(e){return e.messagesCallback(t)})),r()}),5)}))}function u(e,t){e.messagesCallback=t}function l(){return!0}function f(){return 5}var d={create:s,close:a,onMessage:u,postMessage:c,canBeUsed:l,type:i,averageResponseTime:f,microSeconds:n};t.default=d},824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fillOptionsWithDefaults=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=JSON.parse(JSON.stringify(e));return void 0===t.support3PC&&(t.support3PC=(0,n.are3PCSupported)()),void 0===t.webWorkerSupport&&(t.webWorkerSupport=!0),t.idb||(t.idb={}),t.idb.ttl||(t.idb.ttl=45e3),t.idb.fallbackInterval||(t.idb.fallbackInterval=150),e.idb&&"function"==typeof e.idb.onclose&&(t.idb.onclose=e.idb.onclose),t.localstorage||(t.localstorage={}),t.localstorage.removeTimeout||(t.localstorage.removeTimeout=6e4),t.server||(t.server={}),t.server.url||(t.server.url="https://broadcast-server.tor.us"),t.server.removeTimeout||(t.server.removeTimeout=3e5),e.methods&&(t.methods=e.methods),t};var n=r(1366)},1366:(e,t,r)=>{"use strict";var n=r(1600);Object.defineProperty(t,"__esModule",{value:!0}),t.PROMISE_RESOLVED_VOID=t.PROMISE_RESOLVED_TRUE=t.PROMISE_RESOLVED_FALSE=void 0,t.are3PCSupported=function(){if("undefined"==typeof navigator)return!1;var e=i.default.parse(navigator.userAgent);f.info(JSON.stringify(e),"current browser info");var t=!0;return navigator.brave&&(t=!1),e.engine.name!==i.default.ENGINE_MAP.WebKit&&e.engine.name!==i.default.ENGINE_MAP.Gecko||(t=!1),t},t.isPromise=function(e){return!(!e||"function"!=typeof e.then)},t.log=void 0,t.microSeconds=function(){var e=(new Date).getTime();return e===u?1e3*e+ ++l:(u=e,l=0,1e3*e)},t.randomInt=function(e,t){return Math.floor(Math.random()*(t-e+1)+e)},t.randomToken=function(){return Math.random().toString(36).substring(2)},t.setLogLevel=void 0,t.sleep=function(e,t){return e||(e=0),new Promise((function(r){return setTimeout((function(){return r(t)}),e)}))};var i=n(r(7160)),o=n(r(9640)),s=Promise.resolve(!1);t.PROMISE_RESOLVED_FALSE=s;var a=Promise.resolve(!0);t.PROMISE_RESOLVED_TRUE=a;var c=Promise.resolve();t.PROMISE_RESOLVED_VOID=c;var u=0,l=0,f=o.default.getLogger("broadcast-channel");t.log=f,f.setLevel("error"),t.setLogLevel=function(e){f.setLevel(e)}},2569:(e,t,r)=>{"use strict";r.r(t),r.d(t,{decrypt:()=>k,derive:()=>x,derivePadded:()=>P,deriveUnpadded:()=>T,encrypt:()=>I,generatePrivate:()=>w,getPublic:()=>A,getPublicCompressed:()=>E,sign:()=>_,verify:()=>S});var n=r(5675),i=r.n(n),o=r(7554),s=r(8834).Buffer;const a=new o.ec("secp256k1"),c=r.g.crypto||r.g.msCrypto||{},u=c.subtle||c.webkitSubtle,l=s.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),f=s.alloc(32,0);function d(e,t){if(!e)throw new Error(t||"Assertion failed")}function h(e){return t=e,!(!s.isBuffer(t)||32!==t.length)&&e.compare(f)>0&&e.compare(l)<0;var t}function p(e){const t=new Uint8Array(e);return void 0===c.getRandomValues?s.from(i().randomBytes(e)):(c.getRandomValues(t),s.from(t))}async function g(e){if(u){const t=await u.digest("SHA-512",e);return new Uint8Array(t)}const t=i().createHash("sha512").update(e).digest();return new Uint8Array(t)}function y(e){return async function(t,r,n){if(u){const i={name:"AES-CBC"},o=await u.importKey("raw",r,i,!1,[e]),a={name:"AES-CBC",iv:t},c=await u[e](a,o,n);return s.from(new Uint8Array(c))}if("encrypt"===e){const e=i().createCipheriv("aes-256-cbc",r,t),o=e.update(n),a=e.final();return s.concat([o,a])}if("decrypt"===e){const e=i().createDecipheriv("aes-256-cbc",r,t),o=e.update(n),a=e.final();return s.concat([o,a])}throw new Error(`Unsupported operation: ${e}`)}}const m=y("encrypt"),b=y("decrypt");async function v(e,t){if(u){const r={name:"HMAC",hash:{name:"SHA-256"}},n=await u.importKey("raw",new Uint8Array(e),r,!1,["sign","verify"]),i=await u.sign("HMAC",n,t);return s.from(new Uint8Array(i))}const r=i().createHmac("sha256",s.from(e));return r.update(t),r.digest()}const w=function(){let e=p(32);for(;!h(e);)e=p(32);return e},A=function(e){return d(32===e.length,"Bad private key"),d(h(e),"Bad private key"),s.from(a.keyFromPrivate(e).getPublic("array"))},E=function(e){return d(32===e.length,"Bad private key"),d(h(e),"Bad private key"),s.from(a.keyFromPrivate(e).getPublic(!0,"array"))},_=async function(e,t){return d(32===e.length,"Bad private key"),d(h(e),"Bad private key"),d(t.length>0,"Message should not be empty"),d(t.length<=32,"Message is too long"),s.from(a.sign(t,e,{canonical:!0}).toDER())},S=async function(e,t,r){if(d(65===e.length||33===e.length,"Bad public key"),65===e.length&&d(4===e[0],"Bad public key"),33===e.length&&d(2===e[0]||3===e[0],"Bad public key"),d(t.length>0,"Message should not be empty"),d(t.length<=32,"Message is too long"),a.verify(t,r,e))return null;throw new Error("Bad signature")},x=async function(e,t){d(s.isBuffer(e),"Bad private key"),d(s.isBuffer(t),"Bad public key"),d(32===e.length,"Bad private key"),d(h(e),"Bad private key"),d(65===t.length||33===t.length,"Bad public key"),65===t.length&&d(4===t[0],"Bad public key"),33===t.length&&d(2===t[0]||3===t[0],"Bad public key");const r=a.keyFromPrivate(e),n=a.keyFromPublic(t),i=r.derive(n.getPublic());return s.from(i.toArray())},T=x,P=async function(e,t){d(s.isBuffer(e),"Bad private key"),d(s.isBuffer(t),"Bad public key"),d(32===e.length,"Bad private key"),d(h(e),"Bad private key"),d(65===t.length||33===t.length,"Bad public key"),65===t.length&&d(4===t[0],"Bad public key"),33===t.length&&d(2===t[0]||3===t[0],"Bad public key");const r=a.keyFromPrivate(e),n=a.keyFromPublic(t),i=r.derive(n.getPublic());return s.from(i.toString(16,64),"hex")},I=async function(e,t,r){let n=(r=r||{}).ephemPrivateKey||p(32);for(;!h(n);)n=r.ephemPrivateKey||p(32);const i=A(n),o=await T(n,e),a=await g(o),c=r.iv||p(16),u=a.slice(0,32),l=a.slice(32),f=await m(c,s.from(u),t),d=s.concat([c,i,f]);return{iv:c,ephemPublicKey:i,ciphertext:f,mac:await v(s.from(l),d)}},k=async function(e,t,r){const n=null!=r&&r,i=n?P:T,o=await i(e,t.ephemPublicKey),a=await g(o),c=a.slice(0,32),u=a.slice(32),l=s.concat([t.iv,t.ephemPublicKey,t.ciphertext]),f=await async function(e,t,r){return function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(await v(e,t),r)}(s.from(u),l,t.mac);if(!f&&!1===n)return k(e,t,!0);if(!f&&!0===n)throw new Error("bad MAC after trying padded");const d=await b(t.iv,s.from(c),t.ciphertext);return s.from(new Uint8Array(d))}},5784:(e,t,r)=>{"use strict";r.r(t),r.d(t,{decryptData:()=>w,default:()=>p,ec:()=>h,encParamsBufToHex:()=>b,encParamsHexToBuf:()=>m,encryptAndSetData:()=>E,encryptData:()=>v,getAndDecryptData:()=>A,getDeviceShare:()=>T,getTorusShare:()=>x,keccak256:()=>d,setDeviceShare:()=>S,setTorusShare:()=>_});var n=r(3028),i=r(2601),o=r(3460),s=r(2117),a=r.n(s),c=r(7554),u=r(6169),l=r(2569),f=r(8834).Buffer;function d(e){return f.from((0,u.wn)(e))}const h=new c.ec("secp256k1");class p{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"https://metadata.tor.us",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,i.Z)(this,"metadataHost",void 0),(0,i.Z)(this,"serverTimeOffset",void 0),this.metadataHost=e,this.serverTimeOffset=t}static setAPIKey(e){(0,o.setAPIKey)(e)}static setEmbedHost(e){(0,o.setEmbedHost)(e)}generateMetadataParams(e,t){var r,n;const i=h.keyFromPrivate(t,"hex"),o={data:e,timestamp:Math.floor(this.serverTimeOffset+Date.now()/1e3).toString(16)},s=i.sign(d(f.from(a()(o),"utf8")));return{pub_key_X:i.getPublic().getX().toString(16,64),pub_key_Y:i.getPublic().getY().toString(16,64),set_data:o,signature:f.from(s.r.toString(16,64)+s.s.toString(16,64)+(null!==(r=null===(n=s.recoveryParam)||void 0===n?void 0:n.toString(16).padStart(2,"0").slice(-2))&&void 0!==r?r:"00"),"hex").toString("base64")}}generatePubKeyParams(e){const t=h.keyFromPrivate(e,"hex");return{pub_key_X:t.getPublic().getX().toString(16,64),pub_key_Y:t.getPublic().getY().toString(16,64)}}async setMetadata(e,t,r){const i=null!==t?(0,n.Z)((0,n.Z)({},e),{},{namespace:t}):e;return(await(0,o.post)(`${this.metadataHost}/set`,i,r,{useAPIKey:!0})).message}async getMetadata(e,t,r){const i=null!==t?(0,n.Z)((0,n.Z)({},e),{},{namespace:t}):e;return(await(0,o.post)(`${this.metadataHost}/get`,i,r,{useAPIKey:!0})).message}}const g="webauthn_torus_share",y="webauthn_device_share";function m(e){return{iv:f.from(e.iv,"hex"),ephemPublicKey:f.from(e.ephemPublicKey,"hex"),ciphertext:f.from(e.ciphertext,"hex"),mac:f.from(e.mac,"hex")}}function b(e){return{iv:f.from(e.iv).toString("hex"),ephemPublicKey:f.from(e.ephemPublicKey).toString("hex"),ciphertext:f.from(e.ciphertext).toString("hex"),mac:f.from(e.mac).toString("hex")}}async function v(e,t){const r=JSON.stringify(t),n=f.from(r,"utf-8"),i=b(await(0,l.encrypt)((0,l.getPublic)(f.from(e,"hex")),n));return JSON.stringify(i)}async function w(e,t){const r=m(JSON.parse(t)),n=h.keyFromPrivate(e),i=(await(0,l.decrypt)(f.from(n.getPrivate().toString("hex",64),"hex"),r)).toString("utf-8");return JSON.parse(i)}async function A(e,t,r){const n=h.keyFromPrivate(t).getPublic(),i=await e.getMetadata({pub_key_X:n.getX().toString(16),pub_key_Y:n.getY().toString(16)},r);return i?await w(t,i):null}async function E(e,t,r,n){const i=await v(t,r),o=e.generateMetadataParams(i,t);await e.setMetadata(o,n)}async function _(e,t,r,n,i){const o=h.keyFromPrivate(r).getPrivate(),s=h.keyFromPublic({x:t.pub_key_X,y:t.pub_key_Y}),a=await A(e,r,g);let c={};a&&(c=a);const u=JSON.stringify(i),d=f.from(u,"utf-8"),p=b(await(0,l.encrypt)(f.from(s.getPublic("hex"),"hex"),d));c[n]=p,await E(e,o.toString("hex",64),c,g)}async function S(e,t,r,n){const i=h.keyFromPrivate(t).getPrivate(),o=await A(e,t,y);let s={};o&&(s=o),s[r]=n,await E(e,i.toString("hex",64),s,y)}async function x(e,t,r,n){const i=await A(e,r,g);if(!i)return null;const o=i[n];if(!o)return null;const s=m(o),a=h.keyFromPrivate(t).getPrivate(),c=(await(0,l.decrypt)(f.from(a.toString("hex",64),"hex"),s)).toString("utf-8");return JSON.parse(c)}async function T(e,t,r){const n=await A(e,t,y);return n?n[r]:null}},9314:()=>{},3196:()=>{},8087:()=>{},732:()=>{},6312:()=>{},4087:()=>{},3260:()=>{},3558:()=>{},6396:()=>{},5338:()=>{},5675:()=>{},1461:e=>{function t(e,t,r,n,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,i)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(i,o){var s=e.apply(r,n);function a(e){t(s,i,o,a,c,"next",e)}function c(e){t(s,i,o,a,c,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6290:(e,t,r)=>{var n=r(7739);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},1600:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},814:(e,t,r)=>{var n=r(6290);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},7609:(e,t,r)=>{var n=r(7425).default;function i(){"use strict";e.exports=i=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var i=t&&t.prototype instanceof w?t:w,o=Object.create(i.prototype),s=new R(n||[]);return a(o,"_invoke",{value:k(e,r,s)}),o}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=h;var g="suspendedStart",y="suspendedYield",m="executing",b="completed",v={};function w(){}function A(){}function E(){}var _={};d(_,u,(function(){return this}));var S=Object.getPrototypeOf,x=S&&S(S(B([])));x&&x!==o&&s.call(x,u)&&(_=x);var T=E.prototype=w.prototype=Object.create(_);function P(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function r(i,o,a,c){var u=p(e[i],e,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&s.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,c)}))}c(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var i=g;return function(o,s){if(i===m)throw new Error("Generator is already running");if(i===b){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var c=O(a,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===g)throw i=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var u=p(e,r,n);if("normal"===u.type){if(i=n.done?b:y,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=b,n.method="throw",n.arg=u.arg)}}}function O(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=p(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function B(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(s.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(n(e)+" is not iterable")}return A.prototype=E,a(T,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:A,configurable:!0}),A.displayName=d(E,f,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===A||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,d(e,f,"GeneratorFunction")),e.prototype=Object.create(T),e},r.awrap=function(e){return{__await:e}},P(I.prototype),d(I.prototype,l,(function(){return this})),r.AsyncIterator=I,r.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var s=new I(h(e,t,n,i),o);return r.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},P(T),d(T,f,"Generator"),d(T,u,(function(){return this})),d(T,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=B,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&s.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),N(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;N(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:B(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},r}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},8064:(e,t,r)=>{var n=r(7425).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7739:(e,t,r)=>{var n=r(7425).default,i=r(8064);e.exports=function(e){var t=i(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,r)=>{var n=r(7609)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},5536:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accountBodyToRLP=t.accountBodyToSlim=t.accountBodyFromSlim=t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;const n=r(1222),i=r(1115),o=r(101),s=r(6115),a=r(7290),c=r(4505),u=r(5598),l=BigInt(0);class f{constructor(e=l,t=l,r=a.KECCAK256_RLP,n=a.KECCAK256_NULL){this.nonce=e,this.balance=t,this.storageRoot=r,this.codeHash=n,this._validate()}static fromAccountData(e){const{nonce:t,balance:r,storageRoot:n,codeHash:i}=e;return new f(void 0!==t?(0,s.bytesToBigInt)((0,s.toBytes)(t)):void 0,void 0!==r?(0,s.bytesToBigInt)((0,s.toBytes)(r)):void 0,void 0!==n?(0,s.toBytes)(n):void 0,void 0!==i?(0,s.toBytes)(i):void 0)}static fromRlpSerializedAccount(e){const t=n.RLP.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)}static fromValuesArray(e){const[t,r,n,i]=e;return new f((0,s.bytesToBigInt)(t),(0,s.bytesToBigInt)(r),n,i)}_validate(){if(this.nonce<l)throw new Error("nonce must be greater than zero");if(this.balance<l)throw new Error("balance must be greater than zero");if(32!==this.storageRoot.length)throw new Error("storageRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")}raw(){return[(0,s.bigIntToUnpaddedBytes)(this.nonce),(0,s.bigIntToUnpaddedBytes)(this.balance),this.storageRoot,this.codeHash]}serialize(){return n.RLP.encode(this.raw())}isContract(){return!(0,s.equalsBytes)(this.codeHash,a.KECCAK256_NULL)}isEmpty(){return this.balance===l&&this.nonce===l&&(0,s.equalsBytes)(this.codeHash,a.KECCAK256_NULL)}}function d(e){const[t,r,n,i]=e;return[t,r,0===n.length?a.KECCAK256_RLP:n,0===i.length?a.KECCAK256_NULL:i]}t.Account=f,t.isValidAddress=function(e){try{(0,c.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)},t.toChecksumAddress=function(e,t){(0,c.assertIsHexString)(e);const r=(0,u.stripHexPrefix)(e).toLowerCase();let n="";void 0!==t&&(n=(0,s.bytesToBigInt)((0,s.toBytes)(t)).toString()+"0x");const o=(0,s.utf8ToBytes)(n+r),a=(0,s.bytesToHex)((0,i.keccak256)(o)).slice(2);let l="0x";for(let e=0;e<r.length;e++)parseInt(a[e],16)>=8?l+=r[e].toUpperCase():l+=r[e];return l},t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e},t.generateAddress=function(e,t){return(0,c.assertIsBytes)(e),(0,c.assertIsBytes)(t),(0,s.bytesToBigInt)(t)===BigInt(0)?(0,i.keccak256)(n.RLP.encode([e,Uint8Array.from([])])).subarray(-20):(0,i.keccak256)(n.RLP.encode([e,t])).subarray(-20)},t.generateAddress2=function(e,t,r){if((0,c.assertIsBytes)(e),(0,c.assertIsBytes)(t),(0,c.assertIsBytes)(r),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==t.length)throw new Error("Expected salt to be of length 32");return(0,i.keccak256)((0,s.concatBytes)((0,s.hexToBytes)("0xff"),e,t,(0,i.keccak256)(r))).subarray(-20)},t.isValidPrivate=function(e){return o.secp256k1.utils.isValidPrivateKey(e)},t.isValidPublic=function(e,t=!1){if((0,c.assertIsBytes)(e),64===e.length)try{return o.secp256k1.ProjectivePoint.fromHex((0,s.concatBytes)(Uint8Array.from([4]),e)),!0}catch(e){return!1}if(!t)return!1;try{return o.secp256k1.ProjectivePoint.fromHex(e),!0}catch(e){return!1}},t.pubToAddress=function(e,t=!1){if((0,c.assertIsBytes)(e),t&&64!==e.length&&(e=o.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1)),64!==e.length)throw new Error("Expected pubKey to be of length 64");return(0,i.keccak256)(e).subarray(-20)},t.publicToAddress=t.pubToAddress,t.privateToPublic=function(e){return(0,c.assertIsBytes)(e),o.secp256k1.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1)},t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))},t.importPublic=function(e){return(0,c.assertIsBytes)(e),64!==e.length&&(e=o.secp256k1.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1)),e},t.zeroAddress=function(){const e=(0,s.zeros)(20);return(0,s.bytesToHex)(e)},t.isZeroAddress=function(e){try{(0,c.assertIsString)(e)}catch(e){return!1}return(0,t.zeroAddress)()===e},t.accountBodyFromSlim=d;const h=new Uint8Array(0);t.accountBodyToSlim=function(e){const[t,r,n,i]=e;return[t,r,(0,s.equalsBytes)(n,a.KECCAK256_RLP)?h:n,(0,s.equalsBytes)(i,a.KECCAK256_NULL)?h:i]},t.accountBodyToRLP=function(e,t=!0){const r=t?d(e):e;return n.RLP.encode(r)}},878:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;const n=r(5536),i=r(6115);class o{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.bytes=e}static zero(){return new o((0,i.zeros)(20))}static fromString(e){if(!(0,n.isValidAddress)(e))throw new Error("Invalid address");return new o((0,i.toBytes)(e))}static fromPublicKey(e){if(!(e instanceof Uint8Array))throw new Error("Public key should be Uint8Array");const t=(0,n.pubToAddress)(e);return new o(t)}static fromPrivateKey(e){if(!(e instanceof Uint8Array))throw new Error("Private key should be Uint8Array");const t=(0,n.privateToAddress)(e);return new o(t)}static generate(e,t){if("bigint"!=typeof t)throw new Error("Expected nonce to be a bigint");return new o((0,n.generateAddress)(e.bytes,(0,i.bigIntToBytes)(t)))}static generate2(e,t,r){if(!(t instanceof Uint8Array))throw new Error("Expected salt to be a Uint8Array");if(!(r instanceof Uint8Array))throw new Error("Expected initCode to be a Uint8Array");return new o((0,n.generateAddress2)(e.bytes,t,r))}equals(e){return(0,i.equalsBytes)(this.bytes,e.bytes)}isZero(){return this.equals(o.zero())}isPrecompileOrSystemAddress(){const e=(0,i.bytesToBigInt)(this.bytes),t=BigInt(0),r=BigInt("0xffff");return e>=t&&e<=r}toString(){return(0,i.bytesToHex)(this.bytes)}toBytes(){return new Uint8Array(this.bytes)}}t.Address=o},1881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncEventEmitter=void 0;const n=r(2699);class i extends n.EventEmitter{emit(e,...t){let[r,n]=t;const i=this;let o=i._events[e]??[];return void 0===n&&"function"==typeof r&&(n=r,r=void 0),"newListener"!==e&&"removeListener"!==e||(r={event:r,fn:n},n=void 0),o=Array.isArray(o)?o:[o],async function(e,t,r){let n;for await(const i of t)try{i.length<2?i.call(e,r):await new Promise(((t,n)=>{i.call(e,r,(e=>{e?n(e):t()}))}))}catch(e){n=e}if(n)throw n}(i,o.slice(),r).then(n).catch(n),i.listenerCount(e)>0}once(e,t){const r=this;let n;if("function"!=typeof t)throw new TypeError("listener must be a function");return n=t.length>=2?function(i,o){r.removeListener(e,n),t(i,o)}:function(i){r.removeListener(e,n),t(i,n)},r.on(e,n),r}first(e,t){let r=this._events[e]??[];if("function"!=typeof t)throw new TypeError("listener must be a function");return Array.isArray(r)||(this._events[e]=r=[r]),r.unshift(t),this}before(e,t,r){return this.beforeOrAfter(e,t,r)}after(e,t,r){return this.beforeOrAfter(e,t,r,"after")}beforeOrAfter(e,t,r,n){let i,o,s=this._events[e]??[];const a="after"===n?1:0;if("function"!=typeof r)throw new TypeError("listener must be a function");if("function"!=typeof t)throw new TypeError("target must be a function");for(Array.isArray(s)||(this._events[e]=s=[s]),o=s.length,i=s.length;i--;)if(s[i]===t){o=i+a;break}return s.splice(o,0,r),this}on(e,t){return super.on(e,t)}addListener(e,t){return super.addListener(e,t)}prependListener(e,t){return super.prependListener(e,t)}prependOnceListener(e,t){return super.prependOnceListener(e,t)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,t){return super.removeListener(e,t)}eventNames(){return super.eventNames()}listeners(e){return super.listeners(e)}listenerCount(e){return super.listenerCount(e)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(e){return super.setMaxListeners(e)}}t.AsyncEventEmitter=i},3082:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commitmentsToVersionedHashes=t.computeVersionedHash=t.blobsToProofs=t.blobsToCommitments=t.getBlobs=void 0;const n=r(5806),i=r(6115),o=r(5213),s=131072;function a(e){const t=new Uint8Array(131072);for(let r=0;r<4096;r++){const n=new Uint8Array(32);n.set(e.subarray(31*r,31*(r+1)),0),t.set(n,32*r)}return t}t.getBlobs=e=>{const t=(0,i.utf8ToBytes)(e),r=t.byteLength;if(0===r)throw Error("invalid blob data");if(r>262143)throw Error("blob data is too large");const n=Math.ceil(r/s),o=function(e,t){const r=new Uint8Array(t*s).fill(0);return r.set(e),r[e.byteLength]=128,r}(t,n),c=[];for(let e=0;e<n;e++){const t=a(o.subarray(e*s,(e+1)*s));c.push(t)}return c},t.blobsToCommitments=e=>{const t=[];for(const r of e)t.push(o.kzg.blobToKzgCommitment(r));return t},t.blobsToProofs=(e,t)=>e.map(((e,r)=>o.kzg.computeBlobKzgProof(e,t[r]))),t.computeVersionedHash=(e,t)=>{const r=new Uint8Array(32);return r.set([t],0),r.set((0,n.sha256)(e).subarray(1),1),r},t.commitmentsToVersionedHashes=e=>{const r=[];for(const n of e)r.push((0,t.computeVersionedHash)(n,1));return r}},6115:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.utf8ToBytes=t.equalsBytes=t.bytesToUtf8=t.concatBytes=t.randomBytes=t.compareBytes=t.intToUnpaddedBytes=t.bigIntToUnpaddedBytes=t.bigIntToHex=t.validateNoLeadingZeroes=t.short=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.toBytes=t.unpadHex=t.unpadArray=t.unpadBytes=t.setLengthRight=t.setLengthLeft=t.zeros=t.bigIntToBytes=t.intToBytes=t.intToHex=t.hexToBytes=t.bytesToInt=t.bytesToBigInt=t.bytesToHex=t.unprefixedHexToBytes=t.bytesToUnprefixedHex=void 0;const n=r(427),i=r(144),o=r(4505),s=r(5598);t.bytesToUnprefixedHex=i.bytesToHex,t.unprefixedHexToBytes=e=>{if("0x"===e.slice(0,2))throw new Error("hex string is prefixed with 0x, should be unprefixed");return(0,i.hexToBytes)((0,s.padToEven)(e))};const a=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));t.bytesToHex=e=>{let t="0x";if(void 0===e||0===e.length)return t;for(const r of e)t+=a[r];return t},t.bytesToBigInt=e=>{const r=(0,t.bytesToHex)(e);return"0x"===r?BigInt(0):BigInt(r)},t.bytesToInt=e=>{const r=Number((0,t.bytesToBigInt)(e));if(!Number.isSafeInteger(r))throw new Error("Number exceeds 53 bits");return r},t.hexToBytes=e=>{if("string"!=typeof e)throw new Error(`hex argument type ${typeof e} must be of type string`);if(!e.startsWith("0x"))throw new Error(`prefixed hex input should start with 0x, got ${e.substring(0,2)}`);(e=e.slice(2)).length%2!=0&&(e=(0,s.padToEven)(e));const t=e.length/2,r=new Uint8Array(t);for(let n=0;n<t;n++){const t=parseInt(e.slice(2*n,2*(n+1)),16);r[n]=t}return r},t.intToHex=e=>{if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`},t.intToBytes=e=>{const r=(0,t.intToHex)(e);return(0,t.hexToBytes)(r)},t.bigIntToBytes=e=>(0,t.toBytes)("0x"+(0,s.padToEven)(e.toString(16))),t.zeros=e=>new Uint8Array(e);const c=(e,r,n)=>n?e.length<r?new Uint8Array([...e,...(0,t.zeros)(r-e.length)]):e.subarray(0,r):e.length<r?new Uint8Array([...(0,t.zeros)(r-e.length),...e]):e.subarray(-r);t.setLengthLeft=(e,t)=>((0,o.assertIsBytes)(e),c(e,t,!1)),t.setLengthRight=(e,t)=>((0,o.assertIsBytes)(e),c(e,t,!0));const u=e=>{let t=e[0];for(;e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBytes=e=>((0,o.assertIsBytes)(e),u(e)),t.unpadArray=e=>((0,o.assertIsArray)(e),u(e)),t.unpadHex=e=>((0,o.assertIsHexString)(e),e=(0,s.stripHexPrefix)(e),"0x"+u(e)),t.toBytes=e=>{if(null==e)return new Uint8Array;if(Array.isArray(e)||e instanceof Uint8Array)return Uint8Array.from(e);if("string"==typeof e){if(!(0,s.isHexString)(e))throw new Error(`Cannot convert string to Uint8Array. toBytes only supports 0x-prefixed hex strings and this string was given: ${e}`);return(0,t.hexToBytes)(e)}if("number"==typeof e)return(0,t.intToBytes)(e);if("bigint"==typeof e){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${e}`);let r=e.toString(16);return r.length%2&&(r="0"+r),(0,t.unprefixedHexToBytes)(r)}if(void 0!==e.toBytes)return e.toBytes();throw new Error("invalid type")},t.fromSigned=e=>BigInt.asIntN(256,(0,t.bytesToBigInt)(e)),t.toUnsigned=e=>(0,t.bigIntToBytes)(BigInt.asUintN(256,e)),t.addHexPrefix=e=>"string"!=typeof e||(0,s.isHexPrefixed)(e)?e:"0x"+e,t.short=(e,r=50)=>{const n=e instanceof Uint8Array?(0,t.bytesToHex)(e):e,i="0x"===n.slice(0,2)?r+2:r;return n.length<=i?n:n.slice(0,i)+"…"},t.validateNoLeadingZeroes=e=>{for(const[r,n]of Object.entries(e))if(void 0!==n&&n.length>0&&0===n[0])throw new Error(`${r} cannot have leading zeroes, received: ${(0,t.bytesToHex)(n)}`)},t.bigIntToHex=e=>"0x"+e.toString(16),t.bigIntToUnpaddedBytes=e=>(0,t.unpadBytes)((0,t.bigIntToBytes)(e)),t.intToUnpaddedBytes=e=>(0,t.unpadBytes)((0,t.intToBytes)(e)),t.compareBytes=(e,r)=>{const n=(0,t.bytesToBigInt)(e),i=(0,t.bytesToBigInt)(r);return n>i?1:n<i?-1:0},t.randomBytes=e=>(0,n.getRandomBytesSync)(e),t.concatBytes=(...e)=>{if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r};var l=r(144);Object.defineProperty(t,"bytesToUtf8",{enumerable:!0,get:function(){return l.bytesToUtf8}}),Object.defineProperty(t,"equalsBytes",{enumerable:!0,get:function(){return l.equalsBytes}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return l.utf8ToBytes}})},7290:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RIPEMD160_ADDRESS_STRING=t.MAX_WITHDRAWALS_PER_PAYLOAD=t.RLP_EMPTY_STRING=t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.SECP256K1_ORDER_DIV_2=t.SECP256K1_ORDER=t.MAX_INTEGER_BIGINT=t.MAX_INTEGER=t.MAX_UINT64=void 0;const n=r(101),i=r(6115);t.MAX_UINT64=BigInt("0xffffffffffffffff"),t.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),t.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),t.SECP256K1_ORDER=n.secp256k1.CURVE.n,t.SECP256K1_ORDER_DIV_2=n.secp256k1.CURVE.n/BigInt(2),t.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),t.KECCAK256_NULL_S="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=(0,i.hexToBytes)(t.KECCAK256_NULL_S),t.KECCAK256_RLP_ARRAY_S="0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=(0,i.hexToBytes)(t.KECCAK256_RLP_ARRAY_S),t.KECCAK256_RLP_S="0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=(0,i.hexToBytes)(t.KECCAK256_RLP_S),t.RLP_EMPTY_STRING=Uint8Array.from([128]),t.MAX_WITHDRAWALS_PER_PAYLOAD=16,t.RIPEMD160_ADDRESS_STRING="0000000000000000000000000000000000000003"},9984:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueEncoding=t.KeyEncoding=void 0,(n=t.KeyEncoding||(t.KeyEncoding={})).String="string",n.Bytes="view",n.Number="number",(r=t.ValueEncoding||(t.ValueEncoding={})).String="string",r.Bytes="view",r.JSON="json"},8195:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGethGenesisState=void 0;const n=r(6115),i=r(5598);t.parseGethGenesisState=function(e){const t={};for(let r of Object.keys(e.alloc)){let{balance:o,code:s,storage:a,nonce:c}=e.alloc[r];r=(0,n.addHexPrefix)(r),o=(0,i.isHexPrefixed)(o)?o:(0,n.bigIntToHex)(BigInt(o)),s=void 0!==s?(0,n.addHexPrefix)(s):void 0,a=void 0!==a?Object.entries(a):void 0,c=void 0!==c?(0,n.addHexPrefix)(c):void 0,t[r]=[o,s,a,c]}return t}},4505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBytes=t.assertIsHexString=void 0;const n=r(5598);t.assertIsHexString=function(e){if(!(0,n.isHexString)(e))throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)},t.assertIsBytes=function(e){if(!(e instanceof Uint8Array))throw new Error(`This method only supports Uint8Array but input was: ${e}`)},t.assertIsArray=function(e){if(!Array.isArray(e))throw new Error(`This method only supports number arrays but input was: ${e}`)},t.assertIsString=function(e){if("string"!=typeof e)throw new Error(`This method only supports strings but input was: ${e}`)}},2938:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.toAscii=t.stripHexPrefix=t.padToEven=t.isHexString=t.isHexPrefixed=t.getKeys=t.getBinarySize=t.fromUtf8=t.fromAscii=t.arrayContainsArray=void 0,i(r(7290),t),i(r(9983),t),i(r(5536),t),i(r(878),t),i(r(9984),t),i(r(667),t),i(r(8506),t),i(r(6115),t),i(r(9473),t),i(r(1881),t),i(r(3082),t),i(r(8195),t);var o=r(5598);Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return o.isHexString}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),i(r(5213),t),i(r(4925),t),i(r(2456),t),i(r(1242),t)},5598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0;const n=r(6115);function i(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}function o(e){let t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received "+typeof t);return t.length%2&&(t=`0${t}`),t}t.isHexPrefixed=i,t.stripHexPrefix=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return i(e)?e.slice(2):e},t.padToEven=o,t.getBinarySize=function(e){if("string"!=typeof e)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof e);return(0,n.utf8ToBytes)(e).byteLength},t.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(!0!==Array.isArray(t))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[!0===r?"some":"every"]((t=>e.indexOf(t)>=0))},t.toAscii=function(e){let t="",r=0;const n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){const n=parseInt(e.substr(r,2),16);t+=String.fromCharCode(n)}return t},t.fromUtf8=function(e){const t=(0,n.utf8ToBytes)(e);return`0x${o((0,n.bytesToHex)(t)).replace(/^0+|0+$/g,"")}`},t.fromAscii=function(e){let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r).toString(16);t+=n.length<2?`0${n}`:n}return`0x${t}`},t.getKeys=function(e,t,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got "+typeof e);if("string"!=typeof t)throw new Error("[getKeys] method expects input 'key' to be type 'string', got "+typeof e);const n=[];for(let i=0;i<e.length;i++){let o=e[i][t];if(!0!==r||o){if("string"!=typeof o)throw new Error("invalid abi - expected type 'string', received "+typeof o)}else o="";n.push(o)}return n},t.isHexString=function(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||void 0!==t&&t>0&&e.length!==2+2*t)}},5213:(e,t)=>{"use strict";function r(){throw Error("kzg library not loaded")}Object.defineProperty(t,"__esModule",{value:!0}),t.initKZG=t.kzg=void 0,t.kzg={loadTrustedSetup:r,blobToKzgCommitment:r,computeBlobKzgProof:r,verifyKzgProof:r,verifyBlobKzgProofBatch:r},t.initKZG=function(e,r){t.kzg=e,t.kzg.loadTrustedSetup(r)}},4925:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Lock=void 0,t.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((e=>this.promiseResolverQueue.push(e)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const e=this.promiseResolverQueue.shift();e&&e(!0)}}}},2456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapDB=void 0;const n=r(6115);class i{constructor(e){this._database=e??new Map}async get(e){const t=e instanceof Uint8Array?(0,n.bytesToUnprefixedHex)(e):e.toString();return this._database.get(t)}async put(e,t){const r=e instanceof Uint8Array?(0,n.bytesToUnprefixedHex)(e):e.toString();this._database.set(r,t)}async del(e){const t=e instanceof Uint8Array?(0,n.bytesToUnprefixedHex)(e):e.toString();this._database.delete(t)}async batch(e){for(const t of e)"del"===t.type&&await this.del(t.key),"put"===t.type&&await this.put(t.key,t.value)}shallowCopy(){return new i(this._database)}open(){return Promise.resolve()}}t.MapDB=i},1242:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getProvider=t.fetchFromProvider=void 0,t.fetchFromProvider=async(e,t)=>{const r=JSON.stringify({method:t.method,params:t.params,jsonrpc:"2.0",id:1}),n=await fetch(e,{headers:{"content-type":"application/json"},method:"POST",body:r});return(await n.json()).result},t.getProvider=e=>{if("string"==typeof e)return e;if("object"==typeof e&&void 0!==e._getConnection)return e._getConnection().url;throw new Error("Must provide valid provider URL or Web3Provider")}},8506:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;const n=r(1115),i=r(101),o=r(6115),s=r(7290),a=r(4505);function c(e,t){return e===BigInt(0)||e===BigInt(1)?e:void 0===t?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}function u(e){return e===BigInt(0)||e===BigInt(1)}t.ecsign=function(e,t,r){const n=i.secp256k1.sign(e,t),o=n.toCompactRawBytes();return{r:o.slice(0,32),s:o.slice(32,64),v:void 0===r?BigInt(n.recovery+27):BigInt(n.recovery+35)+BigInt(r)*BigInt(2)}},t.ecrecover=function(e,t,r,n,s){const a=(0,o.concatBytes)((0,o.setLengthLeft)(r,32),(0,o.setLengthLeft)(n,32)),l=c(t,s);if(!u(l))throw new Error("Invalid signature v value");return i.secp256k1.Signature.fromCompact(a).addRecoveryBit(Number(l)).recoverPublicKey(e).toRawBytes(!1).slice(1)},t.toRpcSig=function(e,t,r,n){if(!u(c(e,n)))throw new Error("Invalid signature v value");return(0,o.bytesToHex)((0,o.concatBytes)((0,o.setLengthLeft)(t,32),(0,o.setLengthLeft)(r,32),(0,o.toBytes)(e)))},t.toCompactSig=function(e,t,r,n){if(!u(c(e,n)))throw new Error("Invalid signature v value");const i=Uint8Array.from([...r]);return(e>BigInt(28)&&e%BigInt(2)===BigInt(1)||e===BigInt(1)||e===BigInt(28))&&(i[0]|=128),(0,o.bytesToHex)((0,o.concatBytes)((0,o.setLengthLeft)(t,32),(0,o.setLengthLeft)(i,32)))},t.fromRpcSig=function(e){const t=(0,o.toBytes)(e);let r,n,i;if(t.length>=65)r=t.subarray(0,32),n=t.subarray(32,64),i=(0,o.bytesToBigInt)(t.subarray(64));else{if(64!==t.length)throw new Error("Invalid signature length");r=t.subarray(0,32),n=t.subarray(32,64),i=BigInt((0,o.bytesToInt)(t.subarray(32,33))>>7),n[0]&=127}return i<27&&(i+=BigInt(27)),{v:i,r,s:n}},t.isValidSignature=function(e,t,r,n=!0,i){if(32!==t.length||32!==r.length)return!1;if(!u(c(e,i)))return!1;const a=(0,o.bytesToBigInt)(t),l=(0,o.bytesToBigInt)(r);return!(a===BigInt(0)||a>=s.SECP256K1_ORDER||l===BigInt(0)||l>=s.SECP256K1_ORDER||n&&l>=s.SECP256K1_ORDER_DIV_2)},t.hashPersonalMessage=function(e){(0,a.assertIsBytes)(e);const t=(0,o.utf8ToBytes)(`Ethereum Signed Message:\n${e.length}`);return(0,n.keccak256)((0,o.concatBytes)(t,e))}},9473:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=void 0;const n=r(6115),i=r(5598);var o;!function(e){e[e.Number=0]="Number",e[e.BigInt=1]="BigInt",e[e.Uint8Array=2]="Uint8Array",e[e.PrefixedHexString=3]="PrefixedHexString"}(o=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null;if(void 0===e)return;if("string"==typeof e&&!(0,i.isHexString)(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const r=(0,n.toBytes)(e);switch(t){case o.Uint8Array:return r;case o.BigInt:return(0,n.bytesToBigInt)(r);case o.Number:{const e=(0,n.bytesToBigInt)(r);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case o.PrefixedHexString:return(0,n.bytesToHex)(r);default:throw new Error("unknown outputType")}}},9983:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GWEI_TO_WEI=void 0,t.GWEI_TO_WEI=BigInt(1e9)},667:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Withdrawal=void 0;const n=r(878),i=r(6115),o=r(9473);class s{constructor(e,t,r,n){this.index=e,this.validatorIndex=t,this.address=r,this.amount=n}static fromWithdrawalData(e){const{index:t,validatorIndex:r,address:a,amount:c}=e,u=(0,o.toType)(t,o.TypeOutput.BigInt),l=(0,o.toType)(r,o.TypeOutput.BigInt),f=a instanceof n.Address?a:new n.Address((0,i.toBytes)(a)),d=(0,o.toType)(c,o.TypeOutput.BigInt);return new s(u,l,f,d)}static fromValuesArray(e){if(4!==e.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${e.length}`);const[t,r,n,i]=e;return s.fromWithdrawalData({index:t,validatorIndex:r,address:n,amount:i})}static toBytesArray(e){const{index:t,validatorIndex:r,address:i,amount:s}=e;return[(0,o.toType)(t,o.TypeOutput.BigInt)===BigInt(0)?new Uint8Array:(0,o.toType)(t,o.TypeOutput.Uint8Array),(0,o.toType)(r,o.TypeOutput.BigInt)===BigInt(0)?new Uint8Array:(0,o.toType)(r,o.TypeOutput.Uint8Array),i instanceof n.Address?i.bytes:(0,o.toType)(i,o.TypeOutput.Uint8Array),(0,o.toType)(s,o.TypeOutput.BigInt)===BigInt(0)?new Uint8Array:(0,o.toType)(s,o.TypeOutput.Uint8Array)]}raw(){return s.toBytesArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.bytes,amount:this.amount}}toJSON(){return{index:(0,i.bigIntToHex)(this.index),validatorIndex:(0,i.bigIntToHex)(this.validatorIndex),address:(0,i.bytesToHex)(this.address.bytes),amount:(0,i.bigIntToHex)(this.amount)}}}t.Withdrawal=s},1222:(e,t)=>{"use strict";function r(e){if(Array.isArray(e)){const t=[];let n=0;for(let i=0;i<e.length;i++){const o=r(e[i]);t.push(o),n+=o.length}return d(o(n,192),...t)}const t=y(e);return 1===t.length&&t[0]<128?t:d(o(t.length,128),t)}function n(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function i(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return l(u(e))}function o(e,t){if(e<56)return Uint8Array.from([e+t]);const r=p(e),n=p(t+55+r.length/2);return Uint8Array.from(f(n+r))}function s(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);const r=a(y(e));if(t)return r;if(0!==r.remainder.length)throw new Error("invalid RLP: remainder must be zero");return r.data}function a(e){let t,r,o,s,c;const u=[],l=e[0];if(l<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(l<=183){if(t=l-127,o=128===l?Uint8Array.from([]):n(e,1,t),2===t&&o[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:o,remainder:e.slice(t)}}if(l<=191){if(r=l-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=i(n(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return o=n(e,r,t+r),{data:o,remainder:e.slice(t+r)}}if(l<=247){for(t=l-191,s=n(e,1,t);s.length;)c=a(s),u.push(c.data),s=c.remainder;return{data:u,remainder:e.slice(t)}}{if(r=l-246,t=i(n(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const o=r+t;if(o>e.length)throw new Error("invalid RLP: total length is larger than the data");for(s=n(e,r,o);s.length;)c=a(s),u.push(c.data),s=c.remainder;return{data:u,remainder:e.slice(o)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.RLP=t.utils=t.decode=t.encode=void 0,t.encode=r,t.decode=s;const c=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function u(e){let t="";for(let r=0;r<e.length;r++)t+=c[e[r]];return t}function l(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function f(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r;t[r]=l(e.slice(n,n+2))}return t}function d(...e){if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}function h(e){return(new TextEncoder).encode(e)}function p(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function g(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function y(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return g(e)?f((t="string"!=typeof(r=e)?r:g(r)?r.slice(2):r).length%2?`0${t}`:t):h(e);var t,r;if("number"==typeof e||"bigint"==typeof e)return e?f(p(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}t.utils={bytesToHex:u,concatBytes:d,hexToBytes:f,utf8ToBytes:h},t.RLP={encode:r,decode:s}},2191:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},4024:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasCORS=void 0;let r=!1;try{r="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}t.hasCORS=r},5416:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0,t.encode=function(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t},t.decode=function(e){let t={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}},9187:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const r=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.parse=function(e){const t=e,i=e.indexOf("["),o=e.indexOf("]");-1!=i&&-1!=o&&(e=e.substring(0,i)+e.substring(i,o).replace(/:/g,";")+e.substring(o,e.length));let s=r.exec(e||""),a={},c=14;for(;c--;)a[n[c]]=s[c]||"";return-1!=i&&-1!=o&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(e,t){const r=t.replace(/\/{2,9}/g,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1),"/"==t.slice(-1)&&r.splice(r.length-1,1),r}(0,a.path),a.queryKey=function(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,n){t&&(r[t]=n)})),r}(0,a.query),a}},6294:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.yeast=t.decode=t.encode=void 0;const r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),n={};let i,o=0,s=0;function a(e){let t="";do{t=r[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}for(t.encode=a,t.decode=function(e){let t=0;for(s=0;s<e.length;s++)t=64*t+n[e.charAt(s)];return t},t.yeast=function(){const e=a(+new Date);return e!==i?(o=0,i=e):e+"."+a(o++)};s<64;s++)n[r[s]]=s},7307:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalThisShim=void 0,t.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},1473:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=t.parse=t.installTimerFunctions=t.transports=t.Transport=t.protocol=t.Socket=void 0;const n=r(3091);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return n.Socket}}),t.protocol=n.Socket.protocol;var i=r(5817);Object.defineProperty(t,"Transport",{enumerable:!0,get:function(){return i.Transport}});var o=r(8508);Object.defineProperty(t,"transports",{enumerable:!0,get:function(){return o.transports}});var s=r(8719);Object.defineProperty(t,"installTimerFunctions",{enumerable:!0,get:function(){return s.installTimerFunctions}});var a=r(9187);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return a.parse}});var c=r(6089);Object.defineProperty(t,"nextTick",{enumerable:!0,get:function(){return c.nextTick}})},3091: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.Socket=void 0;const i=r(8508),o=r(8719),s=r(5416),a=r(9187),c=n(r(5130)),u=r(7416),l=r(7385),f=r(6089),d=(0,c.default)("engine.io-client:socket");class h extends u.Emitter{constructor(e,t={}){super(),this.binaryType=f.defaultBinaryType,this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=(0,a.parse)(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=(0,a.parse)(t.host).host),(0,o.installTimerFunctions)(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=(0,s.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){d('creating transport "%s"',e);const t=Object.assign({},this.opts.query);t.EIO=l.protocol,t.transport=e,this.id&&(t.sid=this.id);const r=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return d("options: %j",r),new i.transports[e](r)}open(){let e;if(this.opts.rememberUpgrade&&h.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return d("error while creating transport: %s",e),this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){d("setting transport %s",e.name),this.transport&&(d("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){d('probing transport "%s"',e);let t=this.createTransport(e),r=!1;h.priorWebsocketSuccess=!1;const n=()=>{r||(d('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(n=>{if(!r)if("pong"===n.type&&"probe"===n.data){if(d('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;h.priorWebsocketSuccess="websocket"===t.name,d('pausing current transport "%s"',this.transport.name),this.transport.pause((()=>{r||"closed"!==this.readyState&&(d("changing transport and sending upgrade packet"),u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{d('probe transport "%s" failed',e);const r=new Error("probe error");r.transport=t.name,this.emitReserved("upgradeError",r)}})))};function i(){r||(r=!0,u(),t.close(),t=null)}const o=r=>{const n=new Error("probe error: "+r);n.transport=t.name,i(),d('probe transport "%s" failed because of error: %s',e,r),this.emitReserved("upgradeError",n)};function s(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&(d('"%s" works - aborting "%s"',e.name,t.name),i())}const u=()=>{t.removeListener("open",n),t.removeListener("error",o),t.removeListener("close",s),this.off("close",a),this.off("upgrading",c)};t.once("open",n),t.once("error",o),t.once("close",s),this.once("close",a),this.once("upgrading",c),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn((()=>{r||t.open()}),200):t.open()}onOpen(){if(d("socket open"),this.readyState="open",h.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){d("starting upgrade probes");let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(d('socket receive: type "%s", data "%s"',e.type,e.data),this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}else d('packet received with socket readyState "%s"',this.readyState)}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();d("flushing %d packets in socket",e.length),this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const r=this.writeBuffer[t].data;if(r&&(e+=(0,o.byteLength)(r)),t>0&&e>this.maxPayload)return d("only send %d out of %d packets",t,this.writeBuffer.length),this.writeBuffer.slice(0,t);e+=2}return d("payload size is %d (max: %d)",e,this.maxPayload),this.writeBuffer}write(e,t,r){return this.sendPacket("message",e,t,r),this}send(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r,n){if("function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;const i={type:e,data:t,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}close(){const e=()=>{this.onClose("forced close"),d("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?r():e()})):this.upgrading?r():e()),this}onError(e){d("socket error %j",e),h.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(d('socket close with reason: "%s"',e),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let r=0;const n=e.length;for(;r<n;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}t.Socket=h,h.protocol=l.protocol},5817: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.Transport=void 0;const i=r(7385),o=r(7416),s=r(8719),a=n(r(5130)),c=r(5416),u=(0,a.default)("engine.io-client:transport");class l extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class f extends o.Emitter{constructor(e){super(),this.writable=!1,(0,s.installTimerFunctions)(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,r){return super.emitReserved("error",new l(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState?this.write(e):u("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=(0,i.decodePacket)(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=(0,c.encode)(e);return t.length?"?"+t:""}}t.Transport=f},8508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transports=void 0;const n=r(6788),i=r(5843),o=r(231);t.transports={websocket:i.WS,webtransport:o.WT,polling:n.Polling}},6788: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.Request=t.Polling=void 0;const i=r(5817),o=n(r(5130)),s=r(6294),a=r(7385),c=r(3566),u=r(7416),l=r(8719),f=r(7307),d=(0,o.default)("engine.io-client:polling");function h(){}const p=null!=new c.XHR({xdomain:!1}).responseType;class g extends i.Transport{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let r=location.port;r||(r=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||r!==e.port}const t=e&&e.forceBase64;this.supportsBinary=p&&!t,this.opts.withCredentials&&(this.cookieJar=(0,c.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{d("paused"),this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(d("we are currently polling - waiting to pause"),e++,this.once("pollComplete",(function(){d("pre-pause polling complete"),--e||t()}))),this.writable||(d("we are currently writing - waiting to pause"),e++,this.once("drain",(function(){d("pre-pause writing complete"),--e||t()})))}else t()}poll(){d("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){d("polling got data %s",e),(0,a.decodePayload)(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState?this.poll():d('ignoring poll - transport state "%s"',this.readyState))}doClose(){const e=()=>{d("writing close packet"),this.write([{type:"close"}])};"open"===this.readyState?(d("transport open - closing"),e()):(d("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,(0,a.encodePayload)(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,s.yeast)()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new y(this.uri(),e)}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){d("xhr poll");const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}t.Polling=g;class y extends u.Emitter{constructor(e,t){super(),(0,l.installTimerFunctions)(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=void 0!==t.data?t.data:null,this.create()}create(){var e;const t=(0,l.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const r=this.xhr=new c.XHR(t);try{d("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this.opts.cookieJar)||void 0===e||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null===(e=this.opts.cookieJar)||void 0===e||e.parseCookies(r)),4===r.readyState&&(200===r.status||1223===r.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof r.status?r.status:0)}),0))},d("xhr data %s",this.data),r.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=y.requestsCount++,y.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=h,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete y.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(t.Request=y,y.requestsCount=0,y.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",m);else if("function"==typeof addEventListener){const e="onpagehide"in f.globalThisShim?"pagehide":"unload";addEventListener(e,m,!1)}function m(){for(let e in y.requests)y.requests.hasOwnProperty(e)&&y.requests[e].abort()}},6089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBinaryType=t.usingBrowserWebSocket=t.WebSocket=t.nextTick=void 0;const n=r(7307);t.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),t.WebSocket=n.globalThisShim.WebSocket||n.globalThisShim.MozWebSocket,t.usingBrowserWebSocket=!0,t.defaultBinaryType="arraybuffer"},5843:function(e,t,r){"use strict";var n=r(8834).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WS=void 0;const o=r(5817),s=r(6294),a=r(8719),c=r(6089),u=i(r(5130)),l=r(7385),f=(0,u.default)("engine.io-client:websocket"),d="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class h extends o.Transport{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,r=d?{}:(0,a.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=c.usingBrowserWebSocket&&!d?t?new c.WebSocket(e,t):new c.WebSocket(e):new c.WebSocket(e,t,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],i=t===e.length-1;(0,l.encodePacket)(r,this.supportsBinary,(e=>{const t={};!c.usingBrowserWebSocket&&(r.options&&(t.compress=r.options.compress),this.opts.perMessageDeflate)&&("string"==typeof e?n.byteLength(e):e.length)<this.opts.perMessageDeflate.threshold&&(t.compress=!1);try{c.usingBrowserWebSocket?this.ws.send(e):this.ws.send(e,t)}catch(e){f("websocket closed before onclose event")}i&&(0,c.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,s.yeast)()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!c.WebSocket}}t.WS=h},231: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.WT=void 0;const i=r(5817),o=r(6089),s=r(7385),a=(0,n(r(5130)).default)("engine.io-client:webtransport");class c extends i.Transport{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{a("transport closed gracefully"),this.onClose()})).catch((e=>{a("transport closed due to %s",e),this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=(0,s.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(t).getReader(),n=(0,s.createPacketEncoderStream)();n.readable.pipeTo(e.writable),this.writer=n.writable.getWriter();const i=()=>{r.read().then((({done:e,value:t})=>{e?a("session is closed"):(a("received chunk: %o",t),this.onPacket(t),i())})).catch((e=>{a("an error occurred while reading: %s",e)}))};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],n=t===e.length-1;this.writer.write(r).then((()=>{n&&(0,o.nextTick)((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}}t.WT=c},3566:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCookieJar=t.XHR=void 0;const n=r(4024),i=r(7307);t.XHR=function(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||n.hasCORS))return new XMLHttpRequest}catch(e){}if(!t)try{return new(i.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}},t.createCookieJar=function(){}},8719:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.byteLength=t.installTimerFunctions=t.pick=void 0;const n=r(7307);t.pick=function(e,...t){return t.reduce(((t,r)=>(e.hasOwnProperty(r)&&(t[r]=e[r]),t)),{})};const i=n.globalThisShim.setTimeout,o=n.globalThisShim.clearTimeout;t.installTimerFunctions=function(e,t){t.useNativeTimers?(e.setTimeoutFn=i.bind(n.globalThisShim),e.clearTimeoutFn=o.bind(n.globalThisShim)):(e.setTimeoutFn=n.globalThisShim.setTimeout.bind(n.globalThisShim),e.clearTimeoutFn=n.globalThisShim.clearTimeout.bind(n.globalThisShim))},t.byteLength=function(e){return"string"==typeof e?function(e){let t=0,r=0;for(let n=0,i=e.length;n<i;n++)t=e.charCodeAt(n),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(n++,r+=4);return r}(e):Math.ceil(1.33*(e.byteLength||e.size))}},7950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_PACKET=t.PACKET_TYPES_REVERSE=t.PACKET_TYPES=void 0;const r=Object.create(null);t.PACKET_TYPES=r,r.open="0",r.close="1",r.ping="2",r.pong="3",r.message="4",r.upgrade="5",r.noop="6";const n=Object.create(null);t.PACKET_TYPES_REVERSE=n,Object.keys(r).forEach((e=>{n[r[e]]=e})),t.ERROR_PACKET={type:"error",data:"parser error"}},6640:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=void 0;const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)n[r.charCodeAt(e)]=e;t.encode=e=>{let t,n=new Uint8Array(e),i=n.length,o="";for(t=0;t<i;t+=3)o+=r[n[t]>>2],o+=r[(3&n[t])<<4|n[t+1]>>4],o+=r[(15&n[t+1])<<2|n[t+2]>>6],o+=r[63&n[t+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},t.decode=e=>{let t,r,i,o,s,a=.75*e.length,c=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);const l=new ArrayBuffer(a),f=new Uint8Array(l);for(t=0;t<c;t+=4)r=n[e.charCodeAt(t)],i=n[e.charCodeAt(t+1)],o=n[e.charCodeAt(t+2)],s=n[e.charCodeAt(t+3)],f[u++]=r<<2|i>>4,f[u++]=(15&i)<<4|o>>2,f[u++]=(3&o)<<6|63&s;return l}},6559:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodePacket=void 0;const n=r(7950),i=r(6640),o="function"==typeof ArrayBuffer;t.decodePacket=(e,t)=>{if("string"!=typeof e)return{type:"message",data:a(e,t)};const r=e.charAt(0);return"b"===r?{type:"message",data:s(e.substring(1),t)}:n.PACKET_TYPES_REVERSE[r]?e.length>1?{type:n.PACKET_TYPES_REVERSE[r],data:e.substring(1)}:{type:n.PACKET_TYPES_REVERSE[r]}:n.ERROR_PACKET};const s=(e,t)=>{if(o){const r=(0,i.decode)(e);return a(r,t)}return{base64:!0,data:e}},a=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer},5916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodePacket=t.encodePacketToBinary=void 0;const n=r(7950),i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),o="function"==typeof ArrayBuffer,s=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,a=({type:e,data:t},r,a)=>i&&t instanceof Blob?r?a(t):c(t,a):o&&(t instanceof ArrayBuffer||s(t))?r?a(t):c(new Blob([t]),a):a(n.PACKET_TYPES[e]+(t||""));t.encodePacket=a;const c=(e,t)=>{const r=new FileReader;return r.onload=function(){const e=r.result.split(",")[1];t("b"+(e||""))},r.readAsDataURL(e)};function u(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let l;t.encodePacketToBinary=function(e,t){return i&&e.data instanceof Blob?e.data.arrayBuffer().then(u).then(t):o&&(e.data instanceof ArrayBuffer||s(e.data))?t(u(e.data)):void a(e,!1,(e=>{l||(l=new TextEncoder),t(l.encode(e))}))}},7385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodePayload=t.decodePacket=t.encodePayload=t.encodePacket=t.protocol=t.createPacketDecoderStream=t.createPacketEncoderStream=void 0;const n=r(5916);Object.defineProperty(t,"encodePacket",{enumerable:!0,get:function(){return n.encodePacket}});const i=r(6559);Object.defineProperty(t,"decodePacket",{enumerable:!0,get:function(){return i.decodePacket}});const o=r(7950),s=String.fromCharCode(30);let a;function c(e){return e.reduce(((e,t)=>e+t.length),0)}function u(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let i=0;i<t;i++)r[i]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}t.encodePayload=(e,t)=>{const r=e.length,i=new Array(r);let o=0;e.forEach(((e,a)=>{(0,n.encodePacket)(e,!1,(e=>{i[a]=e,++o===r&&t(i.join(s))}))}))},t.decodePayload=(e,t)=>{const r=e.split(s),n=[];for(let e=0;e<r.length;e++){const o=(0,i.decodePacket)(r[e],t);if(n.push(o),"error"===o.type)break}return n},t.createPacketEncoderStream=function(){return new TransformStream({transform(e,t){(0,n.encodePacketToBinary)(e,(r=>{const n=r.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,n)}else{i=new Uint8Array(9);const e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(n))}e.data&&"string"!=typeof e.data&&(i[0]|=128),t.enqueue(i),t.enqueue(r)}))}})},t.createPacketDecoderStream=function(e,t){a||(a=new TextDecoder);const r=[];let n=0,s=-1,l=!1;return new TransformStream({transform(f,d){for(r.push(f);;){if(0===n){if(c(r)<1)break;const e=u(r,1);l=128==(128&e[0]),s=127&e[0],n=s<126?3:126===s?1:2}else if(1===n){if(c(r)<2)break;const e=u(r,2);s=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),n=3}else if(2===n){if(c(r)<8)break;const e=u(r,8),t=new DataView(e.buffer,e.byteOffset,e.length),i=t.getUint32(0);if(i>Math.pow(2,21)-1){d.enqueue(o.ERROR_PACKET);break}s=i*Math.pow(2,32)+t.getUint32(4),n=3}else{if(c(r)<s)break;const e=u(r,s);d.enqueue((0,i.decodePacket)(l?e:a.decode(e),t)),n=0}if(0===s||s>e){d.enqueue(o.ERROR_PACKET);break}}}})},t.protocol=4},3137:(e,t)=>{"use strict";function r(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Object.defineProperty(t,"__esModule",{value:!0}),t.Backoff=void 0,t.Backoff=r,r.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-r:e+r}return 0|Math.min(e,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(e){this.ms=e},r.prototype.setMax=function(e){this.max=e},r.prototype.setJitter=function(e){this.jitter=e}},6580: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.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const i=r(5702),o=r(7631);Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return o.Manager}});const s=r(9189);Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return s.Socket}});const a=n(r(5130)).default("socket.io-client"),c={};function u(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};const r=i.url(e,t.path||"/socket.io"),n=r.source,s=r.id,u=r.path,l=c[s]&&u in c[s].nsps;let f;return t.forceNew||t["force new connection"]||!1===t.multiplex||l?(a("ignoring socket cache for %s",n),f=new o.Manager(n,t)):(c[s]||(a("new io instance for %s",n),c[s]=new o.Manager(n,t)),f=c[s]),r.query&&!t.query&&(t.query=r.queryKey),f.socket(r.path,t)}t.io=u,t.connect=u,t.default=u,Object.assign(u,{Manager:o.Manager,Socket:s.Socket,io:u,connect:u});var l=r(6642);Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return l.protocol}}),e.exports=u},7631: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.Manager=void 0;const a=r(1473),c=r(9189),u=o(r(6642)),l=r(6166),f=r(3137),d=r(7416),h=s(r(5130)).default("socket.io-client:manager");class p extends d.Emitter{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,a.installTimerFunctions(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=t.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new f.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const n=t.parser||u;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(h("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;h("opening %s",this.uri),this.engine=new a.Socket(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const n=l.on(t,"open",(function(){r.onopen(),e&&e()})),i=t=>{h("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},o=l.on(t,"error",i);if(!1!==this._timeout){const e=this._timeout;h("connect attempt will timeout after %d",e);const r=this.setTimeoutFn((()=>{h("connect attempt timed out after %d",e),n(),i(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&r.unref(),this.subs.push((()=>{this.clearTimeoutFn(r)}))}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){h("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(l.on(e,"ping",this.onping.bind(this)),l.on(e,"data",this.ondata.bind(this)),l.on(e,"error",this.onerror.bind(this)),l.on(e,"close",this.onclose.bind(this)),l.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){a.nextTick((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){h("error",e),this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new c.Socket(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const e of t)if(this.nsps[e].active)return void h("socket %s is still active, skipping close",e);this._close()}_packet(e){h("writing packet %j",e);const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){h("cleanup"),this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){h("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){h("closed due to %s",e),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)h("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();h("will wait %dms before reconnect attempt",t),this._reconnecting=!0;const r=this.setTimeoutFn((()=>{e.skipReconnect||(h("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(h("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):(h("reconnect success"),e.onreconnect())})))}),t);this.opts.autoUnref&&r.unref(),this.subs.push((()=>{this.clearTimeoutFn(r)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}t.Manager=p},6166:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.on=void 0,t.on=function(e,t,r){return e.on(t,r),function(){e.off(t,r)}}},9189: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.Socket=void 0;const i=r(6642),o=r(6166),s=r(7416),a=n(r(5130)).default("socket.io-client:socket"),c=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class u extends s.Emitter{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[o.on(e,"open",this.onopen.bind(this)),o.on(e,"packet",this.onpacket.bind(this)),o.on(e,"error",this.onerror.bind(this)),o.on(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(c.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const r={type:i.PacketType.EVENT,data:t,options:{}};if(r.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++;a("emitting packet with ack id %d",e);const n=t.pop();this._registerAckCallback(e,n),r.id=e}const n=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return!this.flags.volatile||n&&this.connected?this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r):a("discard packet as the transport is not currently writable"),this.flags={},this}_registerAckCallback(e,t){var r;const n=null!==(r=this.flags.timeout)&&void 0!==r?r:this._opts.ackTimeout;if(void 0===n)return void(this.acks[e]=t);const i=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&(a("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(t,1));a("event with ack id %d has timed out after %d ms",e,n),t.call(this,new Error("operation has timed out"))}),n);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(i),t.apply(this,[null,...e])}}emitWithAck(e,...t){const r=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((n,i)=>{t.push(((e,t)=>r?e?i(e):n(t):n(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...n)=>{if(r===this._queue[0])return null!==e?r.tryCount>this._opts.retries&&(a("packet [%d] is discarded after %d tries",r.id,r.tryCount),this._queue.shift(),t&&t(e)):(a("packet [%d] was successfully sent",r.id),this._queue.shift(),t&&t(null,...n)),r.pending=!1,this._drainQueue()})),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(a("draining queue"),!this.connected||0===this._queue.length)return;const t=this._queue[0];!t.pending||e?(t.pending=!0,t.tryCount++,a("sending packet [%d] (try n°%d)",t.id,t.tryCount),this.flags=t.flags,this.emit.apply(this,t.args)):a("packet [%d] has already been sent and is waiting for an ack",t.id)}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){a("transport is open - connecting"),"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:i.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){a("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case i.PacketType.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case i.PacketType.EVENT:case i.PacketType.BINARY_EVENT:this.onevent(e);break;case i.PacketType.ACK:case i.PacketType.BINARY_ACK:this.onack(e);break;case i.PacketType.DISCONNECT:this.ondisconnect();break;case i.PacketType.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...n){r||(r=!0,a("sending ack %j",n),t.packet({type:i.PacketType.ACK,id:e,data:n}))}}onack(e){const t=this.acks[e.id];"function"==typeof t?(a("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):a("bad ack %s",e.id)}onconnect(e,t){a("socket connected with id %s",e),this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:i.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}}t.Socket=u},5702: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.url=void 0;const i=r(1473),o=n(r(5130)).default("socket.io-client:url");t.url=function(e,t="",r){let n=e;r=r||"undefined"!=typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(o("protocol-less url %s",e),e=void 0!==r?r.protocol+"//"+e:"https://"+e),o("parse %s",e),n=i.parse(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const s=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+t,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}},3406:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reconstructPacket=t.deconstructPacket=void 0;const n=r(5648);function i(e,t){if(!e)return e;if((0,n.isBinary)(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}if(Array.isArray(e)){const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=i(e[n],t);return r}if("object"==typeof e&&!(e instanceof Date)){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=i(e[n],t));return r}return e}function o(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=o(e[r],t);else if("object"==typeof e)for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=o(e[r],t));return e}t.deconstructPacket=function(e){const t=[],r=e.data,n=e;return n.data=i(r,t),n.attachments=t.length,{packet:n,buffers:t}},t.reconstructPacket=function(e,t){return e.data=o(e.data,t),delete e.attachments,e}},6642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Decoder=t.Encoder=t.PacketType=t.protocol=void 0;const n=r(7416),i=r(3406),o=r(5648),s=(0,r(5130).default)("socket.io-parser"),a=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var c;function u(e){return"[object Object]"===Object.prototype.toString.call(e)}t.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(c=t.PacketType||(t.PacketType={})),t.Encoder=class{constructor(e){this.replacer=e}encode(e){return s("encoding packet %j",e),e.type!==c.EVENT&&e.type!==c.ACK||!(0,o.hasBinary)(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==c.BINARY_EVENT&&e.type!==c.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),s("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=(0,i.deconstructPacket)(e),r=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(r),n}};class l extends n.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const r=t.type===c.BINARY_EVENT;r||t.type===c.BINARY_ACK?(t.type=r?c.EVENT:c.ACK,this.reconstructor=new f(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!(0,o.isBinary)(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const r={type:Number(e.charAt(0))};if(void 0===c[r.type])throw new Error("unknown packet type "+r.type);if(r.type===c.BINARY_EVENT||r.type===c.BINARY_ACK){const n=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const i=e.substring(n,t);if(i!=Number(i)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(i)}if("/"===e.charAt(t+1)){const n=t+1;for(;++t&&","!==e.charAt(t)&&t!==e.length;);r.nsp=e.substring(n,t)}else r.nsp="/";const n=e.charAt(t+1);if(""!==n&&Number(n)==n){const n=t+1;for(;++t;){const r=e.charAt(t);if(null==r||Number(r)!=r){--t;break}if(t===e.length)break}r.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){const n=this.tryParse(e.substr(t));if(!l.isPayloadValid(r.type,n))throw new Error("invalid payload");r.data=n}return s("decoded %s as %j",e,r),r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case c.CONNECT:return u(t);case c.DISCONNECT:return void 0===t;case c.CONNECT_ERROR:return"string"==typeof t||u(t);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===a.indexOf(t[0]));case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}t.Decoder=l;class f{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=(0,i.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}},5648:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasBinary=t.isBinary=void 0;const r="function"==typeof ArrayBuffer,n=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===n.call(Blob),o="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===n.call(File);function s(e){return r&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||i&&e instanceof Blob||o&&e instanceof File}t.isBinary=s,t.hasBinary=function e(t,r){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r<n;r++)if(e(t[r]))return!0;return!1}if(s(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return!0;return!1}},2601:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{Z:()=>i})},3028:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(2601);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}},2988:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Struct:()=>l,StructError:()=>n,any:()=>x,array:()=>T,assert:()=>f,assign:()=>y,bigint:()=>P,boolean:()=>I,coerce:()=>J,create:()=>d,date:()=>k,defaulted:()=>Y,define:()=>m,deprecated:()=>b,dynamic:()=>v,empty:()=>X,enums:()=>O,func:()=>C,instance:()=>N,integer:()=>R,intersection:()=>B,is:()=>p,lazy:()=>w,literal:()=>M,map:()=>L,mask:()=>h,max:()=>te,min:()=>re,never:()=>F,nonempty:()=>ne,nullable:()=>j,number:()=>U,object:()=>D,omit:()=>A,optional:()=>Z,partial:()=>E,pattern:()=>ie,pick:()=>_,record:()=>H,refine:()=>se,regexp:()=>$,set:()=>G,size:()=>oe,string:()=>z,struct:()=>S,trimmed:()=>Q,tuple:()=>V,type:()=>W,union:()=>q,unknown:()=>K,validate:()=>g});class n extends TypeError{constructor(e,t){let r;const{message:n,explanation:i,...o}=e,{path:s}=e,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function i(e){return"object"==typeof e&&null!=e}function o(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function s(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function a(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:a}=r,{refinement:c,message:u=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${s(n)}\``}=e;return{value:n,type:a,refinement:c,key:i[i.length-1],path:i,branch:o,...e,message:u}}function*c(e,t,r,n){var o;i(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const i of e){const e=a(i,t,r,n);e&&(yield e)}}function*u(e,t,r={}){const{path:n=[],branch:o=[e],coerce:s=!1,mask:a=!1}=r,c={path:n,branch:o};if(s&&(e=t.coercer(e,c),a&&"type"!==t.type&&i(t.schema)&&i(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let l="valid";for(const n of t.validator(e,c))n.explanation=r.message,l="not_valid",yield[n,void 0];for(let[f,d,h]of t.entries(e,c)){const t=u(d,h,{path:void 0===f?n:[...n,f],branch:void 0===f?o:[...o,d],coerce:s,mask:a,message:r.message});for(const r of t)r[0]?(l=null!=r[0].refinement?"not_refined":"not_valid",yield[r[0],void 0]):s&&(d=r[1],void 0===f?e=d:e instanceof Map?e.set(f,d):e instanceof Set?e.add(d):i(e)&&(void 0!==d||f in e)&&(e[f]=d))}if("not_valid"!==l)for(const n of t.refiner(e,c))n.explanation=r.message,l="not_refined",yield[n,void 0];"valid"===l&&(yield[void 0,e])}class l{constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:o=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(e,t)=>c(n(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>c(i(e,t),t,this,e):()=>[]}assert(e,t){return f(e,this,t)}create(e,t){return d(e,this,t)}is(e){return p(e,this)}mask(e,t){return h(e,this,t)}validate(e,t={}){return g(e,this,t)}}function f(e,t,r){const n=g(e,t,{message:r});if(n[0])throw n[0]}function d(e,t,r){const n=g(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function h(e,t,r){const n=g(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function p(e,t){return!g(e,t)[0]}function g(e,t,r={}){const i=u(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(i);return o[0]?[new n(o[0],(function*(){for(const e of i)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function y(...e){const t="type"===e[0].type,r=e.map((e=>e.schema)),n=Object.assign({},...r);return t?W(n):D(n)}function m(e,t){return new l({type:e,schema:null,validator:t})}function b(e,t){return new l({...e,refiner:(t,r)=>void 0===t||e.refiner(t,r),validator:(r,n)=>void 0===r||(t(r,n),e.validator(r,n))})}function v(e){return new l({type:"dynamic",schema:null,*entries(t,r){const n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})}function w(e){let t;return new l({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})}function A(e,t){const{schema:r}=e,n={...r};for(const e of t)delete n[e];return"type"===e.type?W(n):D(n)}function E(e){const t=e instanceof l?{...e.schema}:{...e};for(const e in t)t[e]=Z(t[e]);return D(t)}function _(e,t){const{schema:r}=e,n={};for(const e of t)n[e]=r[e];return D(n)}function S(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),m(e,t)}function x(){return m("any",(()=>!0))}function T(e){return new l({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${s(e)}`})}function P(){return m("bigint",(e=>"bigint"==typeof e))}function I(){return m("boolean",(e=>"boolean"==typeof e))}function k(){return m("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${s(e)}`))}function O(e){const t={},r=e.map((e=>s(e))).join();for(const r of e)t[r]=r;return new l({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${s(t)}`})}function C(){return m("func",(e=>"function"==typeof e||`Expected a function, but received: ${s(e)}`))}function N(e){return m("instance",(t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${s(t)}`))}function R(){return m("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${s(e)}`))}function B(e){return new l({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function M(e){const t=s(e),r=typeof e;return new l({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${s(r)}`})}function L(e,t){return new l({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${s(e)}`})}function F(){return m("never",(()=>!1))}function j(e){return new l({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function U(){return m("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${s(e)}`))}function D(e){const t=e?Object.keys(e):[],r=F();return new l({type:"object",schema:e||null,*entries(n){if(e&&i(n)){const i=new Set(Object.keys(n));for(const r of t)i.delete(r),yield[r,n[r],e[r]];for(const e of i)yield[e,n[e],r]}},validator:e=>i(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>i(e)?{...e}:e})}function Z(e){return new l({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function H(e,t){return new l({type:"record",schema:null,*entries(r){if(i(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator:e=>i(e)||`Expected an object, but received: ${s(e)}`})}function $(){return m("regexp",(e=>e instanceof RegExp))}function G(e){return new l({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${s(e)}`})}function z(){return m("string",(e=>"string"==typeof e||`Expected a string, but received: ${s(e)}`))}function V(e){const t=F();return new l({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${s(e)}`})}function W(e){const t=Object.keys(e);return new l({type:"type",schema:e,*entries(r){if(i(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>i(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>i(e)?{...e}:e})}function q(e){const t=e.map((e=>e.type)).join(" | ");return new l({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const i=[];for(const t of e){const[...e]=u(r,t,n),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${s(r)}`,...i]}})}function K(){return m("unknown",(()=>!0))}function J(e,t,r){return new l({...e,coercer:(n,i)=>p(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function Y(e,t,r={}){return J(e,K(),(e=>{const n="function"==typeof t?t():t;if(void 0===e)return n;if(!r.strict&&o(e)&&o(n)){const t={...e};let r=!1;for(const e in n)void 0===t[e]&&(t[e]=n[e],r=!0);if(r)return t}return e}))}function Q(e){return J(e,z(),(e=>e.trim()))}function X(e){return se(e,"empty",(t=>{const r=ee(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``}))}function ee(e){return e instanceof Map||e instanceof Set?e.size:e.length}function te(e,t,r={}){const{exclusive:n}=r;return se(e,"max",(r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``))}function re(e,t,r={}){const{exclusive:n}=r;return se(e,"min",(r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``))}function ne(e){return se(e,"nonempty",(t=>ee(t)>0||`Expected a nonempty ${e.type} but received an empty one`))}function ie(e,t){return se(e,"pattern",(r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`))}function oe(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return se(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${i} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:o}=e;return t<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}{const{length:o}=e;return t<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}}))}function se(e,t,r){return new l({...e,*refiner(n,i){yield*e.refiner(n,i);const o=c(r(n,i),i,e,n);for(const e of o)yield{...e,refinement:t}}})}},6686:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Struct:()=>l,StructError:()=>n,any:()=>x,array:()=>T,assert:()=>f,assign:()=>y,bigint:()=>P,boolean:()=>I,coerce:()=>J,create:()=>d,date:()=>k,defaulted:()=>Y,define:()=>m,deprecated:()=>b,dynamic:()=>v,empty:()=>X,enums:()=>O,func:()=>C,instance:()=>N,integer:()=>R,intersection:()=>B,is:()=>p,lazy:()=>w,literal:()=>M,map:()=>L,mask:()=>h,max:()=>te,min:()=>re,never:()=>F,nonempty:()=>ne,nullable:()=>j,number:()=>U,object:()=>D,omit:()=>A,optional:()=>Z,partial:()=>E,pattern:()=>ie,pick:()=>_,record:()=>H,refine:()=>se,regexp:()=>$,set:()=>G,size:()=>oe,string:()=>z,struct:()=>S,trimmed:()=>Q,tuple:()=>V,type:()=>W,union:()=>q,unknown:()=>K,validate:()=>g});class n extends TypeError{constructor(e,t){let r;const{message:n,explanation:i,...o}=e,{path:s}=e,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function i(e){return"object"==typeof e&&null!=e}function o(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function s(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function a(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:a}=r,{refinement:c,message:u=`Expected a value of type \`${a}\`${c?` with refinement \`${c}\``:""}, but received: \`${s(n)}\``}=e;return{value:n,type:a,refinement:c,key:i[i.length-1],path:i,branch:o,...e,message:u}}function*c(e,t,r,n){var o;i(o=e)&&"function"==typeof o[Symbol.iterator]||(e=[e]);for(const i of e){const e=a(i,t,r,n);e&&(yield e)}}function*u(e,t,r={}){const{path:n=[],branch:o=[e],coerce:s=!1,mask:a=!1}=r,c={path:n,branch:o};if(s&&(e=t.coercer(e,c),a&&"type"!==t.type&&i(t.schema)&&i(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let l="valid";for(const n of t.validator(e,c))n.explanation=r.message,l="not_valid",yield[n,void 0];for(let[f,d,h]of t.entries(e,c)){const t=u(d,h,{path:void 0===f?n:[...n,f],branch:void 0===f?o:[...o,d],coerce:s,mask:a,message:r.message});for(const r of t)r[0]?(l=null!=r[0].refinement?"not_refined":"not_valid",yield[r[0],void 0]):s&&(d=r[1],void 0===f?e=d:e instanceof Map?e.set(f,d):e instanceof Set?e.add(d):i(e)&&(void 0!==d||f in e)&&(e[f]=d))}if("not_valid"!==l)for(const n of t.refiner(e,c))n.explanation=r.message,l="not_refined",yield[n,void 0];"valid"===l&&(yield[void 0,e])}class l{constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:o=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(e,t)=>c(n(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>c(i(e,t),t,this,e):()=>[]}assert(e,t){return f(e,this,t)}create(e,t){return d(e,this,t)}is(e){return p(e,this)}mask(e,t){return h(e,this,t)}validate(e,t={}){return g(e,this,t)}}function f(e,t,r){const n=g(e,t,{message:r});if(n[0])throw n[0]}function d(e,t,r){const n=g(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function h(e,t,r){const n=g(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function p(e,t){return!g(e,t)[0]}function g(e,t,r={}){const i=u(e,t,r),o=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(i);return o[0]?[new n(o[0],(function*(){for(const e of i)e[0]&&(yield e[0])})),void 0]:[void 0,o[1]]}function y(...e){const t="type"===e[0].type,r=e.map((e=>e.schema)),n=Object.assign({},...r);return t?W(n):D(n)}function m(e,t){return new l({type:e,schema:null,validator:t})}function b(e,t){return new l({...e,refiner:(t,r)=>void 0===t||e.refiner(t,r),validator:(r,n)=>void 0===r||(t(r,n),e.validator(r,n))})}function v(e){return new l({type:"dynamic",schema:null,*entries(t,r){const n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})}function w(e){let t;return new l({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})}function A(e,t){const{schema:r}=e,n={...r};for(const e of t)delete n[e];return"type"===e.type?W(n):D(n)}function E(e){const t=e instanceof l?{...e.schema}:{...e};for(const e in t)t[e]=Z(t[e]);return D(t)}function _(e,t){const{schema:r}=e,n={};for(const e of t)n[e]=r[e];return D(n)}function S(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),m(e,t)}function x(){return m("any",(()=>!0))}function T(e){return new l({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${s(e)}`})}function P(){return m("bigint",(e=>"bigint"==typeof e))}function I(){return m("boolean",(e=>"boolean"==typeof e))}function k(){return m("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${s(e)}`))}function O(e){const t={},r=e.map((e=>s(e))).join();for(const r of e)t[r]=r;return new l({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${s(t)}`})}function C(){return m("func",(e=>"function"==typeof e||`Expected a function, but received: ${s(e)}`))}function N(e){return m("instance",(t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${s(t)}`))}function R(){return m("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${s(e)}`))}function B(e){return new l({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function M(e){const t=s(e),r=typeof e;return new l({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${s(r)}`})}function L(e,t){return new l({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${s(e)}`})}function F(){return m("never",(()=>!1))}function j(e){return new l({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function U(){return m("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${s(e)}`))}function D(e){const t=e?Object.keys(e):[],r=F();return new l({type:"object",schema:e||null,*entries(n){if(e&&i(n)){const i=new Set(Object.keys(n));for(const r of t)i.delete(r),yield[r,n[r],e[r]];for(const e of i)yield[e,n[e],r]}},validator:e=>i(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>i(e)?{...e}:e})}function Z(e){return new l({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function H(e,t){return new l({type:"record",schema:null,*entries(r){if(i(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator:e=>i(e)||`Expected an object, but received: ${s(e)}`})}function $(){return m("regexp",(e=>e instanceof RegExp))}function G(e){return new l({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${s(e)}`})}function z(){return m("string",(e=>"string"==typeof e||`Expected a string, but received: ${s(e)}`))}function V(e){const t=F();return new l({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${s(e)}`})}function W(e){const t=Object.keys(e);return new l({type:"type",schema:e,*entries(r){if(i(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>i(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>i(e)?{...e}:e})}function q(e){const t=e.map((e=>e.type)).join(" | ");return new l({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const i=[];for(const t of e){const[...e]=u(r,t,n),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${s(r)}`,...i]}})}function K(){return m("unknown",(()=>!0))}function J(e,t,r){return new l({...e,coercer:(n,i)=>p(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function Y(e,t,r={}){return J(e,K(),(e=>{const n="function"==typeof t?t():t;if(void 0===e)return n;if(!r.strict&&o(e)&&o(n)){const t={...e};let r=!1;for(const e in n)void 0===t[e]&&(t[e]=n[e],r=!0);if(r)return t}return e}))}function Q(e){return J(e,z(),(e=>e.trim()))}function X(e){return se(e,"empty",(t=>{const r=ee(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``}))}function ee(e){return e instanceof Map||e instanceof Set?e.size:e.length}function te(e,t,r={}){const{exclusive:n}=r;return se(e,"max",(r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``))}function re(e,t,r={}){const{exclusive:n}=r;return se(e,"min",(r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``))}function ne(e){return se(e,"nonempty",(t=>ee(t)>0||`Expected a nonempty ${e.type} but received an empty one`))}function ie(e,t){return se(e,"pattern",(r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`))}function oe(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return se(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${i} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:o}=e;return t<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}{const{length:o}=e;return t<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}}))}function se(e,t,r){return new l({...e,*refiner(n,i){yield*e.refiner(n,i);const o=c(r(n,i),i,e,n);for(const e of o)yield{...e,refinement:t}}})}},7416:(e,t,r)=>{"use strict";function n(e){if(e)return function(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}(e)}r.r(t),r.d(t,{Emitter:()=>n}),n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<n.length;i++)if((r=n[i])===t||r.fn===t){n.splice(i,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){n=0;for(var i=(r=r.slice(0)).length;n<i;++n)r[n].apply(this,t)}return this},n.prototype.emitReserved=n.prototype.emit,n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},6169:(e,t,r)=>{"use strict";r.d(t,{wn:()=>B});var n=r(6830);const i=BigInt(2**32-1),o=BigInt(32);function s(e,t=!1){return t?{h:Number(e&i),l:Number(e>>o&i)}:{h:0|Number(e>>o&i),l:0|Number(e&i)}}const a=function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:a}=s(e[i],t);[r[i],n[i]]=[o,a]}return[r,n]},c=(e,t,r)=>e<<r|t>>>32-r,u=(e,t,r)=>t<<r|e>>>32-r,l=(e,t,r)=>t<<r-32|e>>>64-r,f=(e,t,r)=>e<<r-32|t>>>64-r;var d=r(6065);const[h,p,g]=[[],[],[]],y=BigInt(0),m=BigInt(1),b=BigInt(2),v=BigInt(7),w=BigInt(256),A=BigInt(113);for(let e=0,t=m,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],h.push(2*(5*n+r)),p.push((e+1)*(e+2)/2%64);let i=y;for(let e=0;e<7;e++)t=(t<<m^(t>>v)*A)%w,t&b&&(i^=m<<(m<<BigInt(e))-m);g.push(i)}const[E,_]=a(g,!0),S=(e,t,r)=>r>32?l(e,t,r):c(e,t,r),x=(e,t,r)=>r>32?f(e,t,r):u(e,t,r);class T extends d.kb{constructor(e,t,r,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.ZP.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,d.Jq)(this.state)}keccak(){!function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=S(o,s,1)^r[n],c=x(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=p[r],o=S(t,i,n),s=x(t,i,n),a=h[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=E[n],e[1]^=_[n]}r.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){n.ZP.exists(this);const{blockLen:t,state:r}=this,i=(e=(0,d.O0)(e)).length;for(let n=0;n<i;){const o=Math.min(t-this.pos,i-n);for(let t=0;t<o;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,0!=(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){n.ZP.exists(this,!1),n.ZP.bytes(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return n.ZP.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(n.ZP.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new T(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}const P=(e,t,r)=>(0,d.hE)((()=>new T(t,e,r))),I=(P(6,144,28),P(6,136,32),P(6,104,48),P(6,72,64),P(1,144,28)),k=P(1,136,32),O=P(1,104,48),C=P(1,72,64),N=(e,t,r)=>(0,d.gz)(((n={})=>new T(t,e,void 0===n.dkLen?r:n.dkLen,!0)));N(31,168,16),N(31,136,32);var R=r(2791);(0,R.gn)(I);const B=(()=>{const e=(0,R.gn)(k);return e.create=k.create,e})();(0,R.gn)(O),(0,R.gn)(C)},2791:(e,t,r)=>{"use strict";r.d(t,{gn:()=>a,hD:()=>s,iY:()=>i.iY,nr:()=>o});var n=r(6830),i=r(6065);function o(e){const t=e.startsWith("0x")?e.substring(2):e;return(0,i.nr)(t)}function s(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function a(e){return t=>(n.ZP.bytes(t),e(t))}n.ZP.bool,n.ZP.bytes,(()=>{const e="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,t="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);t&&!e&&t("crypto")})()},6830:(e,t,r)=>{"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}r.d(t,{ZP:()=>o});const o={number:n,bool:function(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:i,hash:function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)},exists:function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},output:function(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}}},6065:(e,t,r)=>{"use strict";r.d(t,{kb:()=>d,eV:()=>f,GL:()=>s,nr:()=>c,O6:()=>g,np:()=>a,O0:()=>l,Jq:()=>o,iY:()=>u,hE:()=>h,gz:()=>p});const n="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,i=e=>e instanceof Uint8Array,o=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),s=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function c(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[t]=o}return r}function u(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function l(e){if("string"==typeof e&&(e=u(e)),!i(e))throw new Error("expected Uint8Array, got "+typeof e);return e}function f(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!i(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t}Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));class d{clone(){return this._cloneInto()}}function h(e){const t=t=>e().update(l(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function p(e){const t=(t,r)=>e(r).update(l(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function g(e=32){if(n&&"function"==typeof n.getRandomValues)return n.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},4649:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(8804);const i=function(e,t){for(var r=e.length;r--;)if((0,n.Z)(e[r][0],t))return r;return-1};var o=Array.prototype.splice;function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s.prototype.clear=function(){this.__data__=[],this.size=0},s.prototype.delete=function(e){var t=this.__data__,r=i(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))},s.prototype.get=function(e){var t=this.__data__,r=i(t,e);return r<0?void 0:t[r][1]},s.prototype.has=function(e){return i(this.__data__,e)>-1},s.prototype.set=function(e,t){var r=this.__data__,n=i(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};const a=s},8896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(5900),i=r(3221);const o=(0,n.Z)(i.Z,"Map")},3703:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});const n=(0,r(5900).Z)(Object,"create");var i=Object.prototype.hasOwnProperty;var o=Object.prototype.hasOwnProperty;function s(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}s.prototype.clear=function(){this.__data__=n?n(null):{},this.size=0},s.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},s.prototype.get=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0},s.prototype.has=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)},s.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this};const a=s;var c=r(4649),u=r(8896);const l=function(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map};function f(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}f.prototype.clear=function(){this.size=0,this.__data__={hash:new a,map:new(u.Z||c.Z),string:new a}},f.prototype.delete=function(e){var t=l(this,e).delete(e);return this.size-=t?1:0,t},f.prototype.get=function(e){return l(this,e).get(e)},f.prototype.has=function(e){return l(this,e).has(e)},f.prototype.set=function(e,t){var r=l(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};const d=f},7459:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(5900),i=r(3221);const o=(0,n.Z)(i.Z,"Set")},6806:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(3703);function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n.Z;++t<r;)this.add(e[t])}i.prototype.add=i.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},i.prototype.has=function(e){return this.__data__.has(e)};const o=i},6218:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(4649);var i=r(8896),o=r(3703);function s(e){var t=this.__data__=new n.Z(e);this.size=t.size}s.prototype.clear=function(){this.__data__=new n.Z,this.size=0},s.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},s.prototype.get=function(e){return this.__data__.get(e)},s.prototype.has=function(e){return this.__data__.has(e)},s.prototype.set=function(e,t){var r=this.__data__;if(r instanceof n.Z){var s=r.__data__;if(!i.Z||s.length<199)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new o.Z(s)}return r.set(e,t),this.size=r.size,this};const a=s},187:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=r(3221).Z.Symbol},8282:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=r(3221).Z.Uint8Array},4197:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(5900),i=r(3221);const o=(0,n.Z)(i.Z,"WeakMap")},4537:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7288:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},2300:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}},5423:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(9510),i=r(4248),o=r(7885),s=r(7924),a=r(6401),c=r(8127),u=Object.prototype.hasOwnProperty;const l=function(e,t){var r=(0,o.Z)(e),l=!r&&(0,i.Z)(e),f=!r&&!l&&(0,s.Z)(e),d=!r&&!l&&!f&&(0,c.Z)(e),h=r||l||f||d,p=h?(0,n.Z)(e.length,String):[],g=p.length;for(var y in e)!t&&!u.call(e,y)||h&&("length"==y||f&&("offset"==y||"parent"==y)||d&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||(0,a.Z)(y,g))||p.push(y);return p}},9423:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},5810:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},9395:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},6299:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(905),i=r(8804),o=Object.prototype.hasOwnProperty;const s=function(e,t,r){var s=e[t];o.call(e,t)&&(0,i.Z)(s,r)&&(void 0!==r||t in e)||(0,n.Z)(e,t,r)}},2779:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(2436),i=r(649);const o=function(e,t){return e&&(0,n.Z)(t,(0,i.Z)(t),e)}},905:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(5088);const i=function(e,t,r){"__proto__"==t&&n.Z?(0,n.Z)(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},7589:(e,t,r)=>{"use strict";r.d(t,{Z:()=>M});var n=r(6218),i=r(7288),o=r(6299),s=r(2779),a=r(2436),c=r(7477);var u=r(5056),l=r(1162),f=r(2979);var d=r(8390);var h=r(7245),p=r(9878),g=r(7458),y=Object.prototype.hasOwnProperty;var m=r(6181);var b=/\w*$/;var v=r(187),w=v.Z?v.Z.prototype:void 0,A=w?w.valueOf:void 0;var E=r(6735);const _=function(e,t,r){var n,i,o,s=e.constructor;switch(t){case"[object ArrayBuffer]":return(0,m.Z)(e);case"[object Boolean]":case"[object Date]":return new s(+e);case"[object DataView]":return function(e,t){var r=t?(0,m.Z)(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return(0,E.Z)(e,r);case"[object Map]":case"[object Set]":return new s;case"[object Number]":case"[object String]":return new s(e);case"[object RegExp]":return(o=new(i=e).constructor(i.source,b.exec(i))).lastIndex=i.lastIndex,o;case"[object Symbol]":return n=e,A?Object(A.call(n)):{}}};var S=r(8670),x=r(7885),T=r(7924),P=r(2434),I=r(3122),k=r(3267),O=r(649),C="[object Arguments]",N="[object Function]",R="[object Object]",B={};B[C]=B["[object Array]"]=B["[object ArrayBuffer]"]=B["[object DataView]"]=B["[object Boolean]"]=B["[object Date]"]=B["[object Float32Array]"]=B["[object Float64Array]"]=B["[object Int8Array]"]=B["[object Int16Array]"]=B["[object Int32Array]"]=B["[object Map]"]=B["[object Number]"]=B[R]=B["[object RegExp]"]=B["[object Set]"]=B["[object String]"]=B["[object Symbol]"]=B["[object Uint8Array]"]=B["[object Uint8ClampedArray]"]=B["[object Uint16Array]"]=B["[object Uint32Array]"]=!0,B["[object Error]"]=B[N]=B["[object WeakMap]"]=!1;const M=function e(t,r,m,b,v,w){var A,E=1&r,M=2&r,L=4&r;if(m&&(A=v?m(t,b,v,w):m(t)),void 0!==A)return A;if(!(0,I.Z)(t))return t;var F=(0,x.Z)(t);if(F){if(A=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&y.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(t),!E)return(0,l.Z)(t,A)}else{var j=(0,g.Z)(t),U=j==N||"[object GeneratorFunction]"==j;if((0,T.Z)(t))return(0,u.Z)(t,E);if(j==R||j==C||U&&!v){if(A=M||U?{}:(0,S.Z)(t),!E)return M?function(e,t){return(0,a.Z)(e,(0,d.Z)(e),t)}(t,function(e,t){return e&&(0,a.Z)(t,(0,c.Z)(t),e)}(A,t)):function(e,t){return(0,a.Z)(e,(0,f.Z)(e),t)}(t,(0,s.Z)(A,t))}else{if(!B[j])return v?t:{};A=_(t,j,E)}}w||(w=new n.Z);var D=w.get(t);if(D)return D;w.set(t,A),(0,k.Z)(t)?t.forEach((function(n){A.add(e(n,r,m,n,t,w))})):(0,P.Z)(t)&&t.forEach((function(n,i){A.set(i,e(n,r,m,i,t,w))}));var Z=L?M?p.Z:h.Z:M?c.Z:O.Z,H=F?void 0:Z(t);return(0,i.Z)(H||t,(function(n,i){H&&(n=t[i=n]),(0,o.Z)(A,i,e(n,r,m,i,t,w))})),A}},3376:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(3122),i=Object.create;const o=function(){function e(){}return function(t){if(!(0,n.Z)(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}()},9471:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(475);const i=(0,r(6798).Z)(n.Z)},3338:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});var n=r(5810),i=r(187),o=r(4248),s=r(7885),a=i.Z?i.Z.isConcatSpreadable:void 0;const c=function(e){return(0,s.Z)(e)||(0,o.Z)(e)||!!(a&&e&&e[a])},u=function e(t,r,i,o,s){var a=-1,u=t.length;for(i||(i=c),s||(s=[]);++a<u;){var l=t[a];r>0&&i(l)?r>1?e(l,r-1,i,o,s):(0,n.Z)(s,l):o||(s[s.length]=l)}return s}},7818:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=(0,r(4311).Z)()},475:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(7818),i=r(649);const o=function(e,t){return e&&(0,n.Z)(e,t,i.Z)}},9523:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(2082),i=r(7969);const o=function(e,t){for(var r=0,o=(t=(0,n.Z)(t,e)).length;null!=e&&r<o;)e=e[(0,i.Z)(t[r++])];return r&&r==o?e:void 0}},7277:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(5810),i=r(7885);const o=function(e,t,r){var o=t(e);return(0,i.Z)(e)?o:(0,n.Z)(o,r(e))}},9001:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(187),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n.Z?n.Z.toStringTag:void 0;var c=Object.prototype.toString;var u=n.Z?n.Z.toStringTag:void 0;const l=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u&&u in Object(e)?function(e){var t=o.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var i=s.call(e);return n&&(t?e[a]=r:delete e[a]),i}(e):function(e){return c.call(e)}(e)}},4989:(e,t,r)=>{"use strict";r.d(t,{Z:()=>P});var n=r(6218),i=r(6806),o=r(9395),s=r(1749);const a=function(e,t,r,n,a,c){var u=1&r,l=e.length,f=t.length;if(l!=f&&!(u&&f>l))return!1;var d=c.get(e),h=c.get(t);if(d&&h)return d==t&&h==e;var p=-1,g=!0,y=2&r?new i.Z:void 0;for(c.set(e,t),c.set(t,e);++p<l;){var m=e[p],b=t[p];if(n)var v=u?n(b,m,p,t,e,c):n(m,b,p,e,t,c);if(void 0!==v){if(v)continue;g=!1;break}if(y){if(!(0,o.Z)(t,(function(e,t){if(!(0,s.Z)(y,t)&&(m===e||a(m,e,r,n,c)))return y.push(t)}))){g=!1;break}}else if(m!==b&&!a(m,b,r,n,c)){g=!1;break}}return c.delete(e),c.delete(t),g};var c=r(187),u=r(8282),l=r(8804),f=r(5500),d=r(3249),h=c.Z?c.Z.prototype:void 0,p=h?h.valueOf:void 0;var g=r(7245),y=Object.prototype.hasOwnProperty;var m=r(7458),b=r(7885),v=r(7924),w=r(8127),A="[object Arguments]",E="[object Array]",_="[object Object]",S=Object.prototype.hasOwnProperty;const x=function(e,t,r,i,o,s){var c=(0,b.Z)(e),h=(0,b.Z)(t),x=c?E:(0,m.Z)(e),T=h?E:(0,m.Z)(t),P=(x=x==A?_:x)==_,I=(T=T==A?_:T)==_,k=x==T;if(k&&(0,v.Z)(e)){if(!(0,v.Z)(t))return!1;c=!0,P=!1}if(k&&!P)return s||(s=new n.Z),c||(0,w.Z)(e)?a(e,t,r,i,o,s):function(e,t,r,n,i,o,s){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new u.Z(e),new u.Z(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,l.Z)(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var c=f.Z;case"[object Set]":var h=1&n;if(c||(c=d.Z),e.size!=t.size&&!h)return!1;var g=s.get(e);if(g)return g==t;n|=2,s.set(e,t);var y=a(c(e),c(t),n,i,o,s);return s.delete(e),y;case"[object Symbol]":if(p)return p.call(e)==p.call(t)}return!1}(e,t,x,r,i,o,s);if(!(1&r)){var O=P&&S.call(e,"__wrapped__"),C=I&&S.call(t,"__wrapped__");if(O||C){var N=O?e.value():e,R=C?t.value():t;return s||(s=new n.Z),o(N,R,r,i,s)}}return!!k&&(s||(s=new n.Z),function(e,t,r,n,i,o){var s=1&r,a=(0,g.Z)(e),c=a.length;if(c!=(0,g.Z)(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:y.call(t,l)))return!1}var f=o.get(e),d=o.get(t);if(f&&d)return f==t&&d==e;var h=!0;o.set(e,t),o.set(t,e);for(var p=s;++u<c;){var m=e[l=a[u]],b=t[l];if(n)var v=s?n(b,m,l,t,e,o):n(m,b,l,e,t,o);if(!(void 0===v?m===b||i(m,b,r,n,o):v)){h=!1;break}p||(p="constructor"==l)}if(h&&!p){var w=e.constructor,A=t.constructor;w==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof A&&A instanceof A||(h=!1)}return o.delete(e),o.delete(t),h}(e,t,r,i,o,s))};var T=r(3391);const P=function e(t,r,n,i,o){return t===r||(null==t||null==r||!(0,T.Z)(t)&&!(0,T.Z)(r)?t!=t&&r!=r:x(t,r,n,i,e,o))}},5026:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(6218),i=r(4989);const o=function(e,t,r,o){var s=r.length,a=s,c=!o;if(null==e)return!a;for(e=Object(e);s--;){var u=r[s];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++s<a;){var l=(u=r[s])[0],f=e[l],d=u[1];if(c&&u[2]){if(void 0===f&&!(l in e))return!1}else{var h=new n.Z;if(o)var p=o(f,d,l,e,t,h);if(!(void 0===p?(0,i.Z)(d,f,3,o,h):p))return!1}}return!0}},3193:(e,t,r)=>{"use strict";r.d(t,{Z:()=>g});var n,i=r(8936),o=r(1105),s=(n=/[^.]+$/.exec(o.Z&&o.Z.keys&&o.Z.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";var a=r(3122),c=r(6682),u=/^\[object .+?Constructor\]$/,l=Function.prototype,f=Object.prototype,d=l.toString,h=f.hasOwnProperty,p=RegExp("^"+d.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const g=function(e){return!(!(0,a.Z)(e)||(t=e,s&&s in t))&&((0,i.Z)(e)?p:u).test((0,c.Z)(e));var t}},699:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(5303),i=r(7965),o=r(9930),s=r(7885),a=r(4902);const c=function(e){return"function"==typeof e?e:null==e?o.Z:"object"==typeof e?(0,s.Z)(e)?(0,i.Z)(e[0],e[1]):(0,n.Z)(e):(0,a.Z)(e)}},3917:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(5441);const i=(0,r(6048).Z)(Object.keys,Object);var o=Object.prototype.hasOwnProperty;const s=function(e){if(!(0,n.Z)(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},9657:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(9471),i=r(3282);const o=function(e,t){var r=-1,o=(0,i.Z)(e)?Array(e.length):[];return(0,n.Z)(e,(function(e,n,i){o[++r]=t(e,n,i)})),o}},5303:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(5026),i=r(6676),o=r(6659);const s=function(e){var t=(0,i.Z)(e);return 1==t.length&&t[0][2]?(0,o.Z)(t[0][0],t[0][1]):function(r){return r===e||(0,n.Z)(r,e,t)}}},7965:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(4989),i=r(772),o=r(9666),s=r(3502),a=r(7706),c=r(6659),u=r(7969);const l=function(e,t){return(0,s.Z)(e)&&(0,a.Z)(t)?(0,c.Z)((0,u.Z)(e),t):function(r){var s=(0,i.Z)(r,e);return void 0===s&&s===t?(0,o.Z)(r,e):(0,n.Z)(t,s,3)}}},3258:(e,t,r)=>{"use strict";r.d(t,{Z:()=>_});var n=r(6218),i=r(905),o=r(8804);const s=function(e,t,r){(void 0!==r&&!(0,o.Z)(e[t],r)||void 0===r&&!(t in e))&&(0,i.Z)(e,t,r)};var a=r(7818),c=r(5056),u=r(6735),l=r(1162),f=r(8670),d=r(4248),h=r(7885),p=r(7539),g=r(7924),y=r(8936),m=r(3122),b=r(5255),v=r(8127);const w=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var A=r(7619);var E=r(7477);const _=function e(t,r,i,o,_){t!==r&&(0,a.Z)(r,(function(a,E){if(_||(_=new n.Z),(0,m.Z)(a))!function(e,t,r,n,i,o,a){var E=w(e,r),_=w(t,r),S=a.get(_);if(S)s(e,r,S);else{var x=o?o(E,_,r+"",e,t,a):void 0,T=void 0===x;if(T){var P=(0,h.Z)(_),I=!P&&(0,g.Z)(_),k=!P&&!I&&(0,v.Z)(_);x=_,P||I||k?(0,h.Z)(E)?x=E:(0,p.Z)(E)?x=(0,l.Z)(E):I?(T=!1,x=(0,c.Z)(_,!0)):k?(T=!1,x=(0,u.Z)(_,!0)):x=[]:(0,b.Z)(_)||(0,d.Z)(_)?(x=E,(0,d.Z)(E)?x=(0,A.Z)(E):(0,m.Z)(E)&&!(0,y.Z)(E)||(x=(0,f.Z)(_))):T=!1}T&&(a.set(_,x),i(x,_,n,o,a),a.delete(_)),s(e,r,x)}}(t,r,E,i,e,o,_);else{var S=o?o(w(t,E),a,E+"",t,r,_):void 0;void 0===S&&(S=a),s(t,E,S)}}),E.Z)}},8136:(e,t,r)=>{"use strict";r.d(t,{Z:()=>f});var n=r(9423),i=r(9523),o=r(699),s=r(9657);var a=r(3225),c=r(827);var u=r(9930),l=r(7885);const f=function(e,t,r){t=t.length?(0,n.Z)(t,(function(e){return(0,l.Z)(e)?function(t){return(0,i.Z)(t,1===e.length?e[0]:e)}:e})):[u.Z];var f=-1;return t=(0,n.Z)(t,(0,a.Z)(o.Z)),function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}((0,s.Z)(e,(function(e,r,i){return{criteria:(0,n.Z)(t,(function(t){return t(e)})),index:++f,value:e}})),(function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;++n<s;){var u=(0,c.Z)(i[n],o[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}},2767:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(9523),i=r(4187),o=r(2082);const s=function(e,t,r){for(var s=-1,a=t.length,c={};++s<a;){var u=t[s],l=(0,n.Z)(e,u);r(l,u)&&(0,i.Z)(c,(0,o.Z)(u,e),l)}return c}},5523:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){return function(t){return null==t?void 0:t[e]}}},6493:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(9930),i=r(4085),o=r(9856);const s=function(e,t){return(0,o.Z)((0,i.Z)(e,t,n.Z),e+"")}},4187:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(6299),i=r(2082),o=r(6401),s=r(3122),a=r(7969);const c=function(e,t,r,c){if(!(0,s.Z)(e))return e;for(var u=-1,l=(t=(0,i.Z)(t,e)).length,f=l-1,d=e;null!=d&&++u<l;){var h=(0,a.Z)(t[u]),p=r;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(u!=f){var g=d[h];void 0===(p=c?c(g,h,d):void 0)&&(p=(0,s.Z)(g)?g:(0,o.Z)(t[u+1])?[]:{})}(0,n.Z)(d,h,p),d=d[h]}return e}},9510:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},9200:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});var n=r(187),i=r(9423),o=r(7885),s=r(2758),a=n.Z?n.Z.prototype:void 0,c=a?a.toString:void 0;const u=function e(t){if("string"==typeof t)return t;if((0,o.Z)(t))return(0,i.Z)(t,e)+"";if((0,s.Z)(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},3225:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){return function(t){return e(t)}}},1749:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){return e.has(t)}},2082:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(7885),i=r(3502),o=r(376),s=r(5186);const a=function(e,t){return(0,n.Z)(e)?e:(0,i.Z)(e,t)?[e]:(0,o.Z)((0,s.Z)(e))}},6181:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(8282);const i=function(e){var t=new e.constructor(e.byteLength);return new n.Z(t).set(new n.Z(e)),t}},5056:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(3221),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof module&&module&&!module.nodeType&&module,s=o&&o.exports===i?n.Z.Buffer:void 0,a=s?s.allocUnsafe:void 0;const c=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}},6735:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(6181);const i=function(e,t){var r=t?(0,n.Z)(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},827:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(2758);const i=function(e,t){if(e!==t){var r=void 0!==e,i=null===e,o=e==e,s=(0,n.Z)(e),a=void 0!==t,c=null===t,u=t==t,l=(0,n.Z)(t);if(!c&&!l&&!s&&e>t||s&&a&&u&&!c&&!l||i&&a&&u||!r&&u||!o)return 1;if(!i&&!s&&!l&&e<t||l&&r&&o&&!i&&!s||c&&r&&o||!a&&o||!u)return-1}return 0}},1162:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},2436:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(6299),i=r(905);const o=function(e,t,r,o){var s=!r;r||(r={});for(var a=-1,c=t.length;++a<c;){var u=t[a],l=o?o(r[u],e[u],u,r,e):void 0;void 0===l&&(l=e[u]),s?(0,i.Z)(r,u,l):(0,n.Z)(r,u,l)}return r}},1105:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=r(3221).Z["__core-js_shared__"]},1758:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});const n=function(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(n,s,r(s),e)}return n};var i=r(9471);const o=function(e,t,r,n){return(0,i.Z)(e,(function(e,i,o){t(n,e,r(e),o)})),n};var s=r(699),a=r(7885);const c=function(e,t){return function(r,i){var c=(0,a.Z)(r)?n:o,u=t?t():{};return c(r,e,(0,s.Z)(i,2),u)}}},3625:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(6493),i=r(5965);const o=function(e){return(0,n.Z)((function(t,r){var n=-1,o=r.length,s=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(s=e.length>3&&"function"==typeof s?(o--,s):void 0,a&&(0,i.Z)(r[0],r[1],a)&&(s=o<3?void 0:s,o=1),t=Object(t);++n<o;){var c=r[n];c&&e(t,c,n,s)}return t}))}},6798:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(3282);const i=function(e,t){return function(r,i){if(null==r)return r;if(!(0,n.Z)(r))return e(r,i);for(var o=r.length,s=t?o:-1,a=Object(r);(t?s--:++s<o)&&!1!==i(a[s],s,a););return r}}},4311:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){return function(t,r,n){for(var i=-1,o=Object(t),s=n(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===r(o[c],c,o))break}return t}}},5088:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(5900);const i=function(){try{var e=(0,n.Z)(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},2168:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n="object"==typeof global&&global&&global.Object===Object&&global},7245:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(7277),i=r(2979),o=r(649);const s=function(e){return(0,n.Z)(e,o.Z,i.Z)}},9878:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(7277),i=r(8390),o=r(7477);const s=function(e){return(0,n.Z)(e,o.Z,i.Z)}},6676:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(7706),i=r(649);const o=function(e){for(var t=(0,i.Z)(e),r=t.length;r--;){var o=t[r],s=e[o];t[r]=[o,s,(0,n.Z)(s)]}return t}},5900:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(3193);const i=function(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return(0,n.Z)(r)?r:void 0}},9552:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=(0,r(6048).Z)(Object.getPrototypeOf,Object)},2979:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(2300),i=r(813),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols;const a=s?function(e){return null==e?[]:(e=Object(e),(0,n.Z)(s(e),(function(t){return o.call(e,t)})))}:i.Z},8390:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(5810),i=r(9552),o=r(2979),s=r(813);const a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)(0,n.Z)(t,(0,o.Z)(e)),e=(0,i.Z)(e);return t}:s.Z},7458:(e,t,r)=>{"use strict";r.d(t,{Z:()=>_});var n=r(5900),i=r(3221);const o=(0,n.Z)(i.Z,"DataView");var s=r(8896);const a=(0,n.Z)(i.Z,"Promise");var c=r(7459),u=r(4197),l=r(9001),f=r(6682),d="[object Map]",h="[object Promise]",p="[object Set]",g="[object WeakMap]",y="[object DataView]",m=(0,f.Z)(o),b=(0,f.Z)(s.Z),v=(0,f.Z)(a),w=(0,f.Z)(c.Z),A=(0,f.Z)(u.Z),E=l.Z;(o&&E(new o(new ArrayBuffer(1)))!=y||s.Z&&E(new s.Z)!=d||a&&E(a.resolve())!=h||c.Z&&E(new c.Z)!=p||u.Z&&E(new u.Z)!=g)&&(E=function(e){var t=(0,l.Z)(e),r="[object Object]"==t?e.constructor:void 0,n=r?(0,f.Z)(r):"";if(n)switch(n){case m:return y;case b:return d;case v:return h;case w:return p;case A:return g}return t});const _=E},8693:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});var n=r(2082),i=r(4248),o=r(7885),s=r(6401),a=r(1164),c=r(7969);const u=function(e,t,r){for(var u=-1,l=(t=(0,n.Z)(t,e)).length,f=!1;++u<l;){var d=(0,c.Z)(t[u]);if(!(f=null!=e&&r(e,d)))break;e=e[d]}return f||++u!=l?f:!!(l=null==e?0:e.length)&&(0,a.Z)(l)&&(0,s.Z)(d,l)&&((0,o.Z)(e)||(0,i.Z)(e))}},8670:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(3376),i=r(9552),o=r(5441);const s=function(e){return"function"!=typeof e.constructor||(0,o.Z)(e)?{}:(0,n.Z)((0,i.Z)(e))}},6401:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=/^(?:0|[1-9]\d*)$/;const i=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},5965:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(8804),i=r(3282),o=r(6401),s=r(3122);const a=function(e,t,r){if(!(0,s.Z)(r))return!1;var a=typeof t;return!!("number"==a?(0,i.Z)(r)&&(0,o.Z)(t,r.length):"string"==a&&t in r)&&(0,n.Z)(r[t],e)}},3502:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(7885),i=r(2758),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;const a=function(e,t){if((0,n.Z)(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!(0,i.Z)(e))||s.test(e)||!o.test(e)||null!=t&&e in Object(t)}},5441:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=Object.prototype;const i=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},7706:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(3122);const i=function(e){return e==e&&!(0,n.Z)(e)}},5500:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},6659:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},7755:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(2168),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof module&&module&&!module.nodeType&&module,s=o&&o.exports===i&&n.Z.process;const a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}()},6048:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){return function(r){return e(t(r))}}},4085:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(4537),i=Math.max;const o=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,s=-1,a=i(o.length-t,0),c=Array(a);++s<a;)c[s]=o[t+s];s=-1;for(var u=Array(t+1);++s<t;)u[s]=o[s];return u[t]=r(c),(0,n.Z)(e,this,u)}}},3221:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(2168),i="object"==typeof self&&self&&self.Object===Object&&self;const o=n.Z||i||Function("return this")()},3249:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},9856:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(6456),i=r(5088),o=r(9930);const s=i.Z?function(e,t){return(0,i.Z)(e,"toString",{configurable:!0,enumerable:!1,value:(0,n.Z)(t),writable:!0})}:o.Z,a=(0,r(4695).Z)(s)},4695:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=Date.now;const i=function(e){var t=0,r=0;return function(){var i=n(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},376:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(7068),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g;const s=(a=(0,n.Z)((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(o,"$1"):r||e)})),t}),(function(e){return 500===c.size&&c.clear(),e})),c=a.cache,a);var a,c},7969:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(2758);const i=function(e){if("string"==typeof e||(0,n.Z)(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},6682:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=Function.prototype.toString;const i=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7921:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(7589);const i=function(e){return(0,n.Z)(e,5)}},6456:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){return function(){return e}}},8804:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e,t){return e===t||e!=e&&t!=t}},772:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(9523);const i=function(e,t,r){var i=null==e?void 0:(0,n.Z)(e,t);return void 0===i?r:i}},9666:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});const n=function(e,t){return null!=e&&t in Object(e)};var i=r(8693);const o=function(e,t){return null!=e&&(0,i.Z)(e,t,n)}},9930:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){return e}},4248:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});var n=r(9001),i=r(3391);const o=function(e){return(0,i.Z)(e)&&"[object Arguments]"==(0,n.Z)(e)};var s=Object.prototype,a=s.hasOwnProperty,c=s.propertyIsEnumerable;const u=o(function(){return arguments}())?o:function(e){return(0,i.Z)(e)&&a.call(e,"callee")&&!c.call(e,"callee")}},7885:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=Array.isArray},3282:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(8936),i=r(1164);const o=function(e){return null!=e&&(0,i.Z)(e.length)&&!(0,n.Z)(e)}},7539:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(3282),i=r(3391);const o=function(e){return(0,i.Z)(e)&&(0,n.Z)(e)}},7924:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(3221),i=r(1433),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=o&&"object"==typeof module&&module&&!module.nodeType&&module,a=s&&s.exports===o?n.Z.Buffer:void 0;const c=(a?a.isBuffer:void 0)||i.Z},8936:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(9001),i=r(3122);const o=function(e){if(!(0,i.Z)(e))return!1;var t=(0,n.Z)(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1164:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},2434:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(7458),i=r(3391);var o=r(3225),s=r(7755),a=s.Z&&s.Z.isMap;const c=a?(0,o.Z)(a):function(e){return(0,i.Z)(e)&&"[object Map]"==(0,n.Z)(e)}},3122:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},3391:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){return null!=e&&"object"==typeof e}},5255:(e,t,r)=>{"use strict";r.d(t,{Z:()=>f});var n=r(9001),i=r(9552),o=r(3391),s=Function.prototype,a=Object.prototype,c=s.toString,u=a.hasOwnProperty,l=c.call(Object);const f=function(e){if(!(0,o.Z)(e)||"[object Object]"!=(0,n.Z)(e))return!1;var t=(0,i.Z)(e);if(null===t)return!0;var r=u.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==l}},3267:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(7458),i=r(3391);var o=r(3225),s=r(7755),a=s.Z&&s.Z.isSet;const c=a?(0,o.Z)(a):function(e){return(0,i.Z)(e)&&"[object Set]"==(0,n.Z)(e)}},2758:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(9001),i=r(3391);const o=function(e){return"symbol"==typeof e||(0,i.Z)(e)&&"[object Symbol]"==(0,n.Z)(e)}},8127:(e,t,r)=>{"use strict";r.d(t,{Z:()=>l});var n=r(9001),i=r(1164),o=r(3391),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var a=r(3225),c=r(7755),u=c.Z&&c.Z.isTypedArray;const l=u?(0,a.Z)(u):function(e){return(0,o.Z)(e)&&(0,i.Z)(e.length)&&!!s[(0,n.Z)(e)]}},9164:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(905);const i=(0,r(1758).Z)((function(e,t,r){(0,n.Z)(e,r,t)}))},649:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(5423),i=r(3917),o=r(3282);const s=function(e){return(0,o.Z)(e)?(0,n.Z)(e):(0,i.Z)(e)}},7477:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});var n=r(5423),i=r(3122),o=r(5441);var s=Object.prototype.hasOwnProperty;const a=function(e){if(!(0,i.Z)(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=(0,o.Z)(e),r=[];for(var n in e)("constructor"!=n||!t&&s.call(e,n))&&r.push(n);return r};var c=r(3282);const u=function(e){return(0,c.Z)(e)?(0,n.Z)(e,!0):a(e)}},5003:(e,t,r)=>{"use strict";r.r(t),r.d(t,{add:()=>a,after:()=>w,ary:()=>Ee,assign:()=>Ce,assignIn:()=>Be,assignInWith:()=>Le,assignWith:()=>je,at:()=>ze,attempt:()=>Ye,before:()=>Qe,bind:()=>et,bindAll:()=>nt,bindKey:()=>ot,camelCase:()=>sr,capitalize:()=>Tt,castArray:()=>ar,ceil:()=>fr,chain:()=>dr,chunk:()=>yr,clamp:()=>br,clone:()=>wr,cloneDeep:()=>Ar.Z,cloneDeepWith:()=>Er,cloneWith:()=>_r,commit:()=>Sr,compact:()=>xr,concat:()=>Pr,cond:()=>Or,conforms:()=>Nr,conformsTo:()=>Rr,constant:()=>Br.Z,countBy:()=>Fr,create:()=>Ur,curry:()=>Zr,curryRight:()=>$r,debounce:()=>Wr,deburr:()=>Nt,default:()=>Nf,defaultTo:()=>qr,defaults:()=>Xr,defaultsDeep:()=>on,defer:()=>cn,delay:()=>ln,difference:()=>mn,differenceBy:()=>vn,differenceWith:()=>wn,divide:()=>An,drop:()=>En,dropRight:()=>_n,dropRightWhile:()=>xn,dropWhile:()=>Tn,each:()=>kn,eachRight:()=>Bn,endsWith:()=>Mn,entries:()=>Un,entriesIn:()=>Dn,eq:()=>Kr.Z,escape:()=>Gn,escapeRegExp:()=>Wn,every:()=>Jn,extend:()=>Be,extendWith:()=>Le,fill:()=>Qn,filter:()=>ti,find:()=>oi,findIndex:()=>ii,findKey:()=>ci,findLast:()=>di,findLastIndex:()=>fi,findLastKey:()=>hi,first:()=>pi,flatMap:()=>mi,flatMapDeep:()=>bi,flatMapDepth:()=>vi,flatten:()=>He,flattenDeep:()=>wi,flattenDepth:()=>Ai,flip:()=>Ei,floor:()=>_i,flow:()=>xi,flowRight:()=>Ti,forEach:()=>kn,forEachRight:()=>Bn,forIn:()=>Ii,forInRight:()=>ki,forOwn:()=>Oi,forOwnRight:()=>Ci,fromPairs:()=>Ni,functions:()=>Mi,functionsIn:()=>Li,get:()=>Ue.Z,groupBy:()=>ji,gt:()=>Zi,gte:()=>Hi,has:()=>Vi,hasIn:()=>Wi.Z,head:()=>pi,identity:()=>A.Z,inRange:()=>Ji,includes:()=>to,indexOf:()=>no,initial:()=>io,intersection:()=>co,intersectionBy:()=>uo,intersectionWith:()=>lo,invert:()=>po,invertBy:()=>bo,invoke:()=>_o,invokeMap:()=>So,isArguments:()=>xo.Z,isArray:()=>z.Z,isArrayBuffer:()=>Io,isArrayLike:()=>Te.Z,isArrayLikeObject:()=>yn.Z,isBoolean:()=>ko,isBuffer:()=>Oo.Z,isDate:()=>No,isElement:()=>Ro,isEmpty:()=>Fo,isEqual:()=>Uo,isEqualWith:()=>Do,isError:()=>Ke,isFinite:()=>Ho,isFunction:()=>Ri.Z,isInteger:()=>$o,isLength:()=>Go.Z,isMap:()=>zo.Z,isMatch:()=>qo,isMatchWith:()=>Ko,isNaN:()=>Yo,isNative:()=>rs,isNil:()=>ns,isNull:()=>is,isNumber:()=>Jo,isObject:()=>d.Z,isObjectLike:()=>V.Z,isPlainObject:()=>qe.Z,isRegExp:()=>ss,isSafeInteger:()=>as,isSet:()=>cs.Z,isString:()=>Yi,isSymbol:()=>n.Z,isTypedArray:()=>Mo.Z,isUndefined:()=>us,isWeakMap:()=>ls,isWeakSet:()=>fs,iteratee:()=>ds,join:()=>ps,kebabCase:()=>gs,keyBy:()=>ys.Z,keys:()=>Ie.Z,keysIn:()=>Ne.Z,last:()=>bn,lastIndexOf:()=>vs,lodash:()=>Y,lowerCase:()=>ws,lowerFirst:()=>As,lt:()=>_s,lte:()=>Ss,map:()=>yi,mapKeys:()=>xs,mapValues:()=>Ts.Z,matches:()=>Is,matchesProperty:()=>Os,max:()=>Ns,maxBy:()=>Rs,mean:()=>Ls,meanBy:()=>Fs,memoize:()=>js.Z,merge:()=>Us.Z,mergeWith:()=>nn,method:()=>Ds,methodOf:()=>Zs,min:()=>Hs,minBy:()=>$s,mixin:()=>Gs,multiply:()=>zs,negate:()=>Vs.Z,next:()=>Ys,noop:()=>F,now:()=>Gr,nth:()=>Xs,nthArg:()=>ea,omit:()=>ia,omitBy:()=>oa.Z,once:()=>sa,orderBy:()=>ca,over:()=>la,overArgs:()=>pa,overEvery:()=>ga,overSome:()=>ma,pad:()=>Ua,padEnd:()=>Da,padStart:()=>Za,parseInt:()=>Ga,partial:()=>Va,partialRight:()=>qa,partition:()=>Ka,pick:()=>Ya,pickBy:()=>Qa.Z,plant:()=>Xa,property:()=>ec.Z,propertyOf:()=>tc,pull:()=>sc,pullAll:()=>oc,pullAllBy:()=>ac,pullAllWith:()=>cc,pullAt:()=>dc,random:()=>vc,range:()=>_c,rangeRight:()=>Sc,rearg:()=>Tc,reduce:()=>Ic,reduceRight:()=>Oc,reject:()=>Cc,remove:()=>Nc,repeat:()=>Rc,replace:()=>Bc,rest:()=>Mc,result:()=>Lc,reverse:()=>jc,round:()=>Uc,sample:()=>Hc,sampleSize:()=>Vc,set:()=>qc,setWith:()=>Kc,shuffle:()=>Qc,size:()=>Xc,slice:()=>eu,snakeCase:()=>tu,some:()=>nu,sortBy:()=>iu.Z,sortedIndex:()=>uu,sortedIndexBy:()=>lu,sortedIndexOf:()=>fu,sortedLastIndex:()=>du,sortedLastIndexBy:()=>hu,sortedLastIndexOf:()=>pu,sortedUniq:()=>yu,sortedUniqBy:()=>mu,split:()=>bu,spread:()=>wu,startCase:()=>Au,startsWith:()=>Eu,stubArray:()=>_u.Z,stubFalse:()=>es.Z,stubObject:()=>Su,stubString:()=>xu,stubTrue:()=>Tu,subtract:()=>Pu,sum:()=>Iu,sumBy:()=>ku,tail:()=>Ou,take:()=>Cu,takeRight:()=>Nu,takeRightWhile:()=>Ru,takeWhile:()=>Bu,tap:()=>Mu,template:()=>Yu,templateSettings:()=>Hu,throttle:()=>Qu,thru:()=>Xu,times:()=>nl,toArray:()=>Js,toFinite:()=>b,toInteger:()=>v,toIterator:()=>il,toJSON:()=>sl,toLength:()=>Yn,toLower:()=>al,toNumber:()=>m,toPairs:()=>Un,toPairsIn:()=>Dn,toPath:()=>ul,toPlainObject:()=>ll.Z,toSafeInteger:()=>fl,toString:()=>st.Z,toUpper:()=>dl,transform:()=>pl,trim:()=>ml,trimEnd:()=>bl,trimStart:()=>wl,truncate:()=>El,unary:()=>_l,unescape:()=>Pl,union:()=>Cl,unionBy:()=>Nl,unionWith:()=>Rl,uniq:()=>Bl,uniqBy:()=>Ml,uniqWith:()=>Ll,uniqueId:()=>jl,unset:()=>Ul,unzip:()=>Zl,unzipWith:()=>Hl,update:()=>Gl,updateWith:()=>zl,upperCase:()=>Vl,upperFirst:()=>xt,value:()=>sl,valueOf:()=>sl,values:()=>Xi,valuesIn:()=>Wl,without:()=>ql,words:()=>nr,wrap:()=>Kl,wrapperAt:()=>Jl,wrapperChain:()=>Yl,wrapperCommit:()=>Sr,wrapperLodash:()=>Y,wrapperNext:()=>Ys,wrapperPlant:()=>Xa,wrapperReverse:()=>Ql,wrapperToIterator:()=>il,wrapperValue:()=>sl,xor:()=>ef,xorBy:()=>tf,xorWith:()=>rf,zip:()=>nf,zipObject:()=>sf,zipObjectDeep:()=>af,zipWith:()=>cf});var n=r(2758);const i=function(e){return"number"==typeof e?e:(0,n.Z)(e)?NaN:+e};var o=r(9200);const s=function(e,t){return function(r,n){var s;if(void 0===r&&void 0===n)return t;if(void 0!==r&&(s=r),void 0!==n){if(void 0===s)return n;"string"==typeof r||"string"==typeof n?(r=(0,o.Z)(r),n=(0,o.Z)(n)):(r=i(r),n=i(n)),s=e(r,n)}return s}},a=s((function(e,t){return e+t}),0);var c=/\s/;const u=function(e){for(var t=e.length;t--&&c.test(e.charAt(t)););return t};var l=/^\s+/;const f=function(e){return e?e.slice(0,u(e)+1).replace(l,""):e};var d=r(3122),h=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,g=/^0o[0-7]+$/i,y=parseInt;const m=function(e){if("number"==typeof e)return e;if((0,n.Z)(e))return NaN;if((0,d.Z)(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=(0,d.Z)(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=f(e);var r=p.test(e);return r||g.test(e)?y(e.slice(2),r?2:8):h.test(e)?NaN:+e};const b=function(e){return e?Infinity===(e=m(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},v=function(e){var t=b(e),r=t%1;return t==t?r?t-r:t:0},w=function(e,t){if("function"!=typeof t)throw new TypeError("Expected a function");return e=v(e),function(){if(--e<1)return t.apply(this,arguments)}};var A=r(9930),E=r(4197);const _=E.Z&&new E.Z;var S=_?function(e,t){return _.set(e,t),e}:A.Z;const x=S;var T=r(3376);const P=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=(0,T.Z)(e.prototype),n=e.apply(r,t);return(0,d.Z)(n)?n:r}};var I=r(3221);var k=r(4537),O=Math.max;const C=function(e,t,r,n){for(var i=-1,o=e.length,s=r.length,a=-1,c=t.length,u=O(o-s,0),l=Array(c+u),f=!n;++a<c;)l[a]=t[a];for(;++i<s;)(f||i<o)&&(l[r[i]]=e[i]);for(;u--;)l[a++]=e[i++];return l};var N=Math.max;const R=function(e,t,r,n){for(var i=-1,o=e.length,s=-1,a=r.length,c=-1,u=t.length,l=N(o-a,0),f=Array(l+u),d=!n;++i<l;)f[i]=e[i];for(var h=i;++c<u;)f[h+c]=t[c];for(;++s<a;)(d||i<o)&&(f[h+r[s]]=e[i++]);return f},B=function(){};function M(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}M.prototype=(0,T.Z)(B.prototype),M.prototype.constructor=M;const L=M,F=function(){};var j=_?function(e){return _.get(e)}:F;const U=j,D={};var Z=Object.prototype.hasOwnProperty;const H=function(e){for(var t=e.name+"",r=D[t],n=Z.call(D,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t};function $(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}$.prototype=(0,T.Z)(B.prototype),$.prototype.constructor=$;const G=$;var z=r(7885),V=r(3391),W=r(1162);const q=function(e){if(e instanceof L)return e.clone();var t=new G(e.__wrapped__,e.__chain__);return t.__actions__=(0,W.Z)(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t};var K=Object.prototype.hasOwnProperty;function J(e){if((0,V.Z)(e)&&!(0,z.Z)(e)&&!(e instanceof L)){if(e instanceof G)return e;if(K.call(e,"__wrapped__"))return q(e)}return new G(e)}J.prototype=B.prototype,J.prototype.constructor=J;const Y=J,Q=function(e){var t=H(e),r=Y[t];if("function"!=typeof r||!(t in L.prototype))return!1;if(e===r)return!0;var n=U(r);return!!n&&e===n[0]},X=(0,r(4695).Z)(x);var ee=/\{\n\/\* \[wrapped with (.+)\] \*/,te=/,? & /;var re=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;var ne=r(9856),ie=r(7288);const oe=function(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1},se=function(e){return e!=e},ae=function(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):oe(e,se,r)},ce=function(e,t){return!(null==e||!e.length)&&ae(e,t,0)>-1};var ue=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];const le=function(e,t,r){var n=t+"";return(0,ne.Z)(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(re,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return(0,ie.Z)(ue,(function(r){var n="_."+r[0];t&r[1]&&!ce(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ee);return t?t[1].split(te):[]}(n),r)))},fe=function(e,t,r,n,i,o,s,a,c,u){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var f=[e,t,i,l?o:void 0,l?s:void 0,l?void 0:o,l?void 0:s,a,c,u],d=r.apply(void 0,f);return Q(e)&&X(d,f),d.placeholder=n,le(d,e,t)},de=function(e){return e.placeholder};var he=r(6401),pe=Math.min;var ge="__lodash_placeholder__";const ye=function(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r];s!==t&&s!==ge||(e[r]=ge,o[i++]=r)}return o},me=function e(t,r,n,i,o,s,a,c,u,l){var f=128&r,d=1&r,h=2&r,p=24&r,g=512&r,y=h?void 0:P(t);return function m(){for(var b=arguments.length,v=Array(b),w=b;w--;)v[w]=arguments[w];if(p)var A=de(m),E=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(v,A);if(i&&(v=C(v,i,o,p)),s&&(v=R(v,s,a,p)),b-=E,p&&b<l){var _=ye(v,A);return fe(t,r,e,m.placeholder,n,v,_,c,u,l-b)}var S=d?n:this,x=h?S[t]:t;return b=v.length,c?v=function(e,t){for(var r=e.length,n=pe(t.length,r),i=(0,W.Z)(e);n--;){var o=t[n];e[n]=(0,he.Z)(o,r)?i[o]:void 0}return e}(v,c):g&&b>1&&v.reverse(),f&&u<b&&(v.length=u),this&&this!==I.Z&&this instanceof m&&(x=y||P(x)),x.apply(S,v)}};var be="__lodash_placeholder__",ve=Math.min;var we=Math.max;const Ae=function(e,t,r,n,i,o,s,a){var c=2&t;if(!c&&"function"!=typeof e)throw new TypeError("Expected a function");var u=n?n.length:0;if(u||(t&=-97,n=i=void 0),s=void 0===s?s:we(v(s),0),a=void 0===a?a:v(a),u-=i?i.length:0,64&t){var l=n,f=i;n=i=void 0}var d=c?void 0:U(e),h=[e,t,r,n,i,l,f,o,s,a];if(d&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,s=128==n&&8==r||128==n&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!s)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var a=t[3];if(a){var c=e[3];e[3]=c?C(c,a,t[4]):a,e[4]=c?ye(e[3],be):t[4]}(a=t[5])&&(c=e[5],e[5]=c?R(c,a,t[6]):a,e[6]=c?ye(e[5],be):t[6]),(a=t[7])&&(e[7]=a),128&n&&(e[8]=null==e[8]?t[8]:ve(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(h,d),e=h[0],t=h[1],r=h[2],n=h[3],i=h[4],!(a=h[9]=void 0===h[9]?c?0:e.length:we(h[9]-u,0))&&24&t&&(t&=-25),t&&1!=t)p=8==t||16==t?function(e,t,r){var n=P(e);return function i(){for(var o=arguments.length,s=Array(o),a=o,c=de(i);a--;)s[a]=arguments[a];var u=o<3&&s[0]!==c&&s[o-1]!==c?[]:ye(s,c);if((o-=u.length)<r)return fe(e,t,me,i.placeholder,void 0,s,u,void 0,void 0,r-o);var l=this&&this!==I.Z&&this instanceof i?n:e;return(0,k.Z)(l,this,s)}}(e,t,a):32!=t&&33!=t||i.length?me.apply(void 0,h):function(e,t,r,n){var i=1&t,o=P(e);return function t(){for(var s=-1,a=arguments.length,c=-1,u=n.length,l=Array(u+a),f=this&&this!==I.Z&&this instanceof t?o:e;++c<u;)l[c]=n[c];for(;a--;)l[c++]=arguments[++s];return(0,k.Z)(f,i?r:this,l)}}(e,t,r,n);else var p=function(e,t,r){var n=1&t,i=P(e);return function t(){return(this&&this!==I.Z&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return le((d?x:X)(p,h),e,t)},Ee=function(e,t,r){return t=r?void 0:t,t=e&&null==t?e.length:t,Ae(e,128,void 0,void 0,void 0,void 0,t)};var _e=r(6299),Se=r(2436),xe=r(3625),Te=r(3282),Pe=r(5441),Ie=r(649),ke=Object.prototype.hasOwnProperty,Oe=(0,xe.Z)((function(e,t){if((0,Pe.Z)(t)||(0,Te.Z)(t))(0,Se.Z)(t,(0,Ie.Z)(t),e);else for(var r in t)ke.call(t,r)&&(0,_e.Z)(e,r,t[r])}));const Ce=Oe;var Ne=r(7477),Re=(0,xe.Z)((function(e,t){(0,Se.Z)(t,(0,Ne.Z)(t),e)}));const Be=Re;var Me=(0,xe.Z)((function(e,t,r,n){(0,Se.Z)(t,(0,Ne.Z)(t),e,n)}));const Le=Me;var Fe=(0,xe.Z)((function(e,t,r,n){(0,Se.Z)(t,(0,Ie.Z)(t),e,n)}));const je=Fe;var Ue=r(772);const De=function(e,t){for(var r=-1,n=t.length,i=Array(n),o=null==e;++r<n;)i[r]=o?void 0:(0,Ue.Z)(e,t[r]);return i};var Ze=r(3338);const He=function(e){return null!=e&&e.length?(0,Ze.Z)(e,1):[]};var $e=r(4085);const Ge=function(e){return(0,ne.Z)((0,$e.Z)(e,void 0,He),e+"")},ze=Ge(De);var Ve=r(6493),We=r(9001),qe=r(5255);const Ke=function(e){if(!(0,V.Z)(e))return!1;var t=(0,We.Z)(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!(0,qe.Z)(e)};var Je=(0,Ve.Z)((function(e,t){try{return(0,k.Z)(e,void 0,t)}catch(e){return Ke(e)?e:new Error(e)}}));const Ye=Je,Qe=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=v(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}};var Xe=(0,Ve.Z)((function(e,t,r){var n=1;if(r.length){var i=ye(r,de(Xe));n|=32}return Ae(e,n,t,r,i)}));Xe.placeholder={};const et=Xe;var tt=r(905),rt=r(7969);const nt=Ge((function(e,t){return(0,ie.Z)(t,(function(t){t=(0,rt.Z)(t),(0,tt.Z)(e,t,et(e[t],e))})),e}));var it=(0,Ve.Z)((function(e,t,r){var n=3;if(r.length){var i=ye(r,de(it));n|=32}return Ae(t,n,e,r,i)}));it.placeholder={};const ot=it;var st=r(5186);const at=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o},ct=function(e,t,r){var n=e.length;return r=void 0===r?n:r,!t&&r>=n?e:at(e,t,r)};var ut=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const lt=function(e){return ut.test(e)};var ft="\\ud800-\\udfff",dt="["+ft+"]",ht="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",pt="\\ud83c[\\udffb-\\udfff]",gt="[^"+ft+"]",yt="(?:\\ud83c[\\udde6-\\uddff]){2}",mt="[\\ud800-\\udbff][\\udc00-\\udfff]",bt="(?:"+ht+"|"+pt+")?",vt="[\\ufe0e\\ufe0f]?",wt=vt+bt+"(?:\\u200d(?:"+[gt,yt,mt].join("|")+")"+vt+bt+")*",At="(?:"+[gt+ht+"?",ht,yt,mt,dt].join("|")+")",Et=RegExp(pt+"(?="+pt+")|"+At+wt,"g");const _t=function(e){return lt(e)?function(e){return e.match(Et)||[]}(e):function(e){return e.split("")}(e)},St=function(e){return function(t){t=(0,st.Z)(t);var r=lt(t)?_t(t):void 0,n=r?r[0]:t.charAt(0),i=r?ct(r,1).join(""):t.slice(1);return n[e]()+i}},xt=St("toUpperCase"),Tt=function(e){return xt((0,st.Z)(e).toLowerCase())},Pt=function(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r},It=function(e){return function(t){return null==e?void 0:e[t]}},kt=It({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});var Ot=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ct=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");const Nt=function(e){return(e=(0,st.Z)(e))&&e.replace(Ot,kt).replace(Ct,"")};var Rt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Bt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Mt="\\ud800-\\udfff",Lt="\\u2700-\\u27bf",Ft="a-z\\xdf-\\xf6\\xf8-\\xff",jt="A-Z\\xc0-\\xd6\\xd8-\\xde",Ut="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Dt="["+Ut+"]",Zt="\\d+",Ht="["+Lt+"]",$t="["+Ft+"]",Gt="[^"+Mt+Ut+Zt+Lt+Ft+jt+"]",zt="(?:\\ud83c[\\udde6-\\uddff]){2}",Vt="[\\ud800-\\udbff][\\udc00-\\udfff]",Wt="["+jt+"]",qt="(?:"+$t+"|"+Gt+")",Kt="(?:"+Wt+"|"+Gt+")",Jt="(?:['’](?:d|ll|m|re|s|t|ve))?",Yt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Qt="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Xt="[\\ufe0e\\ufe0f]?",er=Xt+Qt+"(?:\\u200d(?:"+["[^"+Mt+"]",zt,Vt].join("|")+")"+Xt+Qt+")*",tr="(?:"+[Ht,zt,Vt].join("|")+")"+er,rr=RegExp([Wt+"?"+$t+"+"+Jt+"(?="+[Dt,Wt,"$"].join("|")+")",Kt+"+"+Yt+"(?="+[Dt,Wt+qt,"$"].join("|")+")",Wt+"?"+qt+"+"+Jt,Wt+"+"+Yt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zt,tr].join("|"),"g");const nr=function(e,t,r){return e=(0,st.Z)(e),void 0===(t=r?void 0:t)?function(e){return Bt.test(e)}(e)?function(e){return e.match(rr)||[]}(e):function(e){return e.match(Rt)||[]}(e):e.match(t)||[]};var ir=RegExp("['’]","g");const or=function(e){return function(t){return Pt(nr(Nt(t).replace(ir,"")),e,"")}};const sr=or((function(e,t,r){return t=t.toLowerCase(),e+(r?Tt(t):t)})),ar=function(){if(!arguments.length)return[];var e=arguments[0];return(0,z.Z)(e)?e:[e]};var cr=I.Z.isFinite,ur=Math.min;const lr=function(e){var t=Math[e];return function(e,r){if(e=m(e),(r=null==r?0:ur(v(r),292))&&cr(e)){var n=((0,st.Z)(e)+"e").split("e"),i=t(n[0]+"e"+(+n[1]+r));return+((n=((0,st.Z)(i)+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}},fr=lr("ceil"),dr=function(e){var t=Y(e);return t.__chain__=!0,t};var hr=r(5965),pr=Math.ceil,gr=Math.max;const yr=function(e,t,r){t=(r?(0,hr.Z)(e,t,r):void 0===t)?1:gr(v(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,s=Array(pr(n/t));i<n;)s[o++]=at(e,i,i+=t);return s},mr=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e},br=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=m(r))==r?r:0),void 0!==t&&(t=(t=m(t))==t?t:0),mr(m(e),t,r)};var vr=r(7589);const wr=function(e){return(0,vr.Z)(e,4)};var Ar=r(7921);const Er=function(e,t){return t="function"==typeof t?t:void 0,(0,vr.Z)(e,5,t)},_r=function(e,t){return t="function"==typeof t?t:void 0,(0,vr.Z)(e,4,t)},Sr=function(){return new G(this.value(),this.__chain__)},xr=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i};var Tr=r(5810);const Pr=function(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return(0,Tr.Z)((0,z.Z)(r)?(0,W.Z)(r):[r],(0,Ze.Z)(t,1))};var Ir=r(9423),kr=r(699);const Or=function(e){var t=null==e?0:e.length,r=kr.Z;return e=t?(0,Ir.Z)(e,(function(e){if("function"!=typeof e[1])throw new TypeError("Expected a function");return[r(e[0]),e[1]]})):[],(0,Ve.Z)((function(r){for(var n=-1;++n<t;){var i=e[n];if((0,k.Z)(i[0],this,r))return(0,k.Z)(i[1],this,r)}}))},Cr=function(e,t,r){var n=r.length;if(null==e)return!n;for(e=Object(e);n--;){var i=r[n],o=t[i],s=e[i];if(void 0===s&&!(i in e)||!o(s))return!1}return!0},Nr=function(e){return function(e){var t=(0,Ie.Z)(e);return function(r){return Cr(r,e,t)}}((0,vr.Z)(e,1))},Rr=function(e,t){return null==t||Cr(e,t,(0,Ie.Z)(t))};var Br=r(6456),Mr=r(1758),Lr=Object.prototype.hasOwnProperty;const Fr=(0,Mr.Z)((function(e,t,r){Lr.call(e,r)?++e[r]:(0,tt.Z)(e,r,1)}));var jr=r(2779);const Ur=function(e,t){var r=(0,T.Z)(e);return null==t?r:(0,jr.Z)(r,t)};function Dr(e,t,r){var n=Ae(e,8,void 0,void 0,void 0,void 0,void 0,t=r?void 0:t);return n.placeholder=Dr.placeholder,n}Dr.placeholder={};const Zr=Dr;function Hr(e,t,r){var n=Ae(e,16,void 0,void 0,void 0,void 0,void 0,t=r?void 0:t);return n.placeholder=Hr.placeholder,n}Hr.placeholder={};const $r=Hr,Gr=function(){return I.Z.Date.now()};var zr=Math.max,Vr=Math.min;const Wr=function(e,t,r){var n,i,o,s,a,c,u=0,l=!1,f=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var r=n,o=i;return n=i=void 0,u=t,s=e.apply(o,r)}function g(e){var r=e-c;return void 0===c||r>=t||r<0||f&&e-u>=o}function y(){var e=Gr();if(g(e))return b(e);a=setTimeout(y,function(e){var r=t-(e-c);return f?Vr(r,o-(e-u)):r}(e))}function b(e){return a=void 0,h&&n?p(e):(n=i=void 0,s)}function v(){var e=Gr(),r=g(e);if(n=arguments,i=this,c=e,r){if(void 0===a)return function(e){return u=e,a=setTimeout(y,t),l?p(e):s}(c);if(f)return clearTimeout(a),a=setTimeout(y,t),p(c)}return void 0===a&&(a=setTimeout(y,t)),s}return t=m(t)||0,(0,d.Z)(r)&&(l=!!r.leading,o=(f="maxWait"in r)?zr(m(r.maxWait)||0,t):o,h="trailing"in r?!!r.trailing:h),v.cancel=function(){void 0!==a&&clearTimeout(a),u=0,n=c=i=a=void 0},v.flush=function(){return void 0===a?s:b(Gr())},v},qr=function(e,t){return null==e||e!=e?t:e};var Kr=r(8804),Jr=Object.prototype,Yr=Jr.hasOwnProperty,Qr=(0,Ve.Z)((function(e,t){e=Object(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&(0,hr.Z)(t[0],t[1],i)&&(n=1);++r<n;)for(var o=t[r],s=(0,Ne.Z)(o),a=-1,c=s.length;++a<c;){var u=s[a],l=e[u];(void 0===l||(0,Kr.Z)(l,Jr[u])&&!Yr.call(e,u))&&(e[u]=o[u])}return e}));const Xr=Qr;var en=r(3258);const tn=function e(t,r,n,i,o,s){return(0,d.Z)(t)&&(0,d.Z)(r)&&(s.set(r,t),(0,en.Z)(t,r,void 0,e,s),s.delete(r)),t};var rn=(0,xe.Z)((function(e,t,r,n){(0,en.Z)(e,t,r,n)}));const nn=rn,on=(0,Ve.Z)((function(e){return e.push(void 0,tn),(0,k.Z)(nn,void 0,e)})),sn=function(e,t,r){if("function"!=typeof e)throw new TypeError("Expected a function");return setTimeout((function(){e.apply(void 0,r)}),t)};var an=(0,Ve.Z)((function(e,t){return sn(e,1,t)}));const cn=an;var un=(0,Ve.Z)((function(e,t,r){return sn(e,m(t)||0,r)}));const ln=un;var fn=r(6806);const dn=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1};var hn=r(3225),pn=r(1749);const gn=function(e,t,r,n){var i=-1,o=ce,s=!0,a=e.length,c=[],u=t.length;if(!a)return c;r&&(t=(0,Ir.Z)(t,(0,hn.Z)(r))),n?(o=dn,s=!1):t.length>=200&&(o=pn.Z,s=!1,t=new fn.Z(t));e:for(;++i<a;){var l=e[i],f=null==r?l:r(l);if(l=n||0!==l?l:0,s&&f==f){for(var d=u;d--;)if(t[d]===f)continue e;c.push(l)}else o(t,f,n)||c.push(l)}return c};var yn=r(7539);const mn=(0,Ve.Z)((function(e,t){return(0,yn.Z)(e)?gn(e,(0,Ze.Z)(t,1,yn.Z,!0)):[]})),bn=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};const vn=(0,Ve.Z)((function(e,t){var r=bn(t);return(0,yn.Z)(r)&&(r=void 0),(0,yn.Z)(e)?gn(e,(0,Ze.Z)(t,1,yn.Z,!0),(0,kr.Z)(r,2)):[]}));const wn=(0,Ve.Z)((function(e,t){var r=bn(t);return(0,yn.Z)(r)&&(r=void 0),(0,yn.Z)(e)?gn(e,(0,Ze.Z)(t,1,yn.Z,!0),void 0,r):[]})),An=s((function(e,t){return e/t}),1),En=function(e,t,r){var n=null==e?0:e.length;return n?(t=r||void 0===t?1:v(t),at(e,t<0?0:t,n)):[]},_n=function(e,t,r){var n=null==e?0:e.length;return n?(t=r||void 0===t?1:v(t),at(e,0,(t=n-t)<0?0:t)):[]},Sn=function(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?at(e,n?0:o,n?o+1:i):at(e,n?o+1:0,n?i:o)},xn=function(e,t){return e&&e.length?Sn(e,(0,kr.Z)(t,3),!0,!0):[]},Tn=function(e,t){return e&&e.length?Sn(e,(0,kr.Z)(t,3),!0):[]};var Pn=r(9471);const In=function(e){return"function"==typeof e?e:A.Z},kn=function(e,t){return((0,z.Z)(e)?ie.Z:Pn.Z)(e,In(t))},On=function(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e},Cn=(0,r(4311).Z)(!0),Nn=function(e,t){return e&&Cn(e,t,Ie.Z)},Rn=(0,r(6798).Z)(Nn,!0),Bn=function(e,t){return((0,z.Z)(e)?On:Rn)(e,In(t))},Mn=function(e,t,r){e=(0,st.Z)(e),t=(0,o.Z)(t);var n=e.length,i=r=void 0===r?n:mr(v(r),0,n);return(r-=t.length)>=0&&e.slice(r,i)==t};var Ln=r(7458),Fn=r(5500);const jn=function(e){return function(t){var r,n,i,o=(0,Ln.Z)(t);return"[object Map]"==o?(0,Fn.Z)(t):"[object Set]"==o?(r=t,n=-1,i=Array(r.size),r.forEach((function(e){i[++n]=[e,e]})),i):function(e,t){return(0,Ir.Z)(t,(function(t){return[t,e[t]]}))}(t,e(t))}},Un=jn(Ie.Z),Dn=jn(Ne.Z),Zn=It({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});var Hn=/[&<>"']/g,$n=RegExp(Hn.source);const Gn=function(e){return(e=(0,st.Z)(e))&&$n.test(e)?e.replace(Hn,Zn):e};var zn=/[\\^$.*+?()[\]{}|]/g,Vn=RegExp(zn.source);const Wn=function(e){return(e=(0,st.Z)(e))&&Vn.test(e)?e.replace(zn,"\\$&"):e},qn=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0},Kn=function(e,t){var r=!0;return(0,Pn.Z)(e,(function(e,n,i){return r=!!t(e,n,i)})),r},Jn=function(e,t,r){var n=(0,z.Z)(e)?qn:Kn;return r&&(0,hr.Z)(e,t,r)&&(t=void 0),n(e,(0,kr.Z)(t,3))},Yn=function(e){return e?mr(v(e),0,4294967295):0},Qn=function(e,t,r,n){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&(0,hr.Z)(e,t,r)&&(r=0,n=i),function(e,t,r,n){var i=e.length;for((r=v(r))<0&&(r=-r>i?0:i+r),(n=void 0===n||n>i?i:v(n))<0&&(n+=i),n=r>n?0:Yn(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]};var Xn=r(2300);const ei=function(e,t){var r=[];return(0,Pn.Z)(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r},ti=function(e,t){return((0,z.Z)(e)?Xn.Z:ei)(e,(0,kr.Z)(t,3))},ri=function(e){return function(t,r,n){var i=Object(t);if(!(0,Te.Z)(t)){var o=(0,kr.Z)(r,3);t=(0,Ie.Z)(t),r=function(e){return o(i[e],e,i)}}var s=e(t,r,n);return s>-1?i[o?t[s]:s]:void 0}};var ni=Math.max;const ii=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:v(r);return i<0&&(i=ni(n+i,0)),oe(e,(0,kr.Z)(t,3),i)},oi=ri(ii),si=function(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n};var ai=r(475);const ci=function(e,t){return si(e,(0,kr.Z)(t,3),ai.Z)};var ui=Math.max,li=Math.min;const fi=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==r&&(i=v(r),i=r<0?ui(n+i,0):li(i,n-1)),oe(e,(0,kr.Z)(t,3),i,!0)},di=ri(fi),hi=function(e,t){return si(e,(0,kr.Z)(t,3),Nn)},pi=function(e){return e&&e.length?e[0]:void 0};var gi=r(9657);const yi=function(e,t){return((0,z.Z)(e)?Ir.Z:gi.Z)(e,(0,kr.Z)(t,3))},mi=function(e,t){return(0,Ze.Z)(yi(e,t),1)},bi=function(e,t){return(0,Ze.Z)(yi(e,t),1/0)},vi=function(e,t,r){return r=void 0===r?1:v(r),(0,Ze.Z)(yi(e,t),r)},wi=function(e){return null!=e&&e.length?(0,Ze.Z)(e,1/0):[]},Ai=function(e,t){return null!=e&&e.length?(t=void 0===t?1:v(t),(0,Ze.Z)(e,t)):[]},Ei=function(e){return Ae(e,512)},_i=lr("floor"),Si=function(e){return Ge((function(t){var r=t.length,n=r,i=G.prototype.thru;for(e&&t.reverse();n--;){var o=t[n];if("function"!=typeof o)throw new TypeError("Expected a function");if(i&&!s&&"wrapper"==H(o))var s=new G([],!0)}for(n=s?n:r;++n<r;){o=t[n];var a=H(o),c="wrapper"==a?U(o):void 0;s=c&&Q(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?s[H(c[0])].apply(s,c[3]):1==o.length&&Q(o)?s[a]():s.thru(o)}return function(){var e=arguments,n=e[0];if(s&&1==e.length&&(0,z.Z)(n))return s.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))},xi=Si(),Ti=Si(!0);var Pi=r(7818);const Ii=function(e,t){return null==e?e:(0,Pi.Z)(e,In(t),Ne.Z)},ki=function(e,t){return null==e?e:Cn(e,In(t),Ne.Z)},Oi=function(e,t){return e&&(0,ai.Z)(e,In(t))},Ci=function(e,t){return e&&Nn(e,In(t))},Ni=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n};var Ri=r(8936);const Bi=function(e,t){return(0,Xn.Z)(t,(function(t){return(0,Ri.Z)(e[t])}))},Mi=function(e){return null==e?[]:Bi(e,(0,Ie.Z)(e))},Li=function(e){return null==e?[]:Bi(e,(0,Ne.Z)(e))};var Fi=Object.prototype.hasOwnProperty;const ji=(0,Mr.Z)((function(e,t,r){Fi.call(e,r)?e[r].push(t):(0,tt.Z)(e,r,[t])})),Ui=function(e,t){return e>t},Di=function(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=m(t),r=m(r)),e(t,r)}},Zi=Di(Ui),Hi=Di((function(e,t){return e>=t}));var $i=Object.prototype.hasOwnProperty;const Gi=function(e,t){return null!=e&&$i.call(e,t)};var zi=r(8693);const Vi=function(e,t){return null!=e&&(0,zi.Z)(e,t,Gi)};var Wi=r(9666),qi=Math.max,Ki=Math.min;const Ji=function(e,t,r){return t=b(t),void 0===r?(r=t,t=0):r=b(r),function(e,t,r){return e>=Ki(t,r)&&e<qi(t,r)}(e=m(e),t,r)},Yi=function(e){return"string"==typeof e||!(0,z.Z)(e)&&(0,V.Z)(e)&&"[object String]"==(0,We.Z)(e)},Qi=function(e,t){return(0,Ir.Z)(t,(function(t){return e[t]}))},Xi=function(e){return null==e?[]:Qi(e,(0,Ie.Z)(e))};var eo=Math.max;const to=function(e,t,r,n){e=(0,Te.Z)(e)?e:Xi(e),r=r&&!n?v(r):0;var i=e.length;return r<0&&(r=eo(i+r,0)),Yi(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&ae(e,t,r)>-1};var ro=Math.max;const no=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:v(r);return i<0&&(i=ro(n+i,0)),ae(e,t,i)},io=function(e){return null!=e&&e.length?at(e,0,-1):[]};var oo=Math.min;const so=function(e,t,r){for(var n=r?dn:ce,i=e[0].length,o=e.length,s=o,a=Array(o),c=1/0,u=[];s--;){var l=e[s];s&&t&&(l=(0,Ir.Z)(l,(0,hn.Z)(t))),c=oo(l.length,c),a[s]=!r&&(t||i>=120&&l.length>=120)?new fn.Z(s&&l):void 0}l=e[0];var f=-1,d=a[0];e:for(;++f<i&&u.length<c;){var h=l[f],p=t?t(h):h;if(h=r||0!==h?h:0,!(d?(0,pn.Z)(d,p):n(u,p,r))){for(s=o;--s;){var g=a[s];if(!(g?(0,pn.Z)(g,p):n(e[s],p,r)))continue e}d&&d.push(p),u.push(h)}}return u},ao=function(e){return(0,yn.Z)(e)?e:[]},co=(0,Ve.Z)((function(e){var t=(0,Ir.Z)(e,ao);return t.length&&t[0]===e[0]?so(t):[]}));const uo=(0,Ve.Z)((function(e){var t=bn(e),r=(0,Ir.Z)(e,ao);return t===bn(r)?t=void 0:r.pop(),r.length&&r[0]===e[0]?so(r,(0,kr.Z)(t,2)):[]})),lo=(0,Ve.Z)((function(e){var t=bn(e),r=(0,Ir.Z)(e,ao);return(t="function"==typeof t?t:void 0)&&r.pop(),r.length&&r[0]===e[0]?so(r,void 0,t):[]})),fo=function(e,t){return function(r,n){return function(e,t,r,n){return(0,ai.Z)(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}};var ho=Object.prototype.toString;const po=fo((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ho.call(t)),e[t]=r}),(0,Br.Z)(A.Z));var go=Object.prototype,yo=go.hasOwnProperty,mo=go.toString;const bo=fo((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=mo.call(t)),yo.call(e,t)?e[t].push(r):e[t]=[r]}),kr.Z);var vo=r(2082),wo=r(9523);const Ao=function(e,t){return t.length<2?e:(0,wo.Z)(e,at(t,0,-1))},Eo=function(e,t,r){t=(0,vo.Z)(t,e);var n=null==(e=Ao(e,t))?e:e[(0,rt.Z)(bn(t))];return null==n?void 0:(0,k.Z)(n,e,r)},_o=(0,Ve.Z)(Eo);const So=(0,Ve.Z)((function(e,t,r){var n=-1,i="function"==typeof t,o=(0,Te.Z)(e)?Array(e.length):[];return(0,Pn.Z)(e,(function(e){o[++n]=i?(0,k.Z)(t,e,r):Eo(e,t,r)})),o}));var xo=r(4248);var To=r(7755),Po=To.Z&&To.Z.isArrayBuffer;const Io=Po?(0,hn.Z)(Po):function(e){return(0,V.Z)(e)&&"[object ArrayBuffer]"==(0,We.Z)(e)},ko=function(e){return!0===e||!1===e||(0,V.Z)(e)&&"[object Boolean]"==(0,We.Z)(e)};var Oo=r(7924);var Co=To.Z&&To.Z.isDate;const No=Co?(0,hn.Z)(Co):function(e){return(0,V.Z)(e)&&"[object Date]"==(0,We.Z)(e)},Ro=function(e){return(0,V.Z)(e)&&1===e.nodeType&&!(0,qe.Z)(e)};var Bo=r(3917),Mo=r(8127),Lo=Object.prototype.hasOwnProperty;const Fo=function(e){if(null==e)return!0;if((0,Te.Z)(e)&&((0,z.Z)(e)||"string"==typeof e||"function"==typeof e.splice||(0,Oo.Z)(e)||(0,Mo.Z)(e)||(0,xo.Z)(e)))return!e.length;var t=(0,Ln.Z)(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if((0,Pe.Z)(e))return!(0,Bo.Z)(e).length;for(var r in e)if(Lo.call(e,r))return!1;return!0};var jo=r(4989);const Uo=function(e,t){return(0,jo.Z)(e,t)},Do=function(e,t,r){var n=(r="function"==typeof r?r:void 0)?r(e,t):void 0;return void 0===n?(0,jo.Z)(e,t,void 0,r):!!n};var Zo=I.Z.isFinite;const Ho=function(e){return"number"==typeof e&&Zo(e)},$o=function(e){return"number"==typeof e&&e==v(e)};var Go=r(1164),zo=r(2434),Vo=r(5026),Wo=r(6676);const qo=function(e,t){return e===t||(0,Vo.Z)(e,t,(0,Wo.Z)(t))},Ko=function(e,t,r){return r="function"==typeof r?r:void 0,(0,Vo.Z)(e,t,(0,Wo.Z)(t),r)},Jo=function(e){return"number"==typeof e||(0,V.Z)(e)&&"[object Number]"==(0,We.Z)(e)},Yo=function(e){return Jo(e)&&e!=+e};var Qo=r(3193),Xo=r(1105),es=r(1433);const ts=Xo.Z?Ri.Z:es.Z,rs=function(e){if(ts(e))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return(0,Qo.Z)(e)},ns=function(e){return null==e},is=function(e){return null===e};var os=To.Z&&To.Z.isRegExp;const ss=os?(0,hn.Z)(os):function(e){return(0,V.Z)(e)&&"[object RegExp]"==(0,We.Z)(e)};const as=function(e){return $o(e)&&e>=-9007199254740991&&e<=9007199254740991};var cs=r(3267);const us=function(e){return void 0===e},ls=function(e){return(0,V.Z)(e)&&"[object WeakMap]"==(0,Ln.Z)(e)},fs=function(e){return(0,V.Z)(e)&&"[object WeakSet]"==(0,We.Z)(e)},ds=function(e){return(0,kr.Z)("function"==typeof e?e:(0,vr.Z)(e,1))};var hs=Array.prototype.join;const ps=function(e,t){return null==e?"":hs.call(e,t)};const gs=or((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}));var ys=r(9164);var ms=Math.max,bs=Math.min;const vs=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==r&&(i=(i=v(r))<0?ms(n+i,0):bs(i,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,i):oe(e,se,i,!0)};const ws=or((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),As=St("toLowerCase"),Es=function(e,t){return e<t},_s=Di(Es),Ss=Di((function(e,t){return e<=t})),xs=function(e,t){var r={};return t=(0,kr.Z)(t,3),(0,ai.Z)(e,(function(e,n,i){(0,tt.Z)(r,t(e,n,i),e)})),r};var Ts=r(8819),Ps=r(5303);const Is=function(e){return(0,Ps.Z)((0,vr.Z)(e,1))};var ks=r(7965);const Os=function(e,t){return(0,ks.Z)(e,(0,vr.Z)(t,1))},Cs=function(e,t,r){for(var i=-1,o=e.length;++i<o;){var s=e[i],a=t(s);if(null!=a&&(void 0===c?a==a&&!(0,n.Z)(a):r(a,c)))var c=a,u=s}return u},Ns=function(e){return e&&e.length?Cs(e,A.Z,Ui):void 0},Rs=function(e,t){return e&&e.length?Cs(e,(0,kr.Z)(t,2),Ui):void 0},Bs=function(e,t){for(var r,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(r=void 0===r?o:r+o)}return r},Ms=function(e,t){var r=null==e?0:e.length;return r?Bs(e,t)/r:NaN},Ls=function(e){return Ms(e,A.Z)},Fs=function(e,t){return Ms(e,(0,kr.Z)(t,2))};var js=r(7068),Us=r(9106);const Ds=(0,Ve.Z)((function(e,t){return function(r){return Eo(r,e,t)}})),Zs=(0,Ve.Z)((function(e,t){return function(r){return Eo(e,r,t)}})),Hs=function(e){return e&&e.length?Cs(e,A.Z,Es):void 0},$s=function(e,t){return e&&e.length?Cs(e,(0,kr.Z)(t,2),Es):void 0},Gs=function(e,t,r){var n=(0,Ie.Z)(t),i=Bi(t,n),o=!((0,d.Z)(r)&&"chain"in r&&!r.chain),s=(0,Ri.Z)(e);return(0,ie.Z)(i,(function(r){var n=t[r];e[r]=n,s&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=(0,W.Z)(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,(0,Tr.Z)([this.value()],arguments))})})),e},zs=s((function(e,t){return e*t}),1);var Vs=r(6371),Ws=r(187);var qs=r(3249),Ks=Ws.Z?Ws.Z.iterator:void 0;const Js=function(e){if(!e)return[];if((0,Te.Z)(e))return Yi(e)?_t(e):(0,W.Z)(e);if(Ks&&e[Ks])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ks]());var t=(0,Ln.Z)(e);return("[object Map]"==t?Fn.Z:"[object Set]"==t?qs.Z:Xi)(e)},Ys=function(){void 0===this.__values__&&(this.__values__=Js(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Qs=function(e,t){var r=e.length;if(r)return t+=t<0?r:0,(0,he.Z)(t,r)?e[t]:void 0},Xs=function(e,t){return e&&e.length?Qs(e,v(t)):void 0},ea=function(e){return e=v(e),(0,Ve.Z)((function(t){return Qs(t,e)}))},ta=function(e,t){return t=(0,vo.Z)(t,e),null==(e=Ao(e,t))||delete e[(0,rt.Z)(bn(t))]},ra=function(e){return(0,qe.Z)(e)?void 0:e};var na=r(9878);const ia=Ge((function(e,t){var r={};if(null==e)return r;var n=!1;t=(0,Ir.Z)(t,(function(t){return t=(0,vo.Z)(t,e),n||(n=t.length>1),t})),(0,Se.Z)(e,(0,na.Z)(e),r),n&&(r=(0,vr.Z)(r,7,ra));for(var i=t.length;i--;)ta(r,t[i]);return r}));var oa=r(7154);const sa=function(e){return Qe(2,e)};var aa=r(8136);const ca=function(e,t,r,n){return null==e?[]:((0,z.Z)(t)||(t=null==t?[]:[t]),r=n?void 0:r,(0,z.Z)(r)||(r=null==r?[]:[r]),(0,aa.Z)(e,t,r))},ua=function(e){return Ge((function(t){return t=(0,Ir.Z)(t,(0,hn.Z)(kr.Z)),(0,Ve.Z)((function(r){var n=this;return e(t,(function(e){return(0,k.Z)(e,n,r)}))}))}))},la=ua(Ir.Z),fa=Ve.Z;var da=Math.min,ha=fa((function(e,t){var r=(t=1==t.length&&(0,z.Z)(t[0])?(0,Ir.Z)(t[0],(0,hn.Z)(kr.Z)):(0,Ir.Z)((0,Ze.Z)(t,1),(0,hn.Z)(kr.Z))).length;return(0,Ve.Z)((function(n){for(var i=-1,o=da(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return(0,k.Z)(e,this,n)}))}));const pa=ha,ga=ua(qn);var ya=r(9395);const ma=ua(ya.Z);var ba=Math.floor;const va=function(e,t){var r="";if(!e||t<1||t>9007199254740991)return r;do{t%2&&(r+=e),(t=ba(t/2))&&(e+=e)}while(t);return r};var wa=r(5523);const Aa=(0,wa.Z)("length");var Ea="\\ud800-\\udfff",_a="["+Ea+"]",Sa="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",xa="\\ud83c[\\udffb-\\udfff]",Ta="[^"+Ea+"]",Pa="(?:\\ud83c[\\udde6-\\uddff]){2}",Ia="[\\ud800-\\udbff][\\udc00-\\udfff]",ka="(?:"+Sa+"|"+xa+")?",Oa="[\\ufe0e\\ufe0f]?",Ca=Oa+ka+"(?:\\u200d(?:"+[Ta,Pa,Ia].join("|")+")"+Oa+ka+")*",Na="(?:"+[Ta+Sa+"?",Sa,Pa,Ia,_a].join("|")+")",Ra=RegExp(xa+"(?="+xa+")|"+Na+Ca,"g");const Ba=function(e){return lt(e)?function(e){for(var t=Ra.lastIndex=0;Ra.test(e);)++t;return t}(e):Aa(e)};var Ma=Math.ceil;const La=function(e,t){var r=(t=void 0===t?" ":(0,o.Z)(t)).length;if(r<2)return r?va(t,e):t;var n=va(t,Ma(e/Ba(t)));return lt(t)?ct(_t(n),0,e).join(""):n.slice(0,e)};var Fa=Math.ceil,ja=Math.floor;const Ua=function(e,t,r){e=(0,st.Z)(e);var n=(t=v(t))?Ba(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return La(ja(i),r)+e+La(Fa(i),r)},Da=function(e,t,r){e=(0,st.Z)(e);var n=(t=v(t))?Ba(e):0;return t&&n<t?e+La(t-n,r):e},Za=function(e,t,r){e=(0,st.Z)(e);var n=(t=v(t))?Ba(e):0;return t&&n<t?La(t-n,r)+e:e};var Ha=/^\s+/,$a=I.Z.parseInt;const Ga=function(e,t,r){return r||null==t?t=0:t&&(t=+t),$a((0,st.Z)(e).replace(Ha,""),t||0)};var za=(0,Ve.Z)((function(e,t){var r=ye(t,de(za));return Ae(e,32,void 0,t,r)}));za.placeholder={};const Va=za;var Wa=(0,Ve.Z)((function(e,t){var r=ye(t,de(Wa));return Ae(e,64,void 0,t,r)}));Wa.placeholder={};const qa=Wa;const Ka=(0,Mr.Z)((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ja=r(2767);const Ya=Ge((function(e,t){return null==e?{}:function(e,t){return(0,Ja.Z)(e,t,(function(t,r){return(0,Wi.Z)(e,r)}))}(e,t)}));var Qa=r(4006);const Xa=function(e){for(var t,r=this;r instanceof B;){var n=q(r);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;r=r.__wrapped__}return i.__wrapped__=e,t};var ec=r(4902);const tc=function(e){return function(t){return null==e?void 0:(0,wo.Z)(e,t)}},rc=function(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1};var nc=Array.prototype.splice;const ic=function(e,t,r,n){var i=n?rc:ae,o=-1,s=t.length,a=e;for(e===t&&(t=(0,W.Z)(t)),r&&(a=(0,Ir.Z)(e,(0,hn.Z)(r)));++o<s;)for(var c=0,u=t[o],l=r?r(u):u;(c=i(a,l,c,n))>-1;)a!==e&&nc.call(a,c,1),nc.call(e,c,1);return e},oc=function(e,t){return e&&e.length&&t&&t.length?ic(e,t):e},sc=(0,Ve.Z)(oc),ac=function(e,t,r){return e&&e.length&&t&&t.length?ic(e,t,(0,kr.Z)(r,2)):e},cc=function(e,t,r){return e&&e.length&&t&&t.length?ic(e,t,void 0,r):e};var uc=Array.prototype.splice;const lc=function(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;(0,he.Z)(i)?uc.call(e,i,1):ta(e,i)}}return e};var fc=r(827);const dc=Ge((function(e,t){var r=null==e?0:e.length,n=De(e,t);return lc(e,(0,Ir.Z)(t,(function(e){return(0,he.Z)(e,r)?+e:e})).sort(fc.Z)),n}));var hc=Math.floor,pc=Math.random;const gc=function(e,t){return e+hc(pc()*(t-e+1))};var yc=parseFloat,mc=Math.min,bc=Math.random;const vc=function(e,t,r){if(r&&"boolean"!=typeof r&&(0,hr.Z)(e,t,r)&&(t=r=void 0),void 0===r&&("boolean"==typeof t?(r=t,t=void 0):"boolean"==typeof e&&(r=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=b(e),void 0===t?(t=e,e=0):t=b(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var i=bc();return mc(e+i*(t-e+yc("1e-"+((i+"").length-1))),t)}return gc(e,t)};var wc=Math.ceil,Ac=Math.max;const Ec=function(e){return function(t,r,n){return n&&"number"!=typeof n&&(0,hr.Z)(t,r,n)&&(r=n=void 0),t=b(t),void 0===r?(r=t,t=0):r=b(r),function(e,t,r,n){for(var i=-1,o=Ac(wc((t-e)/(r||1)),0),s=Array(o);o--;)s[n?o:++i]=e,e+=r;return s}(t,r,n=void 0===n?t<r?1:-1:b(n),e)}},_c=Ec(),Sc=Ec(!0);var xc=Ge((function(e,t){return Ae(e,256,void 0,void 0,void 0,t)}));const Tc=xc,Pc=function(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r},Ic=function(e,t,r){var n=(0,z.Z)(e)?Pt:Pc,i=arguments.length<3;return n(e,(0,kr.Z)(t,4),r,i,Pn.Z)},kc=function(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r},Oc=function(e,t,r){var n=(0,z.Z)(e)?kc:Pc,i=arguments.length<3;return n(e,(0,kr.Z)(t,4),r,i,Rn)},Cc=function(e,t){return((0,z.Z)(e)?Xn.Z:ei)(e,(0,Vs.Z)((0,kr.Z)(t,3)))},Nc=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=(0,kr.Z)(t,3);++n<o;){var s=e[n];t(s,n,e)&&(r.push(s),i.push(n))}return lc(e,i),r},Rc=function(e,t,r){return t=(r?(0,hr.Z)(e,t,r):void 0===t)?1:v(t),va((0,st.Z)(e),t)},Bc=function(){var e=arguments,t=(0,st.Z)(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Mc=function(e,t){if("function"!=typeof e)throw new TypeError("Expected a function");return t=void 0===t?t:v(t),(0,Ve.Z)(e,t)},Lc=function(e,t,r){var n=-1,i=(t=(0,vo.Z)(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[(0,rt.Z)(t[n])];void 0===o&&(n=i,o=r),e=(0,Ri.Z)(o)?o.call(e):o}return e};var Fc=Array.prototype.reverse;const jc=function(e){return null==e?e:Fc.call(e)},Uc=lr("round"),Dc=function(e){var t=e.length;return t?e[gc(0,t-1)]:void 0},Zc=function(e){return Dc(Xi(e))},Hc=function(e){return((0,z.Z)(e)?Dc:Zc)(e)},$c=function(e,t){var r=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++r<t;){var o=gc(r,i),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e},Gc=function(e,t){return $c((0,W.Z)(e),mr(t,0,e.length))},zc=function(e,t){var r=Xi(e);return $c(r,mr(t,0,r.length))},Vc=function(e,t,r){return t=(r?(0,hr.Z)(e,t,r):void 0===t)?1:v(t),((0,z.Z)(e)?Gc:zc)(e,t)};var Wc=r(4187);const qc=function(e,t,r){return null==e?e:(0,Wc.Z)(e,t,r)},Kc=function(e,t,r,n){return n="function"==typeof n?n:void 0,null==e?e:(0,Wc.Z)(e,t,r,n)},Jc=function(e){return $c((0,W.Z)(e))},Yc=function(e){return $c(Xi(e))},Qc=function(e){return((0,z.Z)(e)?Jc:Yc)(e)},Xc=function(e){if(null==e)return 0;if((0,Te.Z)(e))return Yi(e)?Ba(e):e.length;var t=(0,Ln.Z)(e);return"[object Map]"==t||"[object Set]"==t?e.size:(0,Bo.Z)(e).length},eu=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&(0,hr.Z)(e,t,r)?(t=0,r=n):(t=null==t?0:v(t),r=void 0===r?n:v(r)),at(e,t,r)):[]};const tu=or((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),ru=function(e,t){var r;return(0,Pn.Z)(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r},nu=function(e,t,r){var n=(0,z.Z)(e)?ya.Z:ru;return r&&(0,hr.Z)(e,t,r)&&(t=void 0),n(e,(0,kr.Z)(t,3))};var iu=r(2424),ou=Math.floor,su=Math.min;const au=function(e,t,r,i){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=r(t))!=t,c=null===t,u=(0,n.Z)(t),l=void 0===t;o<s;){var f=ou((o+s)/2),d=r(e[f]),h=void 0!==d,p=null===d,g=d==d,y=(0,n.Z)(d);if(a)var m=i||g;else m=l?g&&(i||h):c?g&&h&&(i||!p):u?g&&h&&!p&&(i||!y):!p&&!y&&(i?d<=t:d<t);m?o=f+1:s=f}return su(s,4294967294)},cu=function(e,t,r){var i=0,o=null==e?i:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;i<o;){var s=i+o>>>1,a=e[s];null!==a&&!(0,n.Z)(a)&&(r?a<=t:a<t)?i=s+1:o=s}return o}return au(e,t,A.Z,r)},uu=function(e,t){return cu(e,t)},lu=function(e,t,r){return au(e,t,(0,kr.Z)(r,2))},fu=function(e,t){var r=null==e?0:e.length;if(r){var n=cu(e,t);if(n<r&&(0,Kr.Z)(e[n],t))return n}return-1},du=function(e,t){return cu(e,t,!0)},hu=function(e,t,r){return au(e,t,(0,kr.Z)(r,2),!0)},pu=function(e,t){if(null!=e&&e.length){var r=cu(e,t,!0)-1;if((0,Kr.Z)(e[r],t))return r}return-1},gu=function(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var s=e[r],a=t?t(s):s;if(!r||!(0,Kr.Z)(a,c)){var c=a;o[i++]=0===s?0:s}}return o},yu=function(e){return e&&e.length?gu(e):[]},mu=function(e,t){return e&&e.length?gu(e,(0,kr.Z)(t,2)):[]},bu=function(e,t,r){return r&&"number"!=typeof r&&(0,hr.Z)(e,t,r)&&(t=r=void 0),(r=void 0===r?4294967295:r>>>0)?(e=(0,st.Z)(e))&&("string"==typeof t||null!=t&&!ss(t))&&!(t=(0,o.Z)(t))&&lt(e)?ct(_t(e),0,r):e.split(t,r):[]};var vu=Math.max;const wu=function(e,t){if("function"!=typeof e)throw new TypeError("Expected a function");return t=null==t?0:vu(v(t),0),(0,Ve.Z)((function(r){var n=r[t],i=ct(r,0,t);return n&&(0,Tr.Z)(i,n),(0,k.Z)(e,this,i)}))};const Au=or((function(e,t,r){return e+(r?" ":"")+xt(t)})),Eu=function(e,t,r){return e=(0,st.Z)(e),r=null==r?0:mr(v(r),0,e.length),t=(0,o.Z)(t),e.slice(r,r+t.length)==t};var _u=r(813);const Su=function(){return{}},xu=function(){return""},Tu=function(){return!0},Pu=s((function(e,t){return e-t}),0),Iu=function(e){return e&&e.length?Bs(e,A.Z):0},ku=function(e,t){return e&&e.length?Bs(e,(0,kr.Z)(t,2)):0},Ou=function(e){var t=null==e?0:e.length;return t?at(e,1,t):[]},Cu=function(e,t,r){return e&&e.length?(t=r||void 0===t?1:v(t),at(e,0,t<0?0:t)):[]},Nu=function(e,t,r){var n=null==e?0:e.length;return n?(t=r||void 0===t?1:v(t),at(e,(t=n-t)<0?0:t,n)):[]},Ru=function(e,t){return e&&e.length?Sn(e,(0,kr.Z)(t,3),!1,!0):[]},Bu=function(e,t){return e&&e.length?Sn(e,(0,kr.Z)(t,3)):[]},Mu=function(e,t){return t(e),e};var Lu=Object.prototype,Fu=Lu.hasOwnProperty;const ju=function(e,t,r,n){return void 0===e||(0,Kr.Z)(e,Lu[r])&&!Fu.call(n,r)?t:e};var Uu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};const Du=function(e){return"\\"+Uu[e]},Zu=/<%=([\s\S]+?)%>/g,Hu={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Zu,variable:"",imports:{_:{escape:Gn}}};var $u=/\b__p \+= '';/g,Gu=/\b(__p \+=) '' \+/g,zu=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Vu=/[()=,{}\[\]\/\s]/,Wu=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qu=/($^)/,Ku=/['\n\r\u2028\u2029\\]/g,Ju=Object.prototype.hasOwnProperty;const Yu=function(e,t,r){var n=Hu.imports._.templateSettings||Hu;r&&(0,hr.Z)(e,t,r)&&(t=void 0),e=(0,st.Z)(e),t=Le({},t,n,ju);var i,o,s=Le({},t.imports,n.imports,ju),a=(0,Ie.Z)(s),c=Qi(s,a),u=0,l=t.interpolate||qu,f="__p += '",d=RegExp((t.escape||qu).source+"|"+l.source+"|"+(l===Zu?Wu:qu).source+"|"+(t.evaluate||qu).source+"|$","g"),h=Ju.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(d,(function(t,r,n,s,a,c){return n||(n=s),f+=e.slice(u,c).replace(Ku,Du),r&&(i=!0,f+="' +\n__e("+r+") +\n'"),a&&(o=!0,f+="';\n"+a+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),f+="';\n";var p=Ju.call(t,"variable")&&t.variable;if(p){if(Vu.test(p))throw new Error("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(o?f.replace($u,""):f).replace(Gu,"$1").replace(zu,"$1;"),f="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=Ye((function(){return Function(a,h+"return "+f).apply(void 0,c)}));if(g.source=f,Ke(g))throw g;return g},Qu=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return(0,d.Z)(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Wr(e,t,{leading:n,maxWait:t,trailing:i})},Xu=function(e,t){return t(e)};var el=r(9510),tl=4294967295,rl=Math.min;const nl=function(e,t){if((e=v(e))<1||e>9007199254740991)return[];var r=tl,n=rl(e,tl);t=In(t),e-=tl;for(var i=(0,el.Z)(n,t);++r<e;)t(r);return i},il=function(){return this},ol=function(e,t){var r=e;return r instanceof L&&(r=r.value()),Pt(t,(function(e,t){return t.func.apply(t.thisArg,(0,Tr.Z)([e],t.args))}),r)},sl=function(){return ol(this.__wrapped__,this.__actions__)},al=function(e){return(0,st.Z)(e).toLowerCase()};var cl=r(376);const ul=function(e){return(0,z.Z)(e)?(0,Ir.Z)(e,rt.Z):(0,n.Z)(e)?[e]:(0,W.Z)((0,cl.Z)((0,st.Z)(e)))};var ll=r(7619);const fl=function(e){return e?mr(v(e),-9007199254740991,9007199254740991):0===e?e:0},dl=function(e){return(0,st.Z)(e).toUpperCase()};var hl=r(9552);const pl=function(e,t,r){var n=(0,z.Z)(e),i=n||(0,Oo.Z)(e)||(0,Mo.Z)(e);if(t=(0,kr.Z)(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:(0,d.Z)(e)&&(0,Ri.Z)(o)?(0,T.Z)((0,hl.Z)(e)):{}}return(i?ie.Z:ai.Z)(e,(function(e,n,i){return t(r,e,n,i)})),r},gl=function(e,t){for(var r=e.length;r--&&ae(t,e[r],0)>-1;);return r},yl=function(e,t){for(var r=-1,n=e.length;++r<n&&ae(t,e[r],0)>-1;);return r},ml=function(e,t,r){if((e=(0,st.Z)(e))&&(r||void 0===t))return f(e);if(!e||!(t=(0,o.Z)(t)))return e;var n=_t(e),i=_t(t),s=yl(n,i),a=gl(n,i)+1;return ct(n,s,a).join("")},bl=function(e,t,r){if((e=(0,st.Z)(e))&&(r||void 0===t))return e.slice(0,u(e)+1);if(!e||!(t=(0,o.Z)(t)))return e;var n=_t(e),i=gl(n,_t(t))+1;return ct(n,0,i).join("")};var vl=/^\s+/;const wl=function(e,t,r){if((e=(0,st.Z)(e))&&(r||void 0===t))return e.replace(vl,"");if(!e||!(t=(0,o.Z)(t)))return e;var n=_t(e),i=yl(n,_t(t));return ct(n,i).join("")};var Al=/\w*$/;const El=function(e,t){var r=30,n="...";if((0,d.Z)(t)){var i="separator"in t?t.separator:i;r="length"in t?v(t.length):r,n="omission"in t?(0,o.Z)(t.omission):n}var s=(e=(0,st.Z)(e)).length;if(lt(e)){var a=_t(e);s=a.length}if(r>=s)return e;var c=r-Ba(n);if(c<1)return n;var u=a?ct(a,0,c).join(""):e.slice(0,c);if(void 0===i)return u+n;if(a&&(c+=u.length-c),ss(i)){if(e.slice(c).search(i)){var l,f=u;for(i.global||(i=RegExp(i.source,(0,st.Z)(Al.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var h=l.index;u=u.slice(0,void 0===h?c:h)}}else if(e.indexOf((0,o.Z)(i),c)!=c){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+n},_l=function(e){return Ee(e,1)},Sl=It({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var xl=/&(?:amp|lt|gt|quot|#39);/g,Tl=RegExp(xl.source);const Pl=function(e){return(e=(0,st.Z)(e))&&Tl.test(e)?e.replace(xl,Sl):e};var Il=r(7459);const kl=Il.Z&&1/(0,qs.Z)(new Il.Z([,-0]))[1]==1/0?function(e){return new Il.Z(e)}:F,Ol=function(e,t,r){var n=-1,i=ce,o=e.length,s=!0,a=[],c=a;if(r)s=!1,i=dn;else if(o>=200){var u=t?null:kl(e);if(u)return(0,qs.Z)(u);s=!1,i=pn.Z,c=new fn.Z}else c=t?[]:a;e:for(;++n<o;){var l=e[n],f=t?t(l):l;if(l=r||0!==l?l:0,s&&f==f){for(var d=c.length;d--;)if(c[d]===f)continue e;t&&c.push(f),a.push(l)}else i(c,f,r)||(c!==a&&c.push(f),a.push(l))}return a},Cl=(0,Ve.Z)((function(e){return Ol((0,Ze.Z)(e,1,yn.Z,!0))}));const Nl=(0,Ve.Z)((function(e){var t=bn(e);return(0,yn.Z)(t)&&(t=void 0),Ol((0,Ze.Z)(e,1,yn.Z,!0),(0,kr.Z)(t,2))})),Rl=(0,Ve.Z)((function(e){var t=bn(e);return t="function"==typeof t?t:void 0,Ol((0,Ze.Z)(e,1,yn.Z,!0),void 0,t)})),Bl=function(e){return e&&e.length?Ol(e):[]},Ml=function(e,t){return e&&e.length?Ol(e,(0,kr.Z)(t,2)):[]},Ll=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Ol(e,void 0,t):[]};var Fl=0;const jl=function(e){var t=++Fl;return(0,st.Z)(e)+t},Ul=function(e,t){return null==e||ta(e,t)};var Dl=Math.max;const Zl=function(e){if(!e||!e.length)return[];var t=0;return e=(0,Xn.Z)(e,(function(e){if((0,yn.Z)(e))return t=Dl(e.length,t),!0})),(0,el.Z)(t,(function(t){return(0,Ir.Z)(e,(0,wa.Z)(t))}))},Hl=function(e,t){if(!e||!e.length)return[];var r=Zl(e);return null==t?r:(0,Ir.Z)(r,(function(e){return(0,k.Z)(t,void 0,e)}))},$l=function(e,t,r,n){return(0,Wc.Z)(e,t,r((0,wo.Z)(e,t)),n)},Gl=function(e,t,r){return null==e?e:$l(e,t,In(r))},zl=function(e,t,r,n){return n="function"==typeof n?n:void 0,null==e?e:$l(e,t,In(r),n)};const Vl=or((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Wl=function(e){return null==e?[]:Qi(e,(0,Ne.Z)(e))};const ql=(0,Ve.Z)((function(e,t){return(0,yn.Z)(e)?gn(e,t):[]})),Kl=function(e,t){return Va(In(t),e)},Jl=Ge((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,i=function(t){return De(t,e)};return!(t>1||this.__actions__.length)&&n instanceof L&&(0,he.Z)(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:Xu,args:[i],thisArg:void 0}),new G(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)})),Yl=function(){return dr(this)},Ql=function(){var e=this.__wrapped__;if(e instanceof L){var t=e;return this.__actions__.length&&(t=new L(this)),(t=t.reverse()).__actions__.push({func:Xu,args:[jc],thisArg:void 0}),new G(t,this.__chain__)}return this.thru(jc)},Xl=function(e,t,r){var n=e.length;if(n<2)return n?Ol(e[0]):[];for(var i=-1,o=Array(n);++i<n;)for(var s=e[i],a=-1;++a<n;)a!=i&&(o[i]=gn(o[i]||s,e[a],t,r));return Ol((0,Ze.Z)(o,1),t,r)},ef=(0,Ve.Z)((function(e){return Xl((0,Xn.Z)(e,yn.Z))}));const tf=(0,Ve.Z)((function(e){var t=bn(e);return(0,yn.Z)(t)&&(t=void 0),Xl((0,Xn.Z)(e,yn.Z),(0,kr.Z)(t,2))})),rf=(0,Ve.Z)((function(e){var t=bn(e);return t="function"==typeof t?t:void 0,Xl((0,Xn.Z)(e,yn.Z),void 0,t)})),nf=(0,Ve.Z)(Zl),of=function(e,t,r){for(var n=-1,i=e.length,o=t.length,s={};++n<i;){var a=n<o?t[n]:void 0;r(s,e[n],a)}return s},sf=function(e,t){return of(e||[],t||[],_e.Z)},af=function(e,t){return of(e||[],t||[],Wc.Z)};const cf=(0,Ve.Z)((function(e){var t=e.length,r=t>1?e[t-1]:void 0;return r="function"==typeof r?(e.pop(),r):void 0,Hl(e,r)})),uf={chunk:yr,compact:xr,concat:Pr,difference:mn,differenceBy:vn,differenceWith:wn,drop:En,dropRight:_n,dropRightWhile:xn,dropWhile:Tn,fill:Qn,findIndex:ii,findLastIndex:fi,first:pi,flatten:He,flattenDeep:wi,flattenDepth:Ai,fromPairs:Ni,head:pi,indexOf:no,initial:io,intersection:co,intersectionBy:uo,intersectionWith:lo,join:ps,last:bn,lastIndexOf:vs,nth:Xs,pull:sc,pullAll:oc,pullAllBy:ac,pullAllWith:cc,pullAt:dc,remove:Nc,reverse:jc,slice:eu,sortedIndex:uu,sortedIndexBy:lu,sortedIndexOf:fu,sortedLastIndex:du,sortedLastIndexBy:hu,sortedLastIndexOf:pu,sortedUniq:yu,sortedUniqBy:mu,tail:Ou,take:Cu,takeRight:Nu,takeRightWhile:Ru,takeWhile:Bu,union:Cl,unionBy:Nl,unionWith:Rl,uniq:Bl,uniqBy:Ml,uniqWith:Ll,unzip:Zl,unzipWith:Hl,without:ql,xor:ef,xorBy:tf,xorWith:rf,zip:nf,zipObject:sf,zipObjectDeep:af,zipWith:cf},lf={countBy:Fr,each:kn,eachRight:Bn,every:Jn,filter:ti,find:oi,findLast:di,flatMap:mi,flatMapDeep:bi,flatMapDepth:vi,forEach:kn,forEachRight:Bn,groupBy:ji,includes:to,invokeMap:So,keyBy:ys.Z,map:yi,orderBy:ca,partition:Ka,reduce:Ic,reduceRight:Oc,reject:Cc,sample:Hc,sampleSize:Vc,shuffle:Qc,size:Xc,some:nu,sortBy:iu.Z},ff={now:Gr},df={after:w,ary:Ee,before:Qe,bind:et,bindKey:ot,curry:Zr,curryRight:$r,debounce:Wr,defer:cn,delay:ln,flip:Ei,memoize:js.Z,negate:Vs.Z,once:sa,overArgs:pa,partial:Va,partialRight:qa,rearg:Tc,rest:Mc,spread:wu,throttle:Qu,unary:_l,wrap:Kl},hf={castArray:ar,clone:wr,cloneDeep:Ar.Z,cloneDeepWith:Er,cloneWith:_r,conformsTo:Rr,eq:Kr.Z,gt:Zi,gte:Hi,isArguments:xo.Z,isArray:z.Z,isArrayBuffer:Io,isArrayLike:Te.Z,isArrayLikeObject:yn.Z,isBoolean:ko,isBuffer:Oo.Z,isDate:No,isElement:Ro,isEmpty:Fo,isEqual:Uo,isEqualWith:Do,isError:Ke,isFinite:Ho,isFunction:Ri.Z,isInteger:$o,isLength:Go.Z,isMap:zo.Z,isMatch:qo,isMatchWith:Ko,isNaN:Yo,isNative:rs,isNil:ns,isNull:is,isNumber:Jo,isObject:d.Z,isObjectLike:V.Z,isPlainObject:qe.Z,isRegExp:ss,isSafeInteger:as,isSet:cs.Z,isString:Yi,isSymbol:n.Z,isTypedArray:Mo.Z,isUndefined:us,isWeakMap:ls,isWeakSet:fs,lt:_s,lte:Ss,toArray:Js,toFinite:b,toInteger:v,toLength:Yn,toNumber:m,toPlainObject:ll.Z,toSafeInteger:fl,toString:st.Z},pf={add:a,ceil:fr,divide:An,floor:_i,max:Ns,maxBy:Rs,mean:Ls,meanBy:Fs,min:Hs,minBy:$s,multiply:zs,round:Uc,subtract:Pu,sum:Iu,sumBy:ku},gf={clamp:br,inRange:Ji,random:vc},yf={assign:Ce,assignIn:Be,assignInWith:Le,assignWith:je,at:ze,create:Ur,defaults:Xr,defaultsDeep:on,entries:Un,entriesIn:Dn,extend:Be,extendWith:Le,findKey:ci,findLastKey:hi,forIn:Ii,forInRight:ki,forOwn:Oi,forOwnRight:Ci,functions:Mi,functionsIn:Li,get:Ue.Z,has:Vi,hasIn:Wi.Z,invert:po,invertBy:bo,invoke:_o,keys:Ie.Z,keysIn:Ne.Z,mapKeys:xs,mapValues:Ts.Z,merge:Us.Z,mergeWith:nn,omit:ia,omitBy:oa.Z,pick:Ya,pickBy:Qa.Z,result:Lc,set:qc,setWith:Kc,toPairs:Un,toPairsIn:Dn,transform:pl,unset:Ul,update:Gl,updateWith:zl,values:Xi,valuesIn:Wl},mf={at:Jl,chain:dr,commit:Sr,lodash:Y,next:Ys,plant:Xa,reverse:Ql,tap:Mu,thru:Xu,toIterator:il,toJSON:sl,value:sl,valueOf:sl,wrapperChain:Yl},bf={camelCase:sr,capitalize:Tt,deburr:Nt,endsWith:Mn,escape:Gn,escapeRegExp:Wn,kebabCase:gs,lowerCase:ws,lowerFirst:As,pad:Ua,padEnd:Da,padStart:Za,parseInt:Ga,repeat:Rc,replace:Bc,snakeCase:tu,split:bu,startCase:Au,startsWith:Eu,template:Yu,templateSettings:Hu,toLower:al,toUpper:dl,trim:ml,trimEnd:bl,trimStart:wl,truncate:El,unescape:Pl,upperCase:Vl,upperFirst:xt,words:nr},vf={attempt:Ye,bindAll:nt,cond:Or,conforms:Nr,constant:Br.Z,defaultTo:qr,flow:xi,flowRight:Ti,identity:A.Z,iteratee:ds,matches:Is,matchesProperty:Os,method:Ds,methodOf:Zs,mixin:Gs,noop:F,nthArg:ea,over:la,overEvery:ga,overSome:ma,property:ec.Z,propertyOf:tc,range:_c,rangeRight:Sc,stubArray:_u.Z,stubFalse:es.Z,stubObject:Su,stubString:xu,stubTrue:Tu,times:nl,toPath:ul,uniqueId:jl};var wf=Math.max,Af=Math.min;var Ef=Math.min;var _f,Sf,xf=4294967295,Tf=Array.prototype,Pf=Object.prototype.hasOwnProperty,If=Ws.Z?Ws.Z.iterator:void 0,kf=Math.max,Of=Math.min,Cf=(_f=Gs,function(e,t,r){if(null==r){var n=(0,d.Z)(t),i=n&&(0,Ie.Z)(t),o=i&&i.length&&Bi(t,i);(o?o.length:n)||(r=t,t=e,e=this)}return _f(e,t,r)});Y.after=df.after,Y.ary=df.ary,Y.assign=yf.assign,Y.assignIn=yf.assignIn,Y.assignInWith=yf.assignInWith,Y.assignWith=yf.assignWith,Y.at=yf.at,Y.before=df.before,Y.bind=df.bind,Y.bindAll=vf.bindAll,Y.bindKey=df.bindKey,Y.castArray=hf.castArray,Y.chain=mf.chain,Y.chunk=uf.chunk,Y.compact=uf.compact,Y.concat=uf.concat,Y.cond=vf.cond,Y.conforms=vf.conforms,Y.constant=vf.constant,Y.countBy=lf.countBy,Y.create=yf.create,Y.curry=df.curry,Y.curryRight=df.curryRight,Y.debounce=df.debounce,Y.defaults=yf.defaults,Y.defaultsDeep=yf.defaultsDeep,Y.defer=df.defer,Y.delay=df.delay,Y.difference=uf.difference,Y.differenceBy=uf.differenceBy,Y.differenceWith=uf.differenceWith,Y.drop=uf.drop,Y.dropRight=uf.dropRight,Y.dropRightWhile=uf.dropRightWhile,Y.dropWhile=uf.dropWhile,Y.fill=uf.fill,Y.filter=lf.filter,Y.flatMap=lf.flatMap,Y.flatMapDeep=lf.flatMapDeep,Y.flatMapDepth=lf.flatMapDepth,Y.flatten=uf.flatten,Y.flattenDeep=uf.flattenDeep,Y.flattenDepth=uf.flattenDepth,Y.flip=df.flip,Y.flow=vf.flow,Y.flowRight=vf.flowRight,Y.fromPairs=uf.fromPairs,Y.functions=yf.functions,Y.functionsIn=yf.functionsIn,Y.groupBy=lf.groupBy,Y.initial=uf.initial,Y.intersection=uf.intersection,Y.intersectionBy=uf.intersectionBy,Y.intersectionWith=uf.intersectionWith,Y.invert=yf.invert,Y.invertBy=yf.invertBy,Y.invokeMap=lf.invokeMap,Y.iteratee=vf.iteratee,Y.keyBy=lf.keyBy,Y.keys=Ie.Z,Y.keysIn=yf.keysIn,Y.map=lf.map,Y.mapKeys=yf.mapKeys,Y.mapValues=yf.mapValues,Y.matches=vf.matches,Y.matchesProperty=vf.matchesProperty,Y.memoize=df.memoize,Y.merge=yf.merge,Y.mergeWith=yf.mergeWith,Y.method=vf.method,Y.methodOf=vf.methodOf,Y.mixin=Cf,Y.negate=Vs.Z,Y.nthArg=vf.nthArg,Y.omit=yf.omit,Y.omitBy=yf.omitBy,Y.once=df.once,Y.orderBy=lf.orderBy,Y.over=vf.over,Y.overArgs=df.overArgs,Y.overEvery=vf.overEvery,Y.overSome=vf.overSome,Y.partial=df.partial,Y.partialRight=df.partialRight,Y.partition=lf.partition,Y.pick=yf.pick,Y.pickBy=yf.pickBy,Y.property=vf.property,Y.propertyOf=vf.propertyOf,Y.pull=uf.pull,Y.pullAll=uf.pullAll,Y.pullAllBy=uf.pullAllBy,Y.pullAllWith=uf.pullAllWith,Y.pullAt=uf.pullAt,Y.range=vf.range,Y.rangeRight=vf.rangeRight,Y.rearg=df.rearg,Y.reject=lf.reject,Y.remove=uf.remove,Y.rest=df.rest,Y.reverse=uf.reverse,Y.sampleSize=lf.sampleSize,Y.set=yf.set,Y.setWith=yf.setWith,Y.shuffle=lf.shuffle,Y.slice=uf.slice,Y.sortBy=lf.sortBy,Y.sortedUniq=uf.sortedUniq,Y.sortedUniqBy=uf.sortedUniqBy,Y.split=bf.split,Y.spread=df.spread,Y.tail=uf.tail,Y.take=uf.take,Y.takeRight=uf.takeRight,Y.takeRightWhile=uf.takeRightWhile,Y.takeWhile=uf.takeWhile,Y.tap=mf.tap,Y.throttle=df.throttle,Y.thru=Xu,Y.toArray=hf.toArray,Y.toPairs=yf.toPairs,Y.toPairsIn=yf.toPairsIn,Y.toPath=vf.toPath,Y.toPlainObject=hf.toPlainObject,Y.transform=yf.transform,Y.unary=df.unary,Y.union=uf.union,Y.unionBy=uf.unionBy,Y.unionWith=uf.unionWith,Y.uniq=uf.uniq,Y.uniqBy=uf.uniqBy,Y.uniqWith=uf.uniqWith,Y.unset=yf.unset,Y.unzip=uf.unzip,Y.unzipWith=uf.unzipWith,Y.update=yf.update,Y.updateWith=yf.updateWith,Y.values=yf.values,Y.valuesIn=yf.valuesIn,Y.without=uf.without,Y.words=bf.words,Y.wrap=df.wrap,Y.xor=uf.xor,Y.xorBy=uf.xorBy,Y.xorWith=uf.xorWith,Y.zip=uf.zip,Y.zipObject=uf.zipObject,Y.zipObjectDeep=uf.zipObjectDeep,Y.zipWith=uf.zipWith,Y.entries=yf.toPairs,Y.entriesIn=yf.toPairsIn,Y.extend=yf.assignIn,Y.extendWith=yf.assignInWith,Cf(Y,Y),Y.add=pf.add,Y.attempt=vf.attempt,Y.camelCase=bf.camelCase,Y.capitalize=bf.capitalize,Y.ceil=pf.ceil,Y.clamp=gf.clamp,Y.clone=hf.clone,Y.cloneDeep=hf.cloneDeep,Y.cloneDeepWith=hf.cloneDeepWith,Y.cloneWith=hf.cloneWith,Y.conformsTo=hf.conformsTo,Y.deburr=bf.deburr,Y.defaultTo=vf.defaultTo,Y.divide=pf.divide,Y.endsWith=bf.endsWith,Y.eq=hf.eq,Y.escape=bf.escape,Y.escapeRegExp=bf.escapeRegExp,Y.every=lf.every,Y.find=lf.find,Y.findIndex=uf.findIndex,Y.findKey=yf.findKey,Y.findLast=lf.findLast,Y.findLastIndex=uf.findLastIndex,Y.findLastKey=yf.findLastKey,Y.floor=pf.floor,Y.forEach=lf.forEach,Y.forEachRight=lf.forEachRight,Y.forIn=yf.forIn,Y.forInRight=yf.forInRight,Y.forOwn=yf.forOwn,Y.forOwnRight=yf.forOwnRight,Y.get=yf.get,Y.gt=hf.gt,Y.gte=hf.gte,Y.has=yf.has,Y.hasIn=yf.hasIn,Y.head=uf.head,Y.identity=A.Z,Y.includes=lf.includes,Y.indexOf=uf.indexOf,Y.inRange=gf.inRange,Y.invoke=yf.invoke,Y.isArguments=hf.isArguments,Y.isArray=z.Z,Y.isArrayBuffer=hf.isArrayBuffer,Y.isArrayLike=hf.isArrayLike,Y.isArrayLikeObject=hf.isArrayLikeObject,Y.isBoolean=hf.isBoolean,Y.isBuffer=hf.isBuffer,Y.isDate=hf.isDate,Y.isElement=hf.isElement,Y.isEmpty=hf.isEmpty,Y.isEqual=hf.isEqual,Y.isEqualWith=hf.isEqualWith,Y.isError=hf.isError,Y.isFinite=hf.isFinite,Y.isFunction=hf.isFunction,Y.isInteger=hf.isInteger,Y.isLength=hf.isLength,Y.isMap=hf.isMap,Y.isMatch=hf.isMatch,Y.isMatchWith=hf.isMatchWith,Y.isNaN=hf.isNaN,Y.isNative=hf.isNative,Y.isNil=hf.isNil,Y.isNull=hf.isNull,Y.isNumber=hf.isNumber,Y.isObject=d.Z,Y.isObjectLike=hf.isObjectLike,Y.isPlainObject=hf.isPlainObject,Y.isRegExp=hf.isRegExp,Y.isSafeInteger=hf.isSafeInteger,Y.isSet=hf.isSet,Y.isString=hf.isString,Y.isSymbol=hf.isSymbol,Y.isTypedArray=hf.isTypedArray,Y.isUndefined=hf.isUndefined,Y.isWeakMap=hf.isWeakMap,Y.isWeakSet=hf.isWeakSet,Y.join=uf.join,Y.kebabCase=bf.kebabCase,Y.last=bn,Y.lastIndexOf=uf.lastIndexOf,Y.lowerCase=bf.lowerCase,Y.lowerFirst=bf.lowerFirst,Y.lt=hf.lt,Y.lte=hf.lte,Y.max=pf.max,Y.maxBy=pf.maxBy,Y.mean=pf.mean,Y.meanBy=pf.meanBy,Y.min=pf.min,Y.minBy=pf.minBy,Y.stubArray=vf.stubArray,Y.stubFalse=vf.stubFalse,Y.stubObject=vf.stubObject,Y.stubString=vf.stubString,Y.stubTrue=vf.stubTrue,Y.multiply=pf.multiply,Y.nth=uf.nth,Y.noop=vf.noop,Y.now=ff.now,Y.pad=bf.pad,Y.padEnd=bf.padEnd,Y.padStart=bf.padStart,Y.parseInt=bf.parseInt,Y.random=gf.random,Y.reduce=lf.reduce,Y.reduceRight=lf.reduceRight,Y.repeat=bf.repeat,Y.replace=bf.replace,Y.result=yf.result,Y.round=pf.round,Y.sample=lf.sample,Y.size=lf.size,Y.snakeCase=bf.snakeCase,Y.some=lf.some,Y.sortedIndex=uf.sortedIndex,Y.sortedIndexBy=uf.sortedIndexBy,Y.sortedIndexOf=uf.sortedIndexOf,Y.sortedLastIndex=uf.sortedLastIndex,Y.sortedLastIndexBy=uf.sortedLastIndexBy,Y.sortedLastIndexOf=uf.sortedLastIndexOf,Y.startCase=bf.startCase,Y.startsWith=bf.startsWith,Y.subtract=pf.subtract,Y.sum=pf.sum,Y.sumBy=pf.sumBy,Y.template=bf.template,Y.times=vf.times,Y.toFinite=hf.toFinite,Y.toInteger=v,Y.toLength=hf.toLength,Y.toLower=bf.toLower,Y.toNumber=hf.toNumber,Y.toSafeInteger=hf.toSafeInteger,Y.toString=hf.toString,Y.toUpper=bf.toUpper,Y.trim=bf.trim,Y.trimEnd=bf.trimEnd,Y.trimStart=bf.trimStart,Y.truncate=bf.truncate,Y.unescape=bf.unescape,Y.uniqueId=vf.uniqueId,Y.upperCase=bf.upperCase,Y.upperFirst=bf.upperFirst,Y.each=lf.forEach,Y.eachRight=lf.forEachRight,Y.first=uf.head,Cf(Y,(Sf={},(0,ai.Z)(Y,(function(e,t){Pf.call(Y.prototype,t)||(Sf[t]=e)})),Sf),{chain:!1}),Y.VERSION="4.17.21",(Y.templateSettings=bf.templateSettings).imports._=Y,(0,ie.Z)(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Y[e].placeholder=Y})),(0,ie.Z)(["drop","take"],(function(e,t){L.prototype[e]=function(r){r=void 0===r?1:kf(v(r),0);var n=this.__filtered__&&!t?new L(this):this.clone();return n.__filtered__?n.__takeCount__=Of(r,n.__takeCount__):n.__views__.push({size:Of(r,xf),type:e+(n.__dir__<0?"Right":"")}),n},L.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),(0,ie.Z)(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;L.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:(0,kr.Z)(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),(0,ie.Z)(["head","last"],(function(e,t){var r="take"+(t?"Right":"");L.prototype[e]=function(){return this[r](1).value()[0]}})),(0,ie.Z)(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");L.prototype[e]=function(){return this.__filtered__?new L(this):this[r](1)}})),L.prototype.compact=function(){return this.filter(A.Z)},L.prototype.find=function(e){return this.filter(e).head()},L.prototype.findLast=function(e){return this.reverse().find(e)},L.prototype.invokeMap=(0,Ve.Z)((function(e,t){return"function"==typeof e?new L(this):this.map((function(r){return Eo(r,e,t)}))})),L.prototype.reject=function(e){return this.filter((0,Vs.Z)((0,kr.Z)(e)))},L.prototype.slice=function(e,t){e=v(e);var r=this;return r.__filtered__&&(e>0||t<0)?new L(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),void 0!==t&&(r=(t=v(t))<0?r.dropRight(-t):r.take(t-e)),r)},L.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},L.prototype.toArray=function(){return this.take(xf)},(0,ai.Z)(L.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Y[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Y.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,a=t instanceof L,c=s[0],u=a||(0,z.Z)(t),l=function(e){var t=i.apply(Y,(0,Tr.Z)([e],s));return n&&f?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(a=u=!1);var f=this.__chain__,d=!!this.__actions__.length,h=o&&!f,p=a&&!d;if(!o&&u){t=p?t:new L(this);var g=e.apply(t,s);return g.__actions__.push({func:Xu,args:[l],thisArg:void 0}),new G(g,f)}return h&&p?e.apply(this,s):(g=this.thru(l),h?n?g.value()[0]:g.value():g)})})),(0,ie.Z)(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Tf[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Y.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply((0,z.Z)(i)?i:[],e)}return this[r]((function(r){return t.apply((0,z.Z)(r)?r:[],e)}))}})),(0,ai.Z)(L.prototype,(function(e,t){var r=Y[t];if(r){var n=r.name+"";Pf.call(D,n)||(D[n]=[]),D[n].push({name:t,func:r})}})),D[me(void 0,2).name]=[{name:"wrapper",func:void 0}],L.prototype.clone=function(){var e=new L(this.__wrapped__);return e.__actions__=(0,W.Z)(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=(0,W.Z)(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=(0,W.Z)(this.__views__),e},L.prototype.reverse=function(){if(this.__filtered__){var e=new L(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},L.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=(0,z.Z)(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=Af(t,e+s);break;case"takeRight":e=wf(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,c=a-s,u=n?a:s-1,l=this.__iteratees__,f=l.length,d=0,h=Ef(c,this.__takeCount__);if(!r||!n&&i==c&&h==c)return ol(e,this.__actions__);var p=[];e:for(;c--&&d<h;){for(var g=-1,y=e[u+=t];++g<f;){var m=l[g],b=m.iteratee,v=m.type,w=b(y);if(2==v)y=w;else if(!w){if(1==v)continue e;break e}}p[d++]=y}return p},Y.prototype.at=mf.at,Y.prototype.chain=mf.wrapperChain,Y.prototype.commit=mf.commit,Y.prototype.next=mf.next,Y.prototype.plant=mf.plant,Y.prototype.reverse=mf.reverse,Y.prototype.toJSON=Y.prototype.valueOf=Y.prototype.value=mf.value,Y.prototype.first=Y.prototype.head,If&&(Y.prototype[If]=mf.toIterator);const Nf=Y},8819:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(905),i=r(475),o=r(699);const s=function(e,t){var r={};return t=(0,o.Z)(t,3),(0,i.Z)(e,(function(e,i,o){(0,n.Z)(r,i,t(e,i,o))})),r}},7068:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(3703);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(i.Cache||n.Z),r}i.Cache=n.Z;const o=i},9106:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(3258);const i=(0,r(3625).Z)((function(e,t,r){(0,n.Z)(e,t,r)}))},6371:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}},7154:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(699),i=r(6371),o=r(4006);const s=function(e,t){return(0,o.Z)(e,(0,i.Z)((0,n.Z)(t)))}},4006:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(9423),i=r(699),o=r(2767),s=r(9878);const a=function(e,t){if(null==e)return{};var r=(0,n.Z)((0,s.Z)(e),(function(e){return[e]}));return t=(0,i.Z)(t),(0,o.Z)(e,r,(function(e,r){return t(e,r[0])}))}},4902:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(5523),i=r(9523);var o=r(3502),s=r(7969);const a=function(e){return(0,o.Z)(e)?(0,n.Z)((0,s.Z)(e)):function(e){return function(t){return(0,i.Z)(t,e)}}(e)}},2424:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(3338),i=r(8136),o=r(6493),s=r(5965);const a=(0,o.Z)((function(e,t){if(null==e)return[];var r=t.length;return r>1&&(0,s.Z)(e,t[0],t[1])?t=[]:r>2&&(0,s.Z)(t[0],t[1],t[2])&&(t=[t[0]]),(0,i.Z)(e,(0,n.Z)(t,1),[])}))},813:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(){return[]}},1433:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=function(){return!1}},7619:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(2436),i=r(7477);const o=function(e){return(0,n.Z)(e,(0,i.Z)(e))}},5186:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(9200);const i=function(e){return null==e?"":(0,n.Z)(e)}},763:e=>{"use strict";e.exports={i8:"6.5.4"}}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return r[e].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var o=Object.create(null);i.r(o);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&n&&r;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>r[e]));return s.default=()=>r,i.d(o,s),o},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o={};return(()=>{"use strict";i.r(o),i.d(o,{ARBITRUM_MAINNET_CHAIN_ID:()=>Pu,ARBITRUM_TESTNET_CHAIN_ID:()=>Mu,AVALANCHE_MAINNET_CHAIN_ID:()=>xu,AVALANCHE_TESTNET_CHAIN_ID:()=>Bu,AccountTrackerController:()=>Yu,BSC_MAINNET_CHAIN_ID:()=>Su,BSC_TESTNET_CHAIN_ID:()=>Ru,CELO_MAINNET_CHAIN_ID:()=>ku,CHAIN_ID_TO_GAS_LIMIT_BUFFER_MAP:()=>Zu,COINGECKO_PLATFORMS_CHAIN_CODE_MAP:()=>Wu,COINGECKO_SUPPORTED_CURRENCIES:()=>Vu,CONTRACT_TYPE_ERC1155:()=>mu,CONTRACT_TYPE_ERC20:()=>gu,CONTRACT_TYPE_ERC721:()=>yu,CONTRACT_TYPE_ETH:()=>pu,CurrencyController:()=>$d,DEFAULT_CURRENCY:()=>wy,DecryptMessageController:()=>Hg,ERC1155_INTERFACE_ID:()=>bu,ERC721_ENUMERABLE_INTERFACE_ID:()=>Au,ERC721_INTERFACE_ID:()=>vu,ERC721_METADATA_INTERFACE_ID:()=>wu,ETHERSCAN_SUPPORTED_CHAINS:()=>Gu,EncryptionPublicKeyController:()=>$g,GAS_ESTIMATE_TYPES:()=>Du,GAS_LIMITS:()=>Md,GOERLI_CHAIN_ID:()=>Ou,GasFeeController:()=>ch,KeyringController:()=>Ig,LOCALHOST:()=>hu,MAINNET_CHAIN_ID:()=>Eu,METHOD_TYPES:()=>ju,MessageController:()=>Gg,MessageStatus:()=>qu,NetworkController:()=>hy,NftHandler:()=>py,NftsController:()=>my,NonceTracker:()=>Ty,OLD_ERC721_LIST:()=>Hu,OPTIMISM_MAINNET_CHAIN_ID:()=>Iu,OPTIMISM_TESTNET_CHAIN_ID:()=>Lu,POLYGON_CHAIN_ID:()=>_u,POLYGON_MUMBAI_CHAIN_ID:()=>Nu,PendingTransactionTracker:()=>Py,PersonalMessageController:()=>zg,PollingBlockTracker:()=>Zd,PreferencesController:()=>by,SEPOLIA_CHAIN_ID:()=>Cu,SIMPLEHASH_SUPPORTED_CHAINS:()=>zu,SUPPORTED_NETWORKS:()=>Fu,TEST_CHAINS:()=>$u,TRANSACTION_ENVELOPE_TYPES:()=>Uu,TokenHandler:()=>vy,TokenRatesController:()=>Ay,TokensController:()=>xy,TransactionController:()=>Bb,TransactionGasUtil:()=>Tm,TransactionStateManager:()=>Nb,TypedMessageController:()=>Wg,XDAI_CHAIN_ID:()=>Tu,bnLessThan:()=>Ld,createChainIdMiddleware:()=>uy,createEthereumMiddleware:()=>cy,createGetAccountsMiddleware:()=>Kg,createJsonRpcClient:()=>fy,createPendingNonceMiddleware:()=>ry,createPendingTxMiddleware:()=>iy,createProcessDecryptMessageMiddleware:()=>sy,createProcessEncryptionPublicKeyMiddleware:()=>oy,createProcessEthSignMessage:()=>Yg,createProcessPersonalMessage:()=>ty,createProcessTransactionMiddleware:()=>Jg,createProcessTypedMessage:()=>Qg,createProcessTypedMessageV3:()=>Xg,createProcessTypedMessageV4:()=>ey,createProviderConfigMiddleware:()=>ly,createRequestAccountsMiddleware:()=>ay,determineTransactionType:()=>Cb,ensureFieldIsString:()=>Eb,ensureMutuallyExclusiveFieldsNotProvided:()=>Ab,formatDate:()=>Od,formatPastTx:()=>Id,formatTime:()=>Cd,formatTxMetaForRpcResult:()=>ny,generateHistoryEntry:()=>lb,getChainType:()=>Ud,getEthTxStatus:()=>kd,getEtherScanHashLink:()=>Pd,getFinalStates:()=>Ib,getIpfsEndpoint:()=>Fd,idleTimeTracker:()=>Nd,isAddressByChainId:()=>Rd,isEIP1559Transaction:()=>vb,isLegacyTransaction:()=>wb,normalizeAndValidateTxParams:()=>Pb,normalizeMessageData:()=>Lg,normalizeTxParameters:()=>mb,parseDecryptMessageData:()=>Zg,parseStandardTokenTransactionData:()=>kb,readAddressAsContract:()=>Ob,replayHistory:()=>fb,sanitizeNftMetdataUrl:()=>jd,snapshotFromTxMeta:()=>db,toChecksumAddressByChainId:()=>Bd,transactionMatchesNetwork:()=>bb,validateAddress:()=>Bg,validateDecryptedMessageData:()=>Dg,validateEncryptionPublicKeyMessageData:()=>Ug,validateFrom:()=>Sb,validateRecipient:()=>xb,validateSignMessageData:()=>Mg,validateTxParameters:()=>Tb,validateTypedSignMessageDataV1:()=>Fg,validateTypedSignMessageDataV3V4:()=>jg});var e={};i.r(e),i.d(e,{dQ:()=>El,ci:()=>hl,bytesToNumberBE:()=>yl,ty:()=>ml,eV:()=>Al,n$:()=>xl,ql:()=>wl,hexToBytes:()=>gl,tL:()=>bl,S5:()=>vl,FF:()=>Pl});var t={};i.r(t),i.d(t,{JsonPatchError:()=>Gm,_areEquals:()=>eb,applyOperation:()=>Km,applyPatch:()=>Jm,applyReducer:()=>Ym,deepClone:()=>zm,getValueByPointer:()=>qm,validate:()=>Xm,validator:()=>Qm});var r={};i.r(r),i.d(r,{compare:()=>cb,generate:()=>sb,observe:()=>ob,unobserve:()=>ib});var n=i(3028),s=i(2601),a=i(2937);new Error("timeout while waiting for mutex to become available"),new Error("mutex already locked");const c=new Error("request for lock canceled");class u{constructor(e,t=c){this._value=e,this._cancelError=t,this._weightedQueues=[],this._weightedWaiters=[]}acquire(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise(((t,r)=>{this._weightedQueues[e-1]||(this._weightedQueues[e-1]=[]),this._weightedQueues[e-1].push({resolve:t,reject:r}),this._dispatch()}))}runExclusive(e,t=1){return r=this,n=void 0,o=function*(){const[r,n]=yield this.acquire(t);try{return yield e(r)}finally{n()}},new((i=void 0)||(i=Promise))((function(e,t){function s(e){try{c(o.next(e))}catch(e){t(e)}}function a(e){try{c(o.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(s,a)}c((o=o.apply(r,n||[])).next())}));var r,n,i,o}waitForUnlock(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),this._weightedWaiters[e-1].push(t),this._dispatch()}))}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatch()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatch()}cancel(){this._weightedQueues.forEach((e=>e.forEach((e=>e.reject(this._cancelError))))),this._weightedQueues=[]}_dispatch(){var e;for(let t=this._value;t>0;t--){const r=null===(e=this._weightedQueues[t-1])||void 0===e?void 0:e.shift();if(!r)continue;const n=this._value,i=t;this._value-=t,t=this._value+1,r.resolve([n,this._newReleaser(i)])}this._drainUnlockWaiters()}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){for(let e=this._value;e>0;e--)this._weightedWaiters[e-1]&&(this._weightedWaiters[e-1].forEach((e=>e())),this._weightedWaiters[e-1]=[])}}class l{constructor(e){this._semaphore=new u(1,e)}acquire(){return e=this,t=void 0,n=function*(){const[,e]=yield this._semaphore.acquire();return e},new((r=void 0)||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}));var e,t,r,n}runExclusive(e){return this._semaphore.runExclusive((()=>e()))}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const f="6.7.1";function d(e,t,r){const n=t.split("|").map((e=>e.trim()));for(let r=0;r<n.length;r++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const i=new Error(`invalid value for type ${t}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${r}`,i.value=e,i}async function h(e){const t=Object.keys(e);return(await Promise.all(t.map((t=>Promise.resolve(e[t]))))).reduce(((e,r,n)=>(e[t[n]]=r,e)),{})}function p(e,t,r){for(let n in t){let i=t[n];const o=r?r[n]:null;o&&d(i,o,n),Object.defineProperty(e,n,{enumerable:!0,value:i,writable:!1})}}function g(e){if(null==e)return"null";if(Array.isArray(e))return"[ "+e.map(g).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let r="0x";for(let n=0;n<e.length;n++)r+=t[e[n]>>4],r+=t[15&e[n]];return r}if("object"==typeof e&&"function"==typeof e.toJSON)return g(e.toJSON());switch(typeof e){case"boolean":case"symbol":case"number":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const t=Object.keys(e);return t.sort(),"{ "+t.map((t=>`${g(t)}: ${g(e[t])}`)).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function y(e,t){return e&&e.code===t}function m(e){return y(e,"CALL_EXCEPTION")}function b(e,t,r){{const n=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${g(r)}`);for(const e in r){const t=r[e];n.push(e+"="+g(t))}}n.push(`code=${t}`),n.push(`version=${f}`),n.length&&(e+=" ("+n.join(", ")+")")}let n;switch(t){case"INVALID_ARGUMENT":n=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":n=new RangeError(e);break;default:n=new Error(e)}return p(n,{code:t}),r&&Object.assign(n,r),n}function v(e,t,r,n){if(!e)throw b(t,r,n)}function w(e,t,r,n){v(e,t,"INVALID_ARGUMENT",{argument:r,value:n})}function A(e,t,r){null==r&&(r=""),r&&(r=": "+r),v(e>=t,"missing arguemnt"+r,"MISSING_ARGUMENT",{count:e,expectedCount:t}),v(e<=t,"too many arguemnts"+r,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}const E=["NFD","NFC","NFKD","NFKC"].reduce(((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e}),[]);function _(e){v(E.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}function S(e,t,r){if(null==r&&(r=""),e!==t){let e=r,t="new";r&&(e+=".",t+=" "+r),v(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}function x(e,t,r){if(e instanceof Uint8Array)return r?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x([0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let r=2;for(let n=0;n<t.length;n++)t[n]=parseInt(e.substring(r,r+2),16),r+=2;return t}w(!1,"invalid BytesLike value",t||"value",e)}function T(e,t){return x(e,t,!1)}function P(e,t){return x(e,t,!0)}function I(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||"number"==typeof t&&e.length!==2+2*t||!0===t&&e.length%2!=0)}function k(e){return I(e,!0)||e instanceof Uint8Array}const O="0123456789abcdef";function C(e){const t=T(e);let r="0x";for(let e=0;e<t.length;e++){const n=t[e];r+=O[(240&n)>>4]+O[15&n]}return r}function N(e){return"0x"+e.map((e=>C(e).substring(2))).join("")}function R(e){return I(e,!0)?(e.length-2)/2:T(e).length}function B(e,t,r){const n=T(e);return null!=r&&r>n.length&&v(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),C(n.slice(null==t?0:t,null==r?n.length:r))}function M(e,t,r){const n=T(e);v(t>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:t,offset:t+1});const i=new Uint8Array(t);return i.fill(0),r?i.set(n,t-n.length):i.set(n,0),C(i)}function L(e,t){return M(e,t,!0)}const F=BigInt(0),j=BigInt(1),U=9007199254740991;function D(e,t){let r=H(e,"value");const n=BigInt(V(t,"width")),i=j<<n-j;return r<F?(r=-r,v(r<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e}),(~r&(j<<n)-j)+j):(v(r<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e}),r)}function Z(e,t){const r=$(e,"value"),n=BigInt(V(t,"bits"));return r&(j<<n)-j}function H(e,t){switch(typeof e){case"bigint":return e;case"number":return w(Number.isInteger(e),"underflow",t||"value",e),w(e>=-U&&e<=U,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(r){w(!1,`invalid BigNumberish string: ${r.message}`,t||"value",e)}}w(!1,"invalid BigNumberish value",t||"value",e)}function $(e,t){const r=H(e,t);return v(r>=F,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),r}const G="0123456789abcdef";function z(e){if(e instanceof Uint8Array){let t="0x0";for(const r of e)t+=G[r>>4],t+=G[15&r];return BigInt(t)}return H(e)}function V(e,t){switch(typeof e){case"bigint":return w(e>=-U&&e<=U,"overflow",t||"value",e),Number(e);case"number":return w(Number.isInteger(e),"underflow",t||"value",e),w(e>=-U&&e<=U,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return V(BigInt(e),t)}catch(r){w(!1,`invalid numeric string: ${r.message}`,t||"value",e)}}w(!1,"invalid numeric value",t||"value",e)}function W(e,t){let r=$(e,"value").toString(16);if(null==t)r.length%2&&(r="0"+r);else{const n=V(t,"width");for(v(2*n>=r.length,`value exceeds width (${n} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});r.length<2*n;)r="0"+r}return"0x"+r}function q(e){const t=$(e,"value");if(t===F)return new Uint8Array([]);let r=t.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=2*e;n[e]=parseInt(r.substring(t,t+2),16)}return n}function K(e){let t=C(k(e)?e:q(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return""===t&&(t="0"),"0x"+t}const J=32,Y=new Uint8Array(J),Q=["then"],X={};function ee(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw r.error=t,r}class te extends Array{#e;constructor(...e){const t=e[0];let r=e[1],n=(e[2]||[]).slice(),i=!0;t!==X&&(r=e,n=[],i=!1),super(r.length),r.forEach(((e,t)=>{this[t]=e}));const o=n.reduce(((e,t)=>("string"==typeof t&&e.set(t,(e.get(t)||0)+1),e)),new Map);if(this.#e=Object.freeze(r.map(((e,t)=>{const r=n[t];return null!=r&&1===o.get(r)?r:null}))),i)return Object.freeze(this),new Proxy(this,{get:(e,t,r)=>{if("string"==typeof t){if(t.match(/^[0-9]+$/)){const r=V(t,"%index");if(r<0||r>=this.length)throw new RangeError("out of result range");const n=e[r];return n instanceof Error&&ee(`index ${r}`,n),n}if(Q.indexOf(t)>=0)return Reflect.get(e,t,r);const n=e[t];if(n instanceof Function)return function(...t){return n.apply(this===r?e:this,t)};if(!(t in e))return e.getValue.apply(this===r?e:this,[t])}return Reflect.get(e,t,r)}})}toArray(){const e=[];return this.forEach(((t,r)=>{t instanceof Error&&ee(`index ${r}`,t),e.push(t)})),e}toObject(){return this.#e.reduce(((e,t,r)=>(v(null!=t,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),t in e||(e[t]=this.getValue(t)),e)),{})}slice(e,t){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==t&&(t=this.length),t<0&&(t+=this.length)<0&&(t=0),t>this.length&&(t=this.length);const r=[],n=[];for(let i=e;i<t;i++)r.push(this[i]),n.push(this.#e[i]);return new te(X,r,n)}filter(e,t){const r=[],n=[];for(let i=0;i<this.length;i++){const o=this[i];o instanceof Error&&ee(`index ${i}`,o),e.call(t,o,i,this)&&(r.push(o),n.push(this.#e[i]))}return new te(X,r,n)}map(e,t){const r=[];for(let n=0;n<this.length;n++){const i=this[n];i instanceof Error&&ee(`index ${n}`,i),r.push(e.call(t,i,n,this))}return r}getValue(e){const t=this.#e.indexOf(e);if(-1===t)return;const r=this[t];return r instanceof Error&&ee(`property ${JSON.stringify(e)}`,r.error),r}static fromItems(e,t){return new te(X,e,t)}}function re(e){let t=q(e);return v(t.length<=J,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:J,offset:t.length}),t.length!==J&&(t=P(N([Y.slice(t.length%J),t]))),t}class ne{name;type;localName;dynamic;constructor(e,t,r,n){p(this,{name:e,type:t,localName:r,dynamic:n},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){w(!1,e,this.localName,t)}}class ie{#t;#r;constructor(){this.#t=[],this.#r=0}get data(){return N(this.#t)}get length(){return this.#r}#n(e){return this.#t.push(e),this.#r+=e.length,e.length}appendWriter(e){return this.#n(P(e.data))}writeBytes(e){let t=P(e);const r=t.length%J;return r&&(t=P(N([t,Y.slice(r)]))),this.#n(t)}writeValue(e){return this.#n(re(e))}writeUpdatableValue(){const e=this.#t.length;return this.#t.push(Y),this.#r+=J,t=>{this.#t[e]=re(t)}}}class oe{allowLoose;#t;#i;constructor(e,t){p(this,{allowLoose:!!t}),this.#t=P(e),this.#i=0}get data(){return C(this.#t)}get dataLength(){return this.#t.length}get consumed(){return this.#i}get bytes(){return new Uint8Array(this.#t)}#o(e,t,r){let n=Math.ceil(t/J)*J;return this.#i+n>this.#t.length&&(this.allowLoose&&r&&this.#i+t<=this.#t.length?n=t:v(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:P(this.#t),length:this.#t.length,offset:this.#i+n})),this.#t.slice(this.#i,this.#i+n)}subReader(e){return new oe(this.#t.slice(this.#i+e),this.allowLoose)}readBytes(e,t){let r=this.#o(0,e,!!t);return this.#i+=r.length,r.slice(0,e)}readValue(){return z(this.readBytes(J))}readIndex(){return V(z(this.readBytes(J)))}}function se(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function ae(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}const ce={number:se,bool:function(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:ae,hash:function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");se(e.outputLen),se(e.blockLen)},exists:function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},output:function(e,t){ae(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}},ue=ce,le=BigInt(2**32-1),fe=BigInt(32);function de(e,t=!1){return t?{h:Number(e&le),l:Number(e>>fe&le)}:{h:0|Number(e>>fe&le),l:0|Number(e&le)}}const he=function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=de(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]},pe=(e,t,r)=>e>>>r,ge=(e,t,r)=>e<<32-r|t>>>r,ye=(e,t,r)=>e>>>r|t<<32-r,me=(e,t,r)=>e<<32-r|t>>>r,be=(e,t,r)=>e<<64-r|t>>>r-32,ve=(e,t,r)=>e>>>r-32|t<<64-r,we=(e,t,r)=>e<<r|t>>>32-r,Ae=(e,t,r)=>t<<r|e>>>32-r,Ee=(e,t,r)=>t<<r-32|e>>>64-r,_e=(e,t,r)=>e<<r-32|t>>>64-r,Se=function(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}},xe=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Te=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Pe=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Ie=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,ke=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,Oe=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Ce=("object"==typeof self&&"crypto"in self&&self.crypto,e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))),Ne=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Re=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const Be=async()=>{};async function Me(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);const e=Date.now()-n;e>=0&&e<t||(await Be(),n+=e)}}function Le(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}class Fe{clone(){return this._cloneInto()}}const je=e=>"[object Object]"===Object.prototype.toString.call(e)&&e.constructor===Object;function Ue(e,t){if(void 0!==t&&("object"!=typeof t||!je(t)))throw new TypeError("Options should be object or undefined");return Object.assign(e,t)}function De(e){const t=t=>e().update(Le(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}const[Ze,He,$e]=[[],[],[]],Ge=BigInt(0),ze=BigInt(1),Ve=BigInt(2),We=BigInt(7),qe=BigInt(256),Ke=BigInt(113);for(let e=0,t=ze,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Ze.push(2*(5*n+r)),He.push((e+1)*(e+2)/2%64);let i=Ge;for(let e=0;e<7;e++)t=(t<<ze^(t>>We)*Ke)%qe,t&Ve&&(i^=ze<<(ze<<BigInt(e))-ze);$e.push(i)}const[Je,Ye]=he($e,!0),Qe=(e,t,r)=>r>32?Ee(e,t,r):we(e,t,r),Xe=(e,t,r)=>r>32?_e(e,t,r):Ae(e,t,r);class et extends Fe{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ue.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Ce(this.state)}keccak(){!function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=Qe(o,s,1)^r[n],c=Xe(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=He[r],o=Qe(t,i,n),s=Xe(t,i,n),a=Ze[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=Je[n],e[1]^=Ye[n]}r.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){ue.exists(this);const{blockLen:t,state:r}=this,n=(e=Le(e)).length;for(let i=0;i<n;){const o=Math.min(t-this.pos,n-i);for(let t=0;t<o;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,0!=(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){ue.exists(this,!1),ue.bytes(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ue.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ue.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new et(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}const tt=(e,t,r)=>De((()=>new et(t,e,r))),rt=(tt(6,144,28),tt(6,136,32),tt(6,104,48),tt(6,72,64),tt(1,144,28),tt(1,136,32)),nt=(tt(1,104,48),tt(1,72,64),(e,t,r)=>function(e){const t=(t,r)=>e(r).update(Le(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(((n={})=>new et(t,e,void 0===n.dkLen?r:n.dkLen,!0))));nt(31,168,16),nt(31,136,32);let it=!1;const ot=function(e){return rt(e)};let st=ot;function at(e){const t=T(e,"data");return C(st(t))}at._=ot,at.lock=function(){it=!0},at.register=function(e){if(it)throw new TypeError("keccak256 is locked");st=e},Object.freeze(at);const ct=BigInt(0),ut=BigInt(36);function lt(e){const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=T(at(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const ft={};for(let e=0;e<10;e++)ft[String(e)]=String(e);for(let e=0;e<26;e++)ft[String.fromCharCode(65+e)]=String(10+e);const dt=15;const ht=function(){const e={};for(let t=0;t<36;t++)e["0123456789abcdefghijklmnopqrstuvwxyz"[t]]=BigInt(t);return e}();function pt(e){if(w("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=lt(e);return w(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){w(e.substring(2,4)===function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>ft[e])).join("");for(;t.length>=dt;){let e=t.substring(0,dt);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e),"bad icap checksum","address",e);let t=function(e){e=e.toLowerCase();let t=ct;for(let r=0;r<e.length;r++)t=t*ut+ht[e[r]];return t}(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return lt("0x"+t)}w(!1,"invalid address","address",e)}const gt={};function yt(e,t){let r=!1;return t<0&&(r=!0,t*=-1),new vt(gt,`${r?"":"u"}int${t}`,e,{signed:r,width:t})}function mt(e,t){return new vt(gt,`bytes${t||""}`,e,{size:t})}const bt=Symbol.for("_ethers_typed");class vt{type;value;#s;_typedSymbol;constructor(e,t,r,n){null==n&&(n=null),S(gt,e,"Typed"),p(this,{_typedSymbol:bt,type:t,value:r}),this.#s=n,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map((e=>e.format())).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return this.#s}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#s?-1:!1===this.#s?this.value.length:null}static from(e,t){return new vt(gt,e,t)}static uint8(e){return yt(e,8)}static uint16(e){return yt(e,16)}static uint24(e){return yt(e,24)}static uint32(e){return yt(e,32)}static uint40(e){return yt(e,40)}static uint48(e){return yt(e,48)}static uint56(e){return yt(e,56)}static uint64(e){return yt(e,64)}static uint72(e){return yt(e,72)}static uint80(e){return yt(e,80)}static uint88(e){return yt(e,88)}static uint96(e){return yt(e,96)}static uint104(e){return yt(e,104)}static uint112(e){return yt(e,112)}static uint120(e){return yt(e,120)}static uint128(e){return yt(e,128)}static uint136(e){return yt(e,136)}static uint144(e){return yt(e,144)}static uint152(e){return yt(e,152)}static uint160(e){return yt(e,160)}static uint168(e){return yt(e,168)}static uint176(e){return yt(e,176)}static uint184(e){return yt(e,184)}static uint192(e){return yt(e,192)}static uint200(e){return yt(e,200)}static uint208(e){return yt(e,208)}static uint216(e){return yt(e,216)}static uint224(e){return yt(e,224)}static uint232(e){return yt(e,232)}static uint240(e){return yt(e,240)}static uint248(e){return yt(e,248)}static uint256(e){return yt(e,256)}static uint(e){return yt(e,256)}static int8(e){return yt(e,-8)}static int16(e){return yt(e,-16)}static int24(e){return yt(e,-24)}static int32(e){return yt(e,-32)}static int40(e){return yt(e,-40)}static int48(e){return yt(e,-48)}static int56(e){return yt(e,-56)}static int64(e){return yt(e,-64)}static int72(e){return yt(e,-72)}static int80(e){return yt(e,-80)}static int88(e){return yt(e,-88)}static int96(e){return yt(e,-96)}static int104(e){return yt(e,-104)}static int112(e){return yt(e,-112)}static int120(e){return yt(e,-120)}static int128(e){return yt(e,-128)}static int136(e){return yt(e,-136)}static int144(e){return yt(e,-144)}static int152(e){return yt(e,-152)}static int160(e){return yt(e,-160)}static int168(e){return yt(e,-168)}static int176(e){return yt(e,-176)}static int184(e){return yt(e,-184)}static int192(e){return yt(e,-192)}static int200(e){return yt(e,-200)}static int208(e){return yt(e,-208)}static int216(e){return yt(e,-216)}static int224(e){return yt(e,-224)}static int232(e){return yt(e,-232)}static int240(e){return yt(e,-240)}static int248(e){return yt(e,-248)}static int256(e){return yt(e,-256)}static int(e){return yt(e,-256)}static bytes1(e){return mt(e,1)}static bytes2(e){return mt(e,2)}static bytes3(e){return mt(e,3)}static bytes4(e){return mt(e,4)}static bytes5(e){return mt(e,5)}static bytes6(e){return mt(e,6)}static bytes7(e){return mt(e,7)}static bytes8(e){return mt(e,8)}static bytes9(e){return mt(e,9)}static bytes10(e){return mt(e,10)}static bytes11(e){return mt(e,11)}static bytes12(e){return mt(e,12)}static bytes13(e){return mt(e,13)}static bytes14(e){return mt(e,14)}static bytes15(e){return mt(e,15)}static bytes16(e){return mt(e,16)}static bytes17(e){return mt(e,17)}static bytes18(e){return mt(e,18)}static bytes19(e){return mt(e,19)}static bytes20(e){return mt(e,20)}static bytes21(e){return mt(e,21)}static bytes22(e){return mt(e,22)}static bytes23(e){return mt(e,23)}static bytes24(e){return mt(e,24)}static bytes25(e){return mt(e,25)}static bytes26(e){return mt(e,26)}static bytes27(e){return mt(e,27)}static bytes28(e){return mt(e,28)}static bytes29(e){return mt(e,29)}static bytes30(e){return mt(e,30)}static bytes31(e){return mt(e,31)}static bytes32(e){return mt(e,32)}static address(e){return new vt(gt,"address",e)}static bool(e){return new vt(gt,"bool",!!e)}static bytes(e){return new vt(gt,"bytes",e)}static string(e){return new vt(gt,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new vt(gt,"overrides",Object.assign({},e))}static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===bt}static dereference(e,t){if(vt.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}}class wt extends ne{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let r=vt.dereference(t,"string");try{r=pt(r)}catch(e){return this._throwError(e.message,t)}return e.writeValue(r)}decode(e){return pt(W(e.readValue(),20))}}class At extends ne{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}function Et(e,t,r){let n=[];if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return v(n,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),v(!e[n],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),e[n]=!0,r[n]}))}else w(!1,"invalid tuple value","tuple",r);w(t.length===n.length,"types/value length mismatch","tuple",r);let i=new ie,o=new ie,s=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();s.push((e=>{n(e+t)}))}else e.encode(i,r)})),s.forEach((e=>{e(i.length)}));let a=e.appendWriter(i);return a+=e.appendWriter(o),a}function _t(e,t){let r=[],n=[],i=e.subReader(0);return t.forEach((t=>{let o=null;if(t.dynamic){let r=e.readIndex(),n=i.subReader(r);try{o=t.decode(n)}catch(e){if(y(e,"BUFFER_OVERRUN"))throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}}else try{o=t.decode(e)}catch(e){if(y(e,"BUFFER_OVERRUN"))throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}if(null==o)throw new Error("investigate");r.push(o),n.push(t.localName||null)})),te.fromItems(r,n)}class St extends ne{coder;length;constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),p(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){const r=vt.dereference(t,"array");Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;-1===n&&(n=r.length,e.writeValue(r.length)),A(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let e=0;e<r.length;e++)i.push(this.coder);return Et(e,i,r)}decode(e){let t=this.length;-1===t&&(t=e.readIndex(),v(t*J<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*J,length:e.dataLength}));let r=[];for(let e=0;e<t;e++)r.push(new At(this.coder));return _t(e,r)}}class xt extends ne{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const r=vt.dereference(t,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}class Tt extends ne{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=P(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readIndex(),!0)}}class Pt extends Tt{constructor(e){super("bytes",e)}decode(e){return C(super.decode(e))}}class It extends ne{size;constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),p(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=P(vt.dereference(t,this.type));return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return C(e.readBytes(this.size))}}const kt=new Uint8Array([]);class Ot extends ne{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes(kt)}decode(e){return e.readBytes(0),null}}const Ct=BigInt(0),Nt=BigInt(1),Rt=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Bt extends ne{size;signed;constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),p(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let r=H(vt.dereference(t,this.type)),n=Z(Rt,256);if(this.signed){let e=Z(n,8*this.size-1);(r>e||r<-(e+Nt))&&this._throwError("value out-of-bounds",t),r=D(r,256)}else(r<Ct||r>Z(n,8*this.size))&&this._throwError("value out-of-bounds",t);return e.writeValue(r)}decode(e){let t=Z(e.readValue(),8*this.size);return this.signed&&(t=function(e,t){const r=$(e,"value"),n=BigInt(V(t,"width"));return v(r>>n===F,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),r>>n-j?-((~r&(j<<n)-j)+j):r}(t,8*this.size)),t}}function Mt(e,t,r,n,i){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return"OVERRUN"===e?r.length-t-1:0}const Lt=Object.freeze({error:function(e,t,r,n,i){w(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Mt,replace:function(e,t,r,n,i){return"OVERLONG"===e?(w("number"==typeof i,"invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),Mt(e,t,r))}});function Ft(e,t){null!=t&&(_(t),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);w(t<e.length&&56320==(64512&i),"invalid surrogate pair","str",e);const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return new Uint8Array(r)}function jt(e,t){return function(e,t){null==t&&(t=Lt.error);const r=T(e,"bytes"),n=[];let i=0;for(;i<r.length;){const e=r[i++];if(e>>7==0){n.push(e);continue}let o=null,s=null;if(192==(224&e))o=1,s=127;else if(224==(240&e))o=2,s=2047;else{if(240!=(248&e)){i+=t(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",i-1,r,n);continue}o=3,s=65535}if(i-1+o>=r.length){i+=t("OVERRUN",i-1,r,n);continue}let a=e&(1<<8-o-1)-1;for(let e=0;e<o;e++){let e=r[i];if(128!=(192&e)){i+=t("MISSING_CONTINUE",i,r,n),a=null;break}a=a<<6|63&e,i++}null!==a&&(a>1114111?i+=t("OUT_OF_RANGE",i-1-o,r,n,a):a>=55296&&a<=57343?i+=t("UTF16_SURROGATE",i-1-o,r,n,a):a<=s?i+=t("OVERLONG",i-1-o,r,n,a):n.push(a))}return n}(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}class Ut extends Tt{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Ft(vt.dereference(t,"string")))}decode(e){return jt(super.decode(e))}}class Dt extends ne{coders;constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)})),super("tuple","tuple("+n.join(",")+")",t,r),p(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){const r=vt.dereference(t,"tuple");return Et(e,this.coders,r)}decode(e){return _t(e,this.coders)}}function Zt(e){return at(Ft(e))}function Ht(e){const t=new Set;return e.forEach((e=>t.add(e))),Object.freeze(t)}const $t=Ht("external public payable".split(" ")),Gt="constant external internal payable private public pure view",zt=Ht(Gt.split(" ")),Vt="constructor error event fallback function receive struct",Wt=Ht(Vt.split(" ")),qt="calldata memory storage payable indexed",Kt=Ht(qt.split(" ")),Jt=Ht([Vt,qt,"tuple returns",Gt].join(" ").split(" ")),Yt={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Qt=new RegExp("^(\\s*)"),Xt=new RegExp("^([0-9]+)"),er=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),tr=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),rr=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class nr{#i;#a;get offset(){return this.#i}get length(){return this.#a.length-this.#i}constructor(e){this.#i=0,this.#a=e.slice()}clone(){return new nr(this.#a)}reset(){this.#i=0}#c(e=0,t=0){return new nr(this.#a.slice(e,t).map((t=>Object.freeze(Object.assign({},t,{match:t.match-e,linkBack:t.linkBack-e,linkNext:t.linkNext-e})))))}popKeyword(e){const t=this.peek();if("KEYWORD"!==t.type||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=this.#c(this.#i+1,e.match+1);return this.#i=e.match+1,t}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=[];for(;this.#i<e.match-1;){const e=this.peek().linkNext;t.push(this.#c(this.#i+1,e)),this.#i=e}return this.#i=e.match+1,t}peek(){if(this.#i>=this.#a.length)throw new Error("out-of-bounds");return this.#a[this.#i]}peekKeyword(e){const t=this.peekType("KEYWORD");return null!=t&&e.has(t)?t:null}peekType(e){if(0===this.length)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#i++,e}toString(){const e=[];for(let t=this.#i;t<this.#a.length;t++){const r=this.#a[t];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}}function ir(e){const t=[],r=t=>{const r=o<e.length?JSON.stringify(e[o]):"$EOI";throw new Error(`invalid token ${r} at ${o}: ${t}`)};let n=[],i=[],o=0;for(;o<e.length;){let s=e.substring(o),a=s.match(Qt);a&&(o+=a[1].length,s=e.substring(o));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:o,value:-1};t.push(c);let u=Yt[s[0]]||"";if(u){if(c.type=u,c.text=s[0],o++,"OPEN_PAREN"===u)n.push(t.length-1),i.push(t.length-1);else if("CLOSE_PAREN"==u)0===n.length&&r("no matching open bracket"),c.match=n.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=i.pop(),t[c.linkBack].linkNext=t.length-1;else if("COMMA"===u)c.linkBack=i.pop(),t[c.linkBack].linkNext=t.length-1,i.push(t.length-1);else if("OPEN_BRACKET"===u)c.type="BRACKET";else if("CLOSE_BRACKET"===u){let e=t.pop().text;if(t.length>0&&"NUMBER"===t[t.length-1].type){const r=t.pop().text;e=r+e,t[t.length-1].value=V(r)}if(0===t.length||"BRACKET"!==t[t.length-1].type)throw new Error("missing opening bracket");t[t.length-1].text+=e}}else if(a=s.match(er),a){if(c.text=a[1],o+=c.text.length,Jt.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(rr)){c.type="TYPE";continue}c.type="ID"}else{if(a=s.match(Xt),!a)throw new Error(`unexpected token ${JSON.stringify(s[0])} at position ${o}`);c.text=a[1],c.type="NUMBER",o+=c.text.length}}return new nr(t.map((e=>Object.freeze(e))))}function or(e,t){let r=[];for(const n in t.keys())e.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function sr(e,t){if(t.peekKeyword(Wt)){const r=t.pop().text;if(r!==e)throw new Error(`expected ${e}, got ${r}`)}return t.popType("ID")}function ar(e,t){const r=new Set;for(;;){const n=e.peekType("KEYWORD");if(null==n||t&&!t.has(n))break;if(e.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function cr(e){let t=ar(e,zt);return or(t,Ht("constant payable nonpayable".split(" "))),or(t,Ht("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function ur(e,t){return e.popParams().map((e=>_r.from(e,t)))}function lr(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return H(e.pop().text);throw new Error("invalid gas")}return null}function fr(e){if(e.length)throw new Error(`unexpected tokens: ${e.toString()}`)}const dr=new RegExp(/^(.*)\[([0-9]*)\]$/);function hr(e){const t=e.match(rr);if(w(t,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(t[2]){const r=parseInt(t[2]);w(0!==r&&r<=32,"invalid bytes length","type",e)}else if(t[3]){const r=parseInt(t[3]);w(0!==r&&r<=256&&r%8==0,"invalid numeric width","type",e)}return e}const pr={},gr=Symbol.for("_ethers_internal"),yr="_ParamTypeInternal",mr="_ErrorInternal",br="_EventInternal",vr="_ConstructorInternal",wr="_FallbackInternal",Ar="_FunctionInternal",Er="_StructInternal";class _r{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,r,n,i,o,s,a){if(S(e,pr,"ParamType"),Object.defineProperty(this,gr,{value:yr}),o&&(o=Object.freeze(o.slice())),"array"===n){if(null==s||null==a)throw new Error("")}else if(null!=s||null!=a)throw new Error("");if("tuple"===n){if(null==o)throw new Error("")}else if(null!=o)throw new Error("");p(this,{name:t,type:r,baseType:n,indexed:i,components:o,arrayLength:s,arrayChildren:a})}format(e){if(null==e&&(e="sighash"),"json"===e){const t=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=t,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const r={type:"tuple"===this.baseType?"tuple":this.type,name:t};return"boolean"==typeof this.indexed&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(r)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?("sighash"!==e&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join("full"===e?", ":",")+")"):t+=this.type,"sighash"!==e&&(!0===this.indexed&&(t+=" indexed"),"full"===e&&this.name&&(t+=" "+this.name)),t}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map((e=>r.arrayChildren.walk(e,t)))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map(((e,n)=>r.components[n].walk(e,t)))}return t(this.type,e)}#u(e,t,r,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const i=this.arrayChildren,o=t.slice();return o.forEach(((t,n)=>{i.#u(e,t,r,(e=>{o[n]=e}))})),void n(o)}if(this.isTuple()){const i=this.components;let o;if(Array.isArray(t))o=t.slice();else{if(null==t||"object"!=typeof t)throw new Error("invalid tuple value");o=i.map((e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in t))throw new Error(`missing value for component ${e.name}`);return t[e.name]}))}if(o.length!==this.components.length)throw new Error("array is wrong length");return o.forEach(((t,n)=>{i[n].#u(e,t,r,(e=>{o[n]=e}))})),void n(o)}const i=r(this.type,t);i.then?e.push(async function(){n(await i)}()):n(i)}async walkAsync(e,t){const r=[],n=[e];return this.#u(r,e,t,(e=>{n[0]=e})),r.length&&await Promise.all(r),n[0]}static from(e,t){if(_r.isParamType(e))return e;if("string"==typeof e)try{return _r.from(ir(e),t)}catch(t){w(!1,"invalid param type","obj",e)}else if(e instanceof nr){let r="",n="",i=null;ar(e,Ht(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(n="tuple",i=e.popParams().map((e=>_r.from(e))),r=`tuple(${i.map((e=>e.format())).join(",")})`):(r=hr(e.popType("TYPE")),n=r);let o=null,s=null;for(;e.length&&e.peekType("BRACKET");){const t=e.pop();o=new _r(pr,"",r,n,null,i,s,o),s=t.value,r+=t.text,n="array",i=null}let a=null;if(ar(e,Kt).has("indexed")){if(!t)throw new Error("");a=!0}const c=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new _r(pr,c,r,n,a,i,s,o)}const r=e.name;w(!r||"string"==typeof r&&r.match(tr),"invalid name","obj.name",r);let n=e.indexed;null!=n&&(w(t,"parameter cannot be indexed","obj.indexed",e.indexed),n=!!n);let i=e.type,o=i.match(dr);if(o){const t=parseInt(o[2]||"-1"),s=_r.from({type:o[1],components:e.components});return new _r(pr,r||"",i,"array",n,null,t,s)}if("tuple"===i||i.startsWith("tuple(")||i.startsWith("(")){const t=null!=e.components?e.components.map((e=>_r.from(e))):null;return new _r(pr,r||"",i,"tuple",n,t,null,null)}return i=hr(e.type),new _r(pr,r||"",i,i,n,null,null,null)}static isParamType(e){return e&&e[gr]===yr}}class Sr{type;inputs;constructor(e,t,r){S(e,pr,"Fragment"),p(this,{type:t,inputs:r=Object.freeze(r.slice())})}static from(e){if("string"==typeof e){try{Sr.from(JSON.parse(e))}catch(e){}return Sr.from(ir(e))}if(e instanceof nr)switch(e.peekKeyword(Wt)){case"constructor":return kr.from(e);case"error":return Pr.from(e);case"event":return Ir.from(e);case"fallback":case"receive":return Or.from(e);case"function":return Cr.from(e);case"struct":return Nr.from(e)}else if("object"==typeof e){switch(e.type){case"constructor":return kr.from(e);case"error":return Pr.from(e);case"event":return Ir.from(e);case"fallback":case"receive":return Or.from(e);case"function":return Cr.from(e);case"struct":return Nr.from(e)}v(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}w(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return kr.isFragment(e)}static isError(e){return Pr.isFragment(e)}static isEvent(e){return Ir.isFragment(e)}static isFunction(e){return Cr.isFragment(e)}static isStruct(e){return Nr.isFragment(e)}}class xr extends Sr{name;constructor(e,t,r,n){super(e,t,n),w("string"==typeof r&&r.match(tr),"invalid identifier","name",r),n=Object.freeze(n.slice()),p(this,{name:r})}}function Tr(e,t){return"("+t.map((t=>t.format(e))).join("full"===e?", ":",")+")"}class Pr extends xr{constructor(e,t,r){super(e,"error",t,r),Object.defineProperty(this,gr,{value:mr})}get selector(){return Zt(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("error"),t.push(this.name+Tr(e,this.inputs)),t.join(" ")}static from(e){if(Pr.isFragment(e))return e;if("string"==typeof e)return Pr.from(ir(e));if(e instanceof nr){const t=sr("error",e),r=ur(e);return fr(e),new Pr(pr,t,r)}return new Pr(pr,e.name,e.inputs?e.inputs.map(_r.from):[])}static isFragment(e){return e&&e[gr]===mr}}class Ir extends xr{anonymous;constructor(e,t,r,n){super(e,"event",t,r),Object.defineProperty(this,gr,{value:br}),p(this,{anonymous:n})}get topicHash(){return Zt(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("event"),t.push(this.name+Tr(e,this.inputs)),"sighash"!==e&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map((e=>_r.from(e))),new Ir(pr,e,t,!1).topicHash}static from(e){if(Ir.isFragment(e))return e;if("string"==typeof e)try{return Ir.from(ir(e))}catch(t){w(!1,"invalid event fragment","obj",e)}else if(e instanceof nr){const t=sr("event",e),r=ur(e,!0),n=!!ar(e,Ht(["anonymous"])).has("anonymous");return fr(e),new Ir(pr,t,r,n)}return new Ir(pr,e.name,e.inputs?e.inputs.map((e=>_r.from(e,!0))):[],!!e.anonymous)}static isFragment(e){return e&&e[gr]===br}}class kr extends Sr{payable;gas;constructor(e,t,r,n,i){super(e,t,r),Object.defineProperty(this,gr,{value:vr}),p(this,{payable:n,gas:i})}format(e){if(v(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});const t=[`constructor${Tr(e,this.inputs)}`];return t.push(this.payable?"payable":"nonpayable"),null!=this.gas&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(kr.isFragment(e))return e;if("string"==typeof e)try{return kr.from(ir(e))}catch(t){w(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof nr){ar(e,Ht(["constructor"]));const t=ur(e),r=!!ar(e,$t).has("payable"),n=lr(e);return fr(e),new kr(pr,"constructor",t,r,n)}return new kr(pr,"constructor",e.inputs?e.inputs.map(_r.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[gr]===vr}}class Or extends Sr{payable;constructor(e,t,r){super(e,"fallback",t),Object.defineProperty(this,gr,{value:wr}),p(this,{payable:r})}format(e){const t=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:e})}return`${t}()${this.payable?" payable":""}`}static from(e){if(Or.isFragment(e))return e;if("string"==typeof e)try{return Or.from(ir(e))}catch(t){w(!1,"invalid fallback fragment","obj",e)}else if(e instanceof nr){const t=e.toString();if(w(e.peekKeyword(Ht(["fallback","receive"])),"type must be fallback or receive","obj",t),"receive"===e.popKeyword(Ht(["fallback","receive"]))){const t=ur(e);return w(0===t.length,"receive cannot have arguments","obj.inputs",t),ar(e,Ht(["payable"])),fr(e),new Or(pr,[],!0)}let r=ur(e);r.length?w(1===r.length&&"bytes"===r[0].type,"invalid fallback inputs","obj.inputs",r.map((e=>e.format("minimal"))).join(", ")):r=[_r.from("bytes")];const n=cr(e);if(w("nonpayable"===n||"payable"===n,"fallback cannot be constants","obj.stateMutability",n),ar(e,Ht(["returns"])).has("returns")){const t=ur(e);w(1===t.length&&"bytes"===t[0].type,"invalid fallback outputs","obj.outputs",t.map((e=>e.format("minimal"))).join(", "))}return fr(e),new Or(pr,r,"payable"===n)}if("receive"===e.type)return new Or(pr,[],!0);if("fallback"===e.type){const t=[_r.from("bytes")],r="payable"===e.stateMutability;return new Or(pr,t,r)}w(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[gr]===wr}}class Cr extends xr{constant;outputs;stateMutability;payable;gas;constructor(e,t,r,n,i,o){super(e,"function",t,n),Object.defineProperty(this,gr,{value:Ar}),p(this,{constant:"view"===r||"pure"===r,gas:o,outputs:i=Object.freeze(i.slice()),payable:"payable"===r,stateMutability:r})}get selector(){return Zt(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});const t=[];return"sighash"!==e&&t.push("function"),t.push(this.name+Tr(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(Tr(e,this.outputs))),null!=this.gas&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map((e=>_r.from(e))),new Cr(pr,e,"view",t,[],null).selector}static from(e){if(Cr.isFragment(e))return e;if("string"==typeof e)try{return Cr.from(ir(e))}catch(t){w(!1,"invalid function fragment","obj",e)}else if(e instanceof nr){const t=sr("function",e),r=ur(e),n=cr(e);let i=[];ar(e,Ht(["returns"])).has("returns")&&(i=ur(e));const o=lr(e);return fr(e),new Cr(pr,t,n,r,i,o)}let t=e.stateMutability;return null==t&&(t="payable","boolean"==typeof e.constant?(t="view",e.constant||(t="payable","boolean"!=typeof e.payable||e.payable||(t="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(t="nonpayable")),new Cr(pr,e.name,t,e.inputs?e.inputs.map(_r.from):[],e.outputs?e.outputs.map(_r.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[gr]===Ar}}class Nr extends xr{constructor(e,t,r){super(e,"struct",t,r),Object.defineProperty(this,gr,{value:Er})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)try{return Nr.from(ir(e))}catch(t){w(!1,"invalid struct fragment","obj",e)}else if(e instanceof nr){const t=sr("struct",e),r=ur(e);return fr(e),new Nr(pr,t,r)}return new Nr(pr,e.name,e.inputs?e.inputs.map(_r.from):[])}static isFragment(e){return e&&e[gr]===Er}}const Rr=new Map;Rr.set(0,"GENERIC_PANIC"),Rr.set(1,"ASSERT_FALSE"),Rr.set(17,"OVERFLOW"),Rr.set(18,"DIVIDE_BY_ZERO"),Rr.set(33,"ENUM_RANGE_ERROR"),Rr.set(34,"BAD_STORAGE_DATA"),Rr.set(49,"STACK_UNDERFLOW"),Rr.set(50,"ARRAY_RANGE_ERROR"),Rr.set(65,"OUT_OF_MEMORY"),Rr.set(81,"UNINITIALIZED_FUNCTION_CALL");const Br=new RegExp(/^bytes([0-9]*)$/),Mr=new RegExp(/^(u?int)([0-9]*)$/);let Lr=null;class Fr{#l(e){if(e.isArray())return new St(this.#l(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Dt(e.components.map((e=>this.#l(e))),e.name);switch(e.baseType){case"address":return new wt(e.name);case"bool":return new xt(e.name);case"string":return new Ut(e.name);case"bytes":return new Pt(e.name);case"":return new Ot(e.name)}let t=e.type.match(Mr);if(t){let r=parseInt(t[2]||"256");return w(0!==r&&r<=256&&r%8==0,"invalid "+t[1]+" bit length","param",e),new Bt(r/8,"int"===t[1],e.name)}if(t=e.type.match(Br),t){let r=parseInt(t[1]);return w(0!==r&&r<=32,"invalid bytes length","param",e),new It(r,e.name)}w(!1,"invalid type","type",e.type)}getDefaultValue(e){const t=e.map((e=>this.#l(_r.from(e))));return new Dt(t,"_").defaultValue()}encode(e,t){A(t.length,e.length,"types/values length mismatch");const r=e.map((e=>this.#l(_r.from(e)))),n=new Dt(r,"_"),i=new ie;return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this.#l(_r.from(e))));return new Dt(n,"_").decode(new oe(t,r))}static defaultAbiCoder(){return null==Lr&&(Lr=new Fr),Lr}static getBuiltinCallException(e,t,r){return function(e,t,r,n){let i="missing revert data",o=null,s=null;if(r){i="execution reverted";const e=T(r);if(r=C(r),0===e.length)i+=" (no data present; likely require(false) occurred",o="require(false)";else if(e.length%32!=4)i+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===C(e.slice(0,4)))try{o=n.decode(["string"],e.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[o]},i+=`: ${JSON.stringify(o)}`}catch(e){i+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===C(e.slice(0,4)))try{const t=Number(n.decode(["uint256"],e.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[t]},o=`Panic due to ${Rr.get(t)||"UNKNOWN"}(${t})`,i+=`: ${o}`}catch(e){i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const a={to:t.to?pt(t.to):null,data:t.data||"0x"};return t.from&&(a.from=pt(t.from)),b(i,"CALL_EXCEPTION",{action:e,data:r,reason:o,transaction:a,invocation:null,revert:s})}(e,t,r,Fr.defaultAbiCoder())}}function jr(e){return e&&"function"==typeof e.getAddress}async function Ur(e,t){const r=await t;return null!=r&&"0x0000000000000000000000000000000000000000"!==r||(v("string"!=typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),w(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),pt(r)}function Dr(e,t){return"string"==typeof e?e.match(/^0x[0-9a-f]{40}$/i)?pt(e):(v(null!=t,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Ur(e,t.resolveName(e))):jr(e)?Ur(e,e.getAddress()):e&&"function"==typeof e.then?Ur(e,e):void w(!1,"unsupported addressable value","target",e)}const Zr=new Uint8Array(32);Zr.fill(0);const Hr=BigInt(-1),$r=BigInt(0),Gr=BigInt(1),zr=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Vr=W(Gr,32),Wr=W($r,32),qr={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Kr=["name","version","chainId","verifyingContract","salt"];function Jr(e){return function(t){return w("string"==typeof t,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const Yr={name:Jr("name"),version:Jr("version"),chainId:function(e){const t=H(e,"domain.chainId");return w(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):K(t)},verifyingContract:function(e){try{return pt(e).toLowerCase()}catch(e){}w(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=T(e,"domain.salt");return w(32===t.length,'invalid domain value "salt"',"domain.salt",e),C(t)}};function Qr(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");w(n%8==0&&0!==n&&n<=256&&(null==t[2]||t[2]===String(n)),"invalid numeric width","type",e);const i=Z(zr,r?n-1:n),o=r?(i+Gr)*Hr:$r;return function(t){const n=H(t,"value");return w(n>=o&&n<=i,`value out-of-bounds for ${e}`,"value",n),W(r?D(n,256):n,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return w(0!==r&&r<=32&&t[1]===String(r),"invalid bytes width","type",e),function(t){return w(T(t).length===r,`invalid length for ${e}`,"value",t),function(e){const t=T(e),r=t.length%32;return r?N([t,Zr.slice(r)]):C(t)}(t)}}}switch(e){case"address":return function(e){return L(pt(e),32)};case"bool":return function(e){return e?Vr:Wr};case"bytes":return function(e){return at(e)};case"string":return function(e){return Zt(e)}}return null}function Xr(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class en{primaryType;#f;get types(){return JSON.parse(this.#f)}#d;#h;constructor(e){this.#f=JSON.stringify(e),this.#d=new Map,this.#h=new Map;const t=new Map,r=new Map,n=new Map;Object.keys(e).forEach((e=>{t.set(e,new Set),r.set(e,[]),n.set(e,new Set)}));for(const n in e){const i=new Set;for(const o of e[n]){w(!i.has(o.name),`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i.add(o.name);const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;w(s!==n,`circular type reference to ${JSON.stringify(s)}`,"types",e),Qr(s)||(w(r.has(s),`unknown type ${JSON.stringify(s)}`,"types",e),r.get(s).push(n),t.get(n).add(s))}}const i=Array.from(r.keys()).filter((e=>0===r.get(e).length));w(0!==i.length,"missing primary type","types",e),w(1===i.length,`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),p(this,{primaryType:i[0]}),function i(o,s){w(!s.has(o),`circular type reference to ${JSON.stringify(o)}`,"types",e),s.add(o);for(const e of t.get(o))if(r.has(e)){i(e,s);for(const t of s)n.get(t).add(e)}s.delete(o)}(this.primaryType,new Set);for(const[t,r]of n){const n=Array.from(r);n.sort(),this.#d.set(t,Xr(t,e[t])+n.map((t=>Xr(t,e[t]))).join(""))}}getEncoder(e){let t=this.#h.get(e);return t||(t=this.#p(e),this.#h.set(e,t)),t}#p(e){{const t=Qr(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e);return n=>{w(!t[3]||parseInt(t[3])===n.length,`array length mismatch; expected length ${parseInt(t[3])}`,"value",n);let i=n.map(r);return this.#d.has(e)&&(i=i.map(at)),at(N(i))}}const r=this.types[e];if(r){const t=Zt(this.#d.get(e));return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this.#d.has(r)?at(n):n}));return n.unshift(t),N(n)}}w(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#d.get(e);return w(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return at(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(Qr(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n)return w(!n[3]||parseInt(n[3])===t.length,`array length mismatch; expected length ${parseInt(n[3])}`,"value",t),t.map((e=>this._visit(n[1],e,r)));const i=this.types[e];if(i)return i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{});w(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new en(e)}static getPrimaryType(e){return en.from(e).primaryType}static hashStruct(e,t,r){return en.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){if(null==e[r])continue;const n=qr[r];w(n,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>Kr.indexOf(e.name)-Kr.indexOf(t.name))),en.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return N(["0x1901",en.hashDomain(e),en.from(t).hash(r)])}static hash(e,t,r){return at(en.encode(e,t,r))}static async resolveNames(e,t,r,n){e=Object.assign({},e);for(const t in e)null==e[t]&&delete e[t];const i={};e.verifyingContract&&!I(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=en.from(t);o.visit(r,((e,t)=>("address"!==e||I(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=await n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),{domain:e,value:r=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t))}}static getPayload(e,t,r){en.hashDomain(e);const n={},i=[];Kr.forEach((t=>{const r=e[t];null!=r&&(n[t]=Yr[t](r),i.push({name:t,type:qr[t]}))}));const o=en.from(t),s=Object.assign({},t);return w(null==s.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",t),s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return C(T(t));if(e.match(/^u?int/))return H(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return w("string"==typeof t,"invalid string","value",t),t}w(!1,"unsupported type","type",e)}))}}}function tn(e,t){return{address:pt(e),storageKeys:t.map(((e,t)=>(w(I(e,32),"invalid slot",`storageKeys[${t}]`,e),e.toLowerCase())))}}function rn(e){if(Array.isArray(e))return e.map(((t,r)=>Array.isArray(t)?(w(2===t.length,"invalid slot set",`value[${r}]`,t),tn(t[0],t[1])):(w(null!=t&&"object"==typeof t,"invalid address-slot set","value",e),tn(t.address,t.storageKeys))));w(null!=e&&"object"==typeof e,"invalid access list","value",e);const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return tn(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}const nn="0x0000000000000000000000000000000000000000";class on{fragment;name;signature;topic;args;constructor(e,t,r){const n=e.name,i=e.format();p(this,{fragment:e,name:n,signature:i,topic:t,args:r})}}class sn{fragment;name;args;signature;selector;value;constructor(e,t,r,n){const i=e.name,o=e.format();p(this,{fragment:e,name:i,args:r,signature:o,selector:t,value:n})}}class an{fragment;name;args;signature;selector;constructor(e,t,r){const n=e.name,i=e.format();p(this,{fragment:e,name:n,args:r,signature:i,selector:t})}}class cn{hash;_isIndexed;static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){p(this,{hash:e,_isIndexed:!0})}}const un={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},ln={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&un[e.toString()]&&(t=un[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}};class fn{fragments;deploy;fallback;receive;#g;#y;#m;#b;constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,this.#m=new Map,this.#g=new Map,this.#y=new Map;const r=[];for(const e of t)try{r.push(Sr.from(e))}catch(e){console.log("EE",e)}p(this,{fragments:Object.freeze(r)});let n=null,i=!1;this.#b=this.getAbiCoder(),this.fragments.forEach(((e,t)=>{let r;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void p(this,{deploy:e});case"fallback":return void(0===e.inputs.length?i=!0:(w(!n||e.payable!==n.payable,"conflicting fallback fragments",`fragments[${t}]`,e),n=e,i=n.payable));case"function":r=this.#m;break;case"event":r=this.#y;break;case"error":r=this.#g;break;default:return}const o=e.format();r.has(o)||r.set(o,e)})),this.deploy||p(this,{deploy:kr.from("constructor()")}),p(this,{fallback:n,receive:i})}format(e){const t=e?"minimal":"full",r=this.fragments.map((e=>e.format(t)));return r}formatJson(){const e=this.fragments.map((e=>e.format("json")));return JSON.stringify(e.map((e=>JSON.parse(e))))}getAbiCoder(){return Fr.defaultAbiCoder()}#v(e,t,r){if(I(e)){const t=e.toLowerCase();for(const e of this.#m.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#m)t.split("(")[0]===e&&n.push(r);if(t){const e=t.length>0?t[t.length-1]:null;let r=t.length,i=!0;vt.isTyped(e)&&"overrides"===e.type&&(i=!1,r--);for(let e=n.length-1;e>=0;e--){const t=n[e].inputs.length;t===r||i&&t===r-1||n.splice(e,1)}for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let i=0;i<t.length;i++)if(vt.isTyped(t[i])){if(i>=r.length){if("overrides"===t[i].type)continue;n.splice(e,1);break}if(t[i].type!==r[i].baseType){n.splice(e,1);break}}}}if(1===n.length&&t&&t.length!==n[0].inputs.length){const e=t[t.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&n.splice(0,1)}return 0===n.length?null:(n.length>1&&r&&w(!1,`ambiguous function description (i.e. matches ${n.map((e=>JSON.stringify(e.format()))).join(", ")})`,"key",e),n[0])}return this.#m.get(Cr.from(e).format())||null}getFunctionName(e){const t=this.#v(e,null,!1);return w(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#v(e,null,!1)}getFunction(e,t){return this.#v(e,t||null,!0)}forEachFunction(e){const t=Array.from(this.#m.keys());t.sort(((e,t)=>e.localeCompare(t)));for(let r=0;r<t.length;r++){const n=t[r];e(this.#m.get(n),r)}}#w(e,t,r){if(I(e)){const t=e.toLowerCase();for(const e of this.#y.values())if(t===e.topicHash)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#y)t.split("(")[0]===e&&n.push(r);if(t){for(let e=n.length-1;e>=0;e--)n[e].inputs.length<t.length&&n.splice(e,1);for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let i=0;i<t.length;i++)if(vt.isTyped(t[i])&&t[i].type!==r[i].baseType){n.splice(e,1);break}}}return 0===n.length?null:(n.length>1&&r&&w(!1,`ambiguous event description (i.e. matches ${n.map((e=>JSON.stringify(e.format()))).join(", ")})`,"key",e),n[0])}return this.#y.get(Ir.from(e).format())||null}getEventName(e){const t=this.#w(e,null,!1);return w(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#w(e,null,!1)}getEvent(e,t){return this.#w(e,t||null,!0)}forEachEvent(e){const t=Array.from(this.#y.keys());t.sort(((e,t)=>e.localeCompare(t)));for(let r=0;r<t.length;r++){const n=t[r];e(this.#y.get(n),r)}}getError(e,t){if(I(e)){const t=e.toLowerCase();if(ln[t])return Pr.from(ln[t].signature);for(const e of this.#g.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const t=[];for(const[r,n]of this.#g)r.split("(")[0]===e&&t.push(n);return 0===t.length?"Error"===e?Pr.from("error Error(string)"):"Panic"===e?Pr.from("error Panic(uint256)"):null:(t.length>1&&w(!1,`ambiguous error description (i.e. ${t.map((e=>JSON.stringify(e.format()))).join(", ")})`,"name",e),t[0])}if("Error(string)"===(e=Pr.from(e).format()))return Pr.from("error Error(string)");if("Panic(uint256)"===e)return Pr.from("error Panic(uint256)");return this.#g.get(e)||null}forEachError(e){const t=Array.from(this.#g.keys());t.sort(((e,t)=>e.localeCompare(t)));for(let r=0;r<t.length;r++){const n=t[r];e(this.#g.get(n),r)}}_decodeParams(e,t){return this.#b.decode(e,t)}_encodeParams(e,t){return this.#b.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);w(t,"unknown error","fragment",e),e=t}return w(B(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,B(t,4))}encodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);w(t,"unknown error","fragment",e),e=t}return N([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);w(t,"unknown function","fragment",e),e=t}return w(B(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,B(t,4))}encodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);w(t,"unknown function","fragment",e),e=t}return N([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);w(t,"unknown function","fragment",e),e=t}let r="invalid length for result data";const n=P(t);if(n.length%32==0)try{return this.#b.decode(e.outputs,n)}catch(e){r="could not decode result data"}v(!1,r,"BAD_DATA",{value:C(n),info:{method:e.name,signature:e.format()}})}makeError(e,t){const r=T(e,"data"),n=Fr.getBuiltinCallException("call",t,r);if(n.message.startsWith("execution reverted (unknown custom error)")){const e=C(r.slice(0,4)),t=this.getError(e);if(t)try{const e=this.#b.decode(t.inputs,r.slice(4));n.revert={name:t.name,signature:t.format(),args:e},n.reason=n.revert.signature,n.message=`execution reverted: ${n.reason}`}catch(e){n.message="execution reverted (coult not decode custom error)"}}const i=this.parseTransaction(t);return i&&(n.invocation={method:i.name,signature:i.signature,args:i.args}),n}encodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);w(t,"unknown function","fragment",e),e=t}return C(this.#b.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if("string"==typeof e){const t=this.getEvent(e);w(t,"unknown event","eventFragment",e),e=t}v(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const r=[];e.anonymous||r.push(e.topicHash);const n=(e,t)=>"string"===e.type?Zt(t):"bytes"===e.type?at(C(t)):("bool"===e.type&&"boolean"==typeof t?t=t?"0x01":"0x00":e.type.match(/^u?int/)?t=W(t):e.type.match(/^bytes/)?t=M(t,32,!1):"address"===e.type&&this.#b.encode(["address"],[t]),L(C(t),32));for(t.forEach(((t,i)=>{const o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?w(!1,"filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):w(null==t,"cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){if("string"==typeof e){const t=this.getEvent(e);w(t,"unknown event","eventFragment",e),e=t}const r=[],n=[],i=[];return e.anonymous||r.push(e.topicHash),w(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const s=t[o];if(e.indexed)if("string"===e.type)r.push(Zt(s));else if("bytes"===e.type)r.push(at(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this.#b.encode([e.type],[s]))}else n.push(e),i.push(s)})),{data:this.#b.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e){const t=this.getEvent(e);w(t,"unknown event","eventFragment",e),e=t}if(null!=r&&!e.anonymous){const t=e.topicHash;w(I(r[0],32)&&r[0].toLowerCase()===t,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const n=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(_r.from({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));const s=null!=r?this.#b.decode(n,N(r)):null,a=this.#b.decode(i,t,!0),c=[],u=[];let l=0,f=0;return e.inputs.forEach(((e,t)=>{let r=null;if(e.indexed)if(null==s)r=new cn(null);else if(o[t])r=new cn(s[f++]);else try{r=s[f++]}catch(e){r=e}else try{r=a[l++]}catch(e){r=e}c.push(r),u.push(e.name||null)})),te.fromItems(c,u)}parseTransaction(e){const t=T(e.data,"tx.data"),r=H(null!=e.value?e.value:0,"tx.value"),n=this.getFunction(C(t.slice(0,4)));if(!n)return null;const i=this.#b.decode(n.inputs,t.slice(4));return new sn(n,n.selector,i,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new on(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=C(e),r=this.getError(B(t,0,4));if(!r)return null;const n=this.#b.decode(r.inputs,B(t,4));return new an(r,r.selector,n)}static from(e){return e instanceof fn?e:"string"==typeof e?new fn(JSON.parse(e)):"function"==typeof e.format?new fn(e.format("json")):new fn(e)}}const dn=BigInt(0);function hn(e){return null==e?null:e}function pn(e){return null==e?null:e.toString()}class gn{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,r){p(this,{gasPrice:hn(e),maxFeePerGas:hn(t),maxPriorityFeePerGas:hn(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:pn(e),maxFeePerGas:pn(t),maxPriorityFeePerGas:pn(r)}}}function yn(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=C(e.data));const r="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const n of r)n in e&&null!=e[n]&&(t[n]=H(e[n],`request.${n}`));const n="type,nonce".split(/,/);for(const r of n)r in e&&null!=e[r]&&(t[r]=V(e[r],`request.${r}`));return e.accessList&&(t.accessList=rn(e.accessList)),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),t}class mn{provider;number;hash;timestamp;parentHash;nonce;difficulty;gasLimit;gasUsed;miner;extraData;baseFeePerGas;#A;constructor(e,t){this.#A=e.transactions.map((e=>"string"!=typeof e?new wn(e,t):e)),p(this,{provider:t,hash:hn(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:hn(e.baseFeePerGas)})}get transactions(){return this.#A.map((e=>"string"==typeof e?e:e.hash))}get prefetchedTransactions(){const e=this.#A.slice();return 0===e.length?[]:(v("object"==typeof e[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:r,gasLimit:n,gasUsed:i,hash:o,miner:s,nonce:a,number:c,parentHash:u,timestamp:l,transactions:f}=this;return{_type:"Block",baseFeePerGas:pn(e),difficulty:pn(t),extraData:r,gasLimit:pn(n),gasUsed:pn(i),hash:o,miner:s,nonce:a,number:c,parentHash:u,timestamp:l,transactions:f}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#A.length}get date(){return null==this.timestamp?null:new Date(1e3*this.timestamp)}async getTransaction(e){let t;if("number"==typeof e)t=this.#A[e];else{const r=e.toLowerCase();for(const e of this.#A){if("string"==typeof e){if(e!==r)continue;t=e;break}if(e.hash!==r){t=e;break}}}if(null==t)throw new Error("no such tx");return"string"==typeof t?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){const t=this.prefetchedTransactions;if("number"==typeof e)return t[e];e=e.toLowerCase();for(const r of t)if(r.hash===e)return r;w(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return{orphan:"drop-block",hash:this.hash,number:this.number}}}class bn{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;const r=Object.freeze(e.topics.slice());p(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:r,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:t,blockNumber:r,data:n,index:i,removed:o,topics:s,transactionHash:a,transactionIndex:c}=this;return{_type:"log",address:e,blockHash:t,blockNumber:r,data:n,index:i,removed:o,topics:s,transactionHash:a,transactionIndex:c}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return v(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return v(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return v(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return{orphan:"drop-log",log:{transactionHash:(e=this).transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,address:e.address,data:e.data,topics:Object.freeze(e.topics.slice()),index:e.index}};var e}}class vn{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;cumulativeGasUsed;gasPrice;type;status;root;#E;constructor(e,t){this.#E=Object.freeze(e.logs.map((e=>new bn(e,t))));let r=dn;null!=e.effectiveGasPrice?r=e.effectiveGasPrice:null!=e.gasPrice&&(r=e.gasPrice),p(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:r,type:e.type,status:e.status,root:e.root})}get logs(){return this.#E}toJSON(){const{to:e,from:t,contractAddress:r,hash:n,index:i,blockHash:o,blockNumber:s,logsBloom:a,logs:c,status:u,root:l}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:pn(this.cumulativeGasUsed),from:t,gasPrice:pn(this.gasPrice),gasUsed:pn(this.gasUsed),hash:n,index:i,logs:c,logsBloom:a,root:l,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(null==e)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(null==e)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return En(this)}reorderedEvent(e){return v(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),An(this,e)}}class wn{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;data;value;chainId;signature;accessList;#_;constructor(e,t){this.provider=t,this.blockNumber=null!=e.blockNumber?e.blockNumber:null,this.blockHash=null!=e.blockHash?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=null!=e.maxPriorityFeePerGas?e.maxPriorityFeePerGas:null,this.maxFeePerGas=null!=e.maxFeePerGas?e.maxFeePerGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=null!=e.accessList?e.accessList:null,this.#_=-1}toJSON(){const{blockNumber:e,blockHash:t,index:r,hash:n,type:i,to:o,from:s,nonce:a,data:c,signature:u,accessList:l}=this;return{_type:"TransactionReceipt",accessList:l,blockNumber:e,blockHash:t,chainId:pn(this.chainId),data:c,from:s,gasLimit:pn(this.gasLimit),gasPrice:pn(this.gasPrice),hash:n,maxFeePerGas:pn(this.maxFeePerGas),maxPriorityFeePerGas:pn(this.maxPriorityFeePerGas),nonce:a,signature:u,to:o,index:r,type:i,value:pn(this.value)}}async getBlock(){let e=this.blockNumber;if(null==e){const t=await this.getTransaction();t&&(e=t.blockNumber)}if(null==e)return null;const t=this.provider.getBlock(e);if(null==t)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(null==this.blockNumber){const{tx:e,blockNumber:t}=await h({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return null==e||null==e.blockNumber?0:t-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){const r=null==e?1:e,n=null==t?0:t;let i=this.#_,o=-1,s=-1===i;const a=async()=>{if(s)return null;const{blockNumber:e,nonce:t}=await h({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(t<this.nonce)return void(i=e);if(s)return null;const n=await this.getTransaction();if(!n||null==n.blockNumber)for(-1===o&&(o=i-3,o<this.#_&&(o=this.#_));o<=e;){if(s)return null;const t=await this.provider.getBlock(o,!0);if(null==t)return;for(const e of t)if(e===this.hash)return;for(let n=0;n<t.length;n++){const o=await t.getTransaction(n);if(o.from===this.from&&o.nonce===this.nonce){if(s)return null;const t=await this.provider.getTransactionReceipt(o.hash);if(null==t)return;if(e-t.blockNumber+1<r)return;let n="replaced";o.data===this.data&&o.to===this.to&&o.value===this.value?n="repriced":"0x"===o.data&&o.from===o.to&&o.value===dn&&(n="cancelled"),v(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:"replaced"===n||"cancelled"===n,reason:n,replacement:o.replaceableTransaction(i),hash:o.hash,receipt:t})}}o++}},c=e=>{if(null==e||0!==e.status)return e;v(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:e.to,from:e.from,data:""},receipt:e})},u=await this.provider.getTransactionReceipt(this.hash);if(0===r)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await a(),0===r)return null;const l=new Promise(((e,t)=>{const o=[],u=()=>{o.forEach((e=>e()))};if(o.push((()=>{s=!0})),n>0){const e=setTimeout((()=>{u(),t(b("wait for transaction timeout","TIMEOUT"))}),n);o.push((()=>{clearTimeout(e)}))}const l=async n=>{if(await n.confirmations()>=r){u();try{e(c(n))}catch(e){t(e)}}};if(o.push((()=>{this.provider.off(this.hash,l)})),this.provider.on(this.hash,l),i>=0){const e=async()=>{try{await a()}catch(e){if(y(e,"TRANSACTION_REPLACED"))return u(),void t(e)}s||this.provider.once("block",e)};o.push((()=>{this.provider.off("block",e)})),this.provider.once("block",e)}}));return await l}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}removedEvent(){return v(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),En(this)}reorderedEvent(e){return v(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),v(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),An(this,e)}replaceableTransaction(e){w(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new wn(this,this.provider);return t.#_=e,t}}function An(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function En(e){return{orphan:"drop-transaction",tx:e}}class _n{filter;emitter;#S;constructor(e,t,r){this.#S=t,p(this,{emitter:e,filter:r})}async removeListener(){null!=this.#S&&await this.emitter.off(this.filter,this.#S)}}class Sn extends bn{interface;fragment;args;constructor(e,t,r){super(e,e.provider),p(this,{args:t.decodeEventLog(r,e.data,e.topics),fragment:r,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class xn extends bn{error;constructor(e,t){super(e,e.provider),p(this,{error:t})}}class Tn extends vn{#x;constructor(e,t,r){super(r,t),this.#x=e}get logs(){return super.logs.map((e=>{const t=e.topics.length?this.#x.getEvent(e.topics[0]):null;if(t)try{return new Sn(e,this.#x,t)}catch(t){return new xn(e,t)}return e}))}}class Pn extends wn{#x;constructor(e,t,r){super(r,t),this.#x=e}async wait(e){const t=await super.wait(e);return null==t?null:new Tn(this.#x,this.provider,t)}}class In extends _n{log;constructor(e,t,r,n){super(e,t,r),p(this,{log:n})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class kn extends In{constructor(e,t,r,n,i){super(e,t,r,new Sn(i,e.interface,n)),p(this,{args:e.interface.decodeEventLog(n,this.log.data,this.log.topics),fragment:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const On=BigInt(0);function Cn(e){return e&&"function"==typeof e.call}function Nn(e){return e&&"function"==typeof e.estimateGas}function Rn(e){return e&&"function"==typeof e.resolveName}function Bn(e){return e&&"function"==typeof e.sendTransaction}class Mn{#T;fragment;constructor(e,t,r){if(p(this,{fragment:t}),t.inputs.length<r.length)throw new Error("too many arguments");const n=Ln(e.runner,"resolveName"),i=Rn(n)?n:null;this.#T=async function(){const n=await Promise.all(t.inputs.map(((e,t)=>null==r[t]?null:e.walkAsync(r[t],((e,t)=>"address"===e?Array.isArray(t)?Promise.all(t.map((e=>Dr(e,i)))):Dr(t,i):t)))));return e.interface.encodeFilterTopics(t,n)}()}getTopicFilter(){return this.#T}}function Ln(e,t){return null==e?null:"function"==typeof e[t]?e:e.provider&&"function"==typeof e.provider[t]?e.provider:null}function Fn(e){return null==e?null:e.provider||null}async function jn(e,t){const r=vt.dereference(e,"overrides");w("object"==typeof r,"invalid overrides parameter","overrides",e);const n=yn(r);return w(null==n.to||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),w(null==n.data||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=await Dr(n.from)),n}function Un(e){const t=async function(t){const r=await jn(t,["data"]);r.to=await e.getAddress();const n=e.interface,i=H(r.value||On,"overrides.value")===On,o="0x"===(r.data||"0x");return!n.fallback||n.fallback.payable||!n.receive||o||i||w(!1,"cannot send data to receive or send value to non-payable fallback","overrides",t),w(n.fallback||o,"cannot send data to receive-only contract","overrides.data",r.data),w(n.receive||n.fallback&&n.fallback.payable||i,"cannot send value to non-payable fallback","overrides.value",r.value),w(n.fallback||o,"cannot send data to receive-only contract","overrides.data",r.data),r},r=async function(r){const n=e.runner;v(Bn(n),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const i=await n.sendTransaction(await t(r)),o=Fn(e.runner);return new Pn(e.interface,o,i)},n=async e=>await r(e);return p(n,{_contract:e,estimateGas:async function(r){const n=Ln(e.runner,"estimateGas");return v(Nn(n),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await n.estimateGas(await t(r))},populateTransaction:t,send:r,staticCall:async function(r){const n=Ln(e.runner,"call");v(Cn(n),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const i=await t(r);try{return await n.call(i)}catch(t){if(m(t)&&t.data)throw e.interface.makeError(t.data,i);throw t}}}),n}const Dn=Symbol.for("_ethersInternal_contract"),Zn=new WeakMap;function Hn(e){return Zn.get(e[Dn])}async function $n(e,t){let r,n=null;if(Array.isArray(t)){const n=function(t){if(I(t,32))return t;const r=e.interface.getEvent(t);return w(r,"unknown fragment","name",t),r.topicHash};r=t.map((e=>null==e?null:Array.isArray(e)?e.map(n):n(e)))}else"*"===t?r=[null]:"string"==typeof t?I(t,32)?r=[t]:(n=e.interface.getEvent(t),w(n,"unknown fragment","event",t),r=[n.topicHash]):(i=t)&&"object"==typeof i&&"getTopicFilter"in i&&"function"==typeof i.getTopicFilter&&i.fragment?r=await t.getTopicFilter():"fragment"in t?(n=t.fragment,r=[n.topicHash]):w(!1,"unknown event name","event",t);var i;return r=r.map((e=>{if(null==e)return null;if(Array.isArray(e)){const t=Array.from(new Set(e.map((e=>e.toLowerCase()))).values());return 1===t.length?t[0]:(t.sort(),t)}return e.toLowerCase()})),{fragment:n,tag:r.map((e=>null==e?"null":Array.isArray(e)?e.join("|"):e)).join("&"),topics:r}}async function Gn(e,t){const{subs:r}=Hn(e);return r.get((await $n(e,t)).tag)||null}async function zn(e,t,r){const n=Fn(e.runner);v(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:i,tag:o,topics:s}=await $n(e,r),{addr:a,subs:c}=Hn(e);let u=c.get(o);if(!u){const t={address:a||e,topics:s},l=t=>{let n=i;if(null==n)try{n=e.interface.getEvent(t.topics[0])}catch(e){}if(n){const o=n,s=i?e.interface.decodeEventLog(i,t.data,t.topics):[];Wn(e,r,s,(n=>new kn(e,n,r,o,t)))}else Wn(e,r,[],(n=>new In(e,n,r,t)))};let f=[];u={tag:o,listeners:[],start:()=>{f.length||f.push(n.on(t,l))},stop:async()=>{if(0==f.length)return;let e=f;f=[],await Promise.all(e),n.off(t,l)}},c.set(o,u)}return u}let Vn=Promise.resolve();async function Wn(e,t,r,n){try{await Vn}catch(e){}const i=async function(e,t,r,n){await Vn;const i=await Gn(e,t);if(!i)return!1;const o=i.listeners.length;return i.listeners=i.listeners.filter((({listener:t,once:i})=>{const o=Array.from(r);n&&o.push(n(i?null:t));try{t.call(e,...o)}catch(e){}return!i})),0===i.listeners.length&&(i.stop(),Hn(e).subs.delete(i.tag)),o>0}(e,t,r,n);return Vn=i,await i}const qn=["then"];class Kn{target;interface;runner;filters;[Dn];fallback;constructor(e,t,r,n){w("string"==typeof e||jr(e),"invalid value for Contract target","target",e),null==r&&(r=null);const i=fn.from(t);let o;p(this,{target:e,runner:r,interface:i}),Object.defineProperty(this,Dn,{value:{}});let s=null,a=null;if(n){const e=Fn(r);a=new Pn(this.interface,e,n)}let c=new Map;if("string"==typeof e)if(I(e))s=e,o=Promise.resolve(e);else{const t=Ln(r,"resolveName");if(!Rn(t))throw b("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=t.resolveName(e).then((t=>{if(null==t)throw b("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Hn(this).addr=t,t}))}else o=e.getAddress().then((e=>{if(null==e)throw new Error("TODO");return Hn(this).addr=e,e}));var u;u={addrPromise:o,addr:s,deployTx:a,subs:c},Zn.set(this[Dn],u);const l=new Proxy({},{get:(e,t,r)=>{if("symbol"==typeof t||qn.indexOf(t)>=0)return Reflect.get(e,t,r);try{return this.getEvent(t)}catch(e){if(!y(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,t)=>qn.indexOf(t)>=0?Reflect.has(e,t):Reflect.has(e,t)||this.interface.hasEvent(String(t))});return p(this,{filters:l}),p(this,{fallback:i.receive||i.fallback?Un(this):null}),new Proxy(this,{get:(e,t,r)=>{if("symbol"==typeof t||t in e||qn.indexOf(t)>=0)return Reflect.get(e,t,r);try{return e.getFunction(t)}catch(e){if(!y(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,t)=>"symbol"==typeof t||t in e||qn.indexOf(t)>=0?Reflect.has(e,t):e.interface.hasFunction(t)})}connect(e){return new Kn(this.target,this.interface,e)}attach(e){return new Kn(e,this.interface,this.runner)}async getAddress(){return await Hn(this).addrPromise}async getDeployedCode(){const e=Fn(this.runner);v(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return"0x"===t?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(null!=await this.getDeployedCode())return this;const t=Fn(this.runner);return v(null!=t,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise(((e,r)=>{const n=async()=>{try{if(null!=await this.getDeployedCode())return e(this);t.once("block",n)}catch(e){r(e)}};n()}))}deploymentTransaction(){return Hn(this).deployTx}getFunction(e){return"string"!=typeof e&&(e=e.format()),function(e,t){const r=function(...r){const n=e.interface.getFunction(t,r);return v(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),n},n=async function(...t){const n=r(...t);let i={};if(n.inputs.length+1===t.length&&(i=await jn(t.pop())),n.inputs.length!==t.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const o=await async function(e,t,r){const n=Ln(e,"resolveName"),i=Rn(n)?n:null;return await Promise.all(t.map(((e,t)=>e.walkAsync(r[t],((e,t)=>(t=vt.dereference(t,e),"address"===e?Dr(t,i):t))))))}(e.runner,n.inputs,t);return Object.assign({},i,await h({to:e.getAddress(),data:e.interface.encodeFunctionData(n,o)}))},i=async function(...e){const t=await s(...e);return 1===t.length?t[0]:t},o=async function(...t){const r=e.runner;v(Bn(r),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const i=await r.sendTransaction(await n(...t)),o=Fn(e.runner);return new Pn(e.interface,o,i)},s=async function(...t){const i=Ln(e.runner,"call");v(Cn(i),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const o=await n(...t);let s="0x";try{s=await i.call(o)}catch(t){if(m(t)&&t.data)throw e.interface.makeError(t.data,o);throw t}const a=r(...t);return e.interface.decodeFunctionResult(a,s)},a=async(...e)=>r(...e).constant?await i(...e):await o(...e);return p(a,{name:e.interface.getFunctionName(t),_contract:e,_key:t,getFragment:r,estimateGas:async function(...t){const r=Ln(e.runner,"estimateGas");return v(Nn(r),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await r.estimateGas(await n(...t))},populateTransaction:n,send:o,staticCall:i,staticCallResult:s}),Object.defineProperty(a,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=e.interface.getFunction(t);return v(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),a}(this,e)}getEvent(e){return"string"!=typeof e&&(e=e.format()),function(e,t){const r=function(...r){const n=e.interface.getEvent(t,r);return v(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),n},n=function(...t){return new Mn(e,r(...t),t)};return p(n,{name:e.interface.getEventName(t),_contract:e,_key:t,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=e.interface.getEvent(t);return v(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),n}(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,r){null==t&&(t=0),null==r&&(r="latest");const{addr:n,addrPromise:i}=Hn(this),o=n||await i,{fragment:s,topics:a}=await $n(this,e),c={address:o,topics:a,fromBlock:t,toBlock:r},u=Fn(this.runner);return v(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map((e=>{let t=s;if(null==t)try{t=this.interface.getEvent(e.topics[0])}catch(e){}if(t)try{return new Sn(e,this.interface,t)}catch(t){return new xn(e,t)}return new bn(e,u)}))}async on(e,t){const r=await zn(this,"on",e);return r.listeners.push({listener:t,once:!1}),r.start(),this}async once(e,t){const r=await zn(this,"once",e);return r.listeners.push({listener:t,once:!0}),r.start(),this}async emit(e,...t){return await Wn(this,e,t,null)}async listenerCount(e){if(e){const t=await Gn(this,e);return t?t.listeners.length:0}const{subs:t}=Hn(this);let r=0;for(const{listeners:e}of t.values())r+=e.length;return r}async listeners(e){if(e){const t=await Gn(this,e);return t?t.listeners.map((({listener:e})=>e)):[]}const{subs:t}=Hn(this);let r=[];for(const{listeners:e}of t.values())r=r.concat(e.map((({listener:e})=>e)));return r}async off(e,t){const r=await Gn(this,e);if(!r)return this;if(t){const e=r.listeners.map((({listener:e})=>e)).indexOf(t);e>=0&&r.listeners.splice(e,1)}return null!=t&&0!==r.listeners.length||(r.stop(),Hn(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const t=await Gn(this,e);if(!t)return this;t.stop(),Hn(this).subs.delete(t.tag)}else{const{subs:e}=Hn(this);for(const{tag:t,stop:r}of e.values())r(),e.delete(t)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){return class extends Kn{constructor(t,r=null){super(t,e,r)}}}static from(e,t,r){return null==r&&(r=null),new this(e,t,r)}}class Jn extends(function(){return Kn}()){}function Yn(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e<n;e++)o.push(i+=r());let s=r(),a=t;t+=s;let c=0,u=0;function l(){return 0==c&&(u=u<<8|e[t++],c=8),u>>--c&1}const f=2**31,d=f>>>1,h=f-1;let p=0;for(let e=0;e<31;e++)p=p<<1|l();let g=[],y=0,m=f;for(;;){let e=Math.floor(((p-y+1)*i-1)/m),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<o[n]?r=n:t=n}if(0==t)break;g.push(t);let s=y+Math.floor(m*o[t]/i),a=y+Math.floor(m*o[t+1]/i)-1;for(;0==((s^a)&d);)p=p<<1&h|l(),s=s<<1&h,a=a<<1&h|1;for(;s&~a&536870912;)p=p&d|p<<1&h>>>1|l(),s=s<<1^d,a=(a^d)<<1|d|1;y=s,m=1+a-s}let b=n-4;return g.map((t=>{switch(t-b){case 3:return b+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return b+256+(e[a++]<<8|e[a++]);case 1:return b+e[a++];default:return t-1}}))}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach(((e,r)=>t[e.charCodeAt(0)]=r));let r=e.length,n=new Uint8Array(6*r>>3);for(let i=0,o=0,s=0,a=0;i<r;i++)a=a<<6|t[e.charCodeAt(i)],s+=6,s>=8&&(n[o++]=a>>(s-=8));return n}(e)))}function Qn(e){return 1&e?~e>>1:e>>1}function Xn(e,t){let r=Array(e);for(let n=0,i=0;n<e;n++)r[n]=i+=Qn(t());return r}function ei(e,t=0){let r=[];for(;;){let n=e(),i=e();if(!i)break;t+=n;for(let e=0;e<i;e++)r.push(t+e);t+=i+1}return r}function ti(e){return ni((()=>{let t=ei(e);if(t.length)return t}))}function ri(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(oi(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(si(r,e))}return t.flat()}function ni(e){let t=[];for(;;){let r=e(t.length);if(!r)break;t.push(r)}return t}function ii(e,t,r){let n=Array(e).fill().map((()=>[]));for(let i=0;i<t;i++)Xn(e,r).forEach(((e,t)=>n[t].push(e)));return n}function oi(e,t){let r=1+t(),n=t(),i=ni(t);return ii(i.length,1+e,t).flatMap(((e,t)=>{let[o,...s]=e;return Array(i[t]).fill().map(((e,t)=>{let i=t*n;return[o+t*r,s.map((e=>e+i))]}))}))}function si(e,t){return ii(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}var ai=Yn("AEgSbwjEDVYByQKaAQsBOQDpATQAngDUAHsAoABoANQAagCNAEQAhABMAHIAOwA9ACsANgAmAGIAHgAvACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGAAeABMAFwAXAA0ADgAWAA8AFAAVBFsF1QEXE0o3xAXUALIArkABaACmAgPGAK6AMDAwMAE/qAYK7P4HQAblMgVYBVkAPSw5Afa3EgfJwgAPA8meNALGCjACjqIChtk/j2+KAsXMAoPzASDgCgDyrgFCAi6OCkCQAOQA4woWABjVuskNDD6eBBx4AP4COhi+D+wKBirqBgSCaA0cBy4ArABqku+mnIAAXAaUJAbqABwAPAyUFvyp/Mo8INAIvCoDshQ8APcubKQAon4ZABgEJtgXAR4AuhnOBPsKIE04CZgJiR8cVlpM5INDABQADQAWAA9sVQAiAA8ASO8W2T30OVnKluYvChEeX05ZPe0AFAANABYAD2wgXUCYAMPsABwAOgzGFryp/AHauQVcBeMC0KACxLEKTR2kZhR0Gm5M9gC8DmgC4gAMLjSKF8qSAoF8ARMcAL4OaALiAAwuAUlQJpJMCwMt/AUpCthqGK4B2EQAciwSeAIyFiIDKCi6OGwAOuIB9iYAyA7MtgEcZIIAsgYABgCK1EoFHNZsGACoKNIBogAAAAAAKy4DnABoAQoaPu43dQQZGACrAcgCIgDgLBJ0OvRQsTOiKDVJBfsoBVoFWbC5BWo7XkITO1hCmHuUZmCh+QwUA8YIJvJ4JASkTAJUVAJ2HKwoAZCkpjZcA0YYBIRiCgDSBqxAMCQHKgI6XgBsAWIgcgCEHhoAlgFKuAAoahgBsMYDOC4iRFQBcFoGZgJmAPJKGAMqAgYASkIArABeAHQALLYGCPTwGo6AAAAKIgAqALQcSAHSAdwIDDKXeYHpAAsAEgA1AD4AOTR3etTBEGAQXQJNCkxtOxUMAq0PpwvmERYM0irM09kANKoH7ANUB+wDVANUB+wH7ANUB+wDVANUA1QDVBwL8BvUwRBgD0kEbgWPBYwE1wiEJkoRggcpCNNUDnQfHEgDRgD9IyZJHTuUMwwlQ0wNTQQH/TZDbKh9OQNIMaxU9pCjA8wyUDltAh5yEqEAKw90HTW2Tn96SHGhCkxPr7WASWNOaAK/Oqk/+QoiCZRvvHdPBj4QGCeiEPQMMAGyATgN6kvVBO4GOATGH3oZFg/KlZkIoi3aDOom4C6egFcj8iqABepL8TzaC0pRZQ9WC2IJ4DpggUsDHgEKIogK2g02CGoQ8ArGaA3iEUIHNgPSSZcAogb+Cw4dMhWyJg1iqQsGOXQG+BrzC4wmrBMmevkF0BoeBkoBJhr8AMwu5IWtWi5cGU9cBgALIiPEFKVQHQ0iQLR4RRoYBxIlpgKOQ21KhFEzHpAh8zw6DWMuEFF5B/I8AhlMC348m0aoRQsRzz6KPUUiRkwpBDJ8LCwniAnMD4IMtnxvAVYJHgmuDG4TLhEUN8IINgcWKpchJxIIHkaSYJcE9JwD8BPOAwgFPAk+BxADshwqEysVJgUKgSHUAvA20i6wAoxWfQEUBcgPIh/cEE1H3Q7mCJgCYgOAJegAKhUeABQimAhAYABcj9VTAi7ICMRqaSNxA2QU5F4RcAeODlQHpBwwFbwc3nDFXgiGBSigrAlYAXIJlgFcBOAIBjVYjJ0gPmdQi1UYmCBeQTxd+QIuDGIVnES6h3UCiA9oEhgBMgFwBzYM/gJ0EeoRaBCSCOiGATWyM/U6IgRMIYAgDgokA0xsywskJvYM9WYBoBJfAwk0OnfrZ6hgsyEX+gcWMsJBXSHuC49PygyZGr4YP1QrGeEHvAPwGvAn50FUBfwDoAAQOkoz6wS6C2YIiAk8AEYOoBQH1BhnCm6MzQEuiAG0lgNUjoACbIwGNAcIAGQIhAV24gAaAqQIoAACAMwDVAA2AqoHmgAWAII+AToDJCwBHuICjAOQCC7IAZIsAfAmBBjADBIA9DRuRwLDrgKAZ2afBdpVAosCRjIBSiIEAktETgOsbt4A2ABIBhDcRAESqEfIF+BAAdxsKADEAPgAAjIHAj4BygHwagC0AVwLLgmfsLIBSuYmAIAAEmgB1AKGANoAMgB87gFQAEoFVvYF0AJMRgEOLhUoVF4BuAMcATABCgB2BsiKosYEHARqB9ACEBgV3gLvKweyAyLcE8pCwgK921IAMhMKNQqkCqNgWF0wAy5vPU0ACx+lPsQ/SwVOO1A7VTtQO1U7UDtVO1A7VTtQO1UDlLzfvN8KaV9CYegMow3RRMU6RhPYYE5gLxPFLbQUvhXLJVMZOhq5JwIl4VUGDwEt0GYtCCk0che5ADwpZYM+Y4MeLQpIHORTjlT1LRgArkufM6wNqRsSRD0FRHXqYicWCwofAmR+AmI/WEqsWDcdAqH0AmiVAmYGAp+BOBgIAmY4AmYjBGsEfAN/EAN+jzkDOXQUOX86ICACbBoCMjM4BwJtxAJtq+yHMGRCKAFkANsA3gBHAgeVDIoA+wi/AAqyAncsAnafPAJ5SEACeLcaWdhFq0bwAnw8AnrFAn0GAnztR/1IemAhACgSSVVKWBIUSskC0P4C0MlLJAOITAOH40TCkS8C8p5dAAMDq0vLTCoiAMxNSU2sAos8AorVvhgEGkBkArQCjjQCjlk9lH4CjtYCjll1UbFTMgdS0VSCApP4ApMJAOYAGVUbVaxVzQMsGCmSgzLeeGNFODYCl5wC769YHqUAViIClowClnmZAKZZqVoGfkoAOAKWsgKWS1xBXM4CmcgCmWFcx10EFgKcmDm/OpoCnBMCn5gCnrWHABoMLicMAp3uAp6PALI6YTFh7AKe0AKgawGmAp6cHAKeS6JjxWQkIigCJ6wCJnsCoPgCoEnUAqYsAqXLAqf8AHoCp+9oeWiuAABGahlqzgKs4AKsqwKtZAKs/wJXGgJV2QKx3tQDH0tslAKyugoCsuUUbN1tYG1FXAMlygK2WTg8bo0DKUICuFsCuUQSArkndHAzcN4CvRYDLa8DMg4CvoVx/wMzbgK+F3Mfc0wCw8gCwwFzf3RIMkJ03QM8pAM8lwM9vALFeQLGRALGDYYCyGZOAshBAslMAskrAmSaAt3PeHZeeKt5IkvNAxigZv8CYfEZ8JUhewhej164DgLPaALPaSxIUM/wEJwAw6oCz3ABJucDTg9+SAIC3CQC24cC0kwDUlkDU1wA/gNViYCGPMgT6l1CcoLLg4oC2sQC2duEDYRGpzkDhqIALANkC4ZuVvYAUgLfYgLetXB0AuIs7REB8y0kAfSYAfLPhALr8ALpbXYC6vYC6uEA9kQBtgLuhgLrmZanlwAC7jwDhd2YdnDdcZ4C8wAAZgOOE5mQAvcQA5FrA5KEAveVAvnWAvhjmhmaqLg0mxsDnYAC/vcBGAA2nxmfsAMFigOmZwOm1gDOwgMGZ6GFogIGAwxGAQwBHAdqBl62ZAIAuARovA6IHrAKABRyNgAgAzASSgOGfAFgJB4AjOwAHgDmoAScjgi0BhygwgCoBRK86h4+PxZ5BWk4P0EsQiJCtV9yEl+9AJbGBTMAkE0am7o7J2AzErrQDjAYxxiKyfcFWAVZBVgFWQVkBVkFWAVZBVgFWQVYBVkFWAVZRxYI2IZoAwMDCmVe6iwEygOyBjC8vAC8BKi8AOhBKhazBUc+aj5xQkBCt192OF/pAFgSM6wAjP/MbMv9puhGez4nJAUsFyg3Nn5u32vB8hnDLGoBbNdvMRgFYAVrycLJuQjQSlwBAQEKfV5+jL8AND+CAAQW0gbmriQGAIzEDAMCDgDlZh4+JSBLQrJCvUI5JF8oYDcoOSQJwj4KRT9EPnk+gj5xPnICikK9SkM8X8xPUGtOCy1sVTBrDG8gX+E0OxwJaJwKYyQsPR4nQqxCvSzMAsv9X8oPIC8KCQoAACN+nt9rOy5LGMmsya0JZsLMzQphQWAP5hCkEgCTjh5GQiYbqm06zjkKND9EPnFCQBwICx5NSG1cLS5a4rwTCn7uHixCQBxeCUsKDzRVREM4BTtEnC0KghwuQkAb9glUIyQZMTIBBo9i8F8KcmTKYAxgLiRvAERgGjoDHB9gtAcDbBFmT2BOEgIAZOhgFmCWYH5gtGBMYJJpFhgGtg/cVqq8WwtDF6wBvCzOwgMgFgEdBB8BegJtMDGWU4EBiwq5SBsA5SR0jwvLDqdN6wGcAoidUAVBYAD4AD4LATUXWHsMpg0lILuwSABQDTUAFhO4NVUC0wxLZhEcANlPBnYECx9bADIAtwKbKAsWcKwzOaAaAVwBhwn9A9ruEAarBksGugAey1aqWwq7YhOKCy1ADrwBvAEjA0hbKSkpIR8gIi0TJwciDY4AVQJvWJFKlgJvIA9ySAHUdRDPUiEaqrFN6wcSBU1gAPgAPgsBewAHJW0LiAymOTEuyLBXDgwAYL0MAGRKaFAiIhzAADIAtwKbKC08D88CkRh8ULxYyXRzjtilnA72mhU+G+0S2hIHDxwByAk7EJQGESwNNwwAPAC0zwEDAKUA4gCbizAAFQBcG8cvbXcrDsIRAzwlRNTiHR8MG34CfATCC6vxbQA4Oi4Opzkuz6IdB7wKABA7Ls8SGgB9rNsdD7wbSBzOoncfAT4qYB0C7KAJBE3z5R9mDL0M+wg9Cj8ABcELPgJMDbwIvQ09CT0KvS7PoisOvAaYAhwPjBriBBwLvBY8AKELPBC8BRihe90AO2wMPQACpwm9BRzR9QYFB2/LBnwAB7wSXBISvQECAOsCAAB1FVwHFswV/HAXvBg8AC68AuyovAAevAJWISuAAAG8AALkFT0VvCvso7zJqDwEAp8nTAACXADn3hm8CaVcD7/FAPUafAiiBQv/cQDfvKe8GNwavKOMeXMG/KmchAASvAcbDAADlABtvAcAC7ynPAIaPLsIopzLDvwHwak8AOF8L7dtvwNJAAPsABW8AAb8AAm8AGmMABq8AA68Axi8jmoV/AABXAAObAAuTB8ABrwAF7wIIgANSwC6vCcAA7wADpwq7ACyWwAcHAAbvAAB7AqiAAXHCxYV3AAHnABCvAEDAGm8AAt8AB28AAi8CaIABcsAbqAZ1gCSCCIABcsAATwAB9wAHZwIIgAGmwAJfAAbLABtHADmvIEACFwACDwAFLwAaPwJIgAGywDjjAAJPAuiDsX7YAAHPABunUBJAEgACrwFAAM8AAmuAzgABxwAGXwAAgym/AAKHAAKPAAJ/KfsBrwACRwAAwwAEDwBABQ8ABFsAA+MAA3sAA28ABkMBxYcABU8AG6cFrQBvAC7ABM8BABpLAsA4UwAAjwABFMAF3wFHAAG0QAYvB8BfClTADpGALAJBw4McwApK3EBpQYIXwJtJA0ACghwTG1gK4oggRVjLjcDogq1AALZABcC/ARvAXdzSFMVIgNQAhY/AS0GBHRHvnxTe0EAKgAyAvwAVAvcAHyRLQEsAHfmDhIzRwJLAFgGAAJRAQiLzQB5PAQhpgBbANcWAJZpOCCMAM5ssgDQ1RcJw3Z0HBlXHgrSAYmRrCNUVE5JEz3DivoAgB04QSos4RKYUABzASosMSlDGhADMVYE+MbvAExm3QBrAnICQBF7Osh4LzXWBhETIAUVCK6v/xPNACYAAQIbAIYAiQCONgDjALQA1QCdPQC7AKsApgChAOcAnwDTAJwA4AEBAPwAwAB6AFsAywDNAPwA1wDrAIkAogEqAOMA2ADVBAIIKzTT09PTtb/bzM/NQjEWAUsBVS5GAVMBYgFhAVQBRUpCRGcMAUwUBgkEMzcMBwAgDSQmKCs3OTk8PDw9Pg0/HVBQUFBSUlFSKFNUVlVVHFxgYF9hYCNlZ29ucXFxcXFxc3Nzc3Nzc3Nzc3N1dXZ1dFsAPesAQgCTAHEAKwBf8QCHAFAAUAAwAm/oAIT+8fEAXQCM6wCYAEgAWwBd+PipAH4AfgBiAE8AqgAdAK8AfAI5AjwA9QDgAPcA9wDhAPgA4gDiAOEA3wAoAnQBSgE5ATcBTQE3ATcBNwEyATEBMQExARUBURAAKgkBAEwYCxcEFhcPAIcAjwCfAEoAYxkCKgBvAGgAkAMOAyArAxpCP0gqAIoCSADAAlACnQC5Ao8CjwKPAo8CjwKPAoQCjwKPAo8CjwKPAo8CjgKOApECmQKQAo8CjwKNAo0CjQKNAosCjgJuAc0CkAKYAo8CjwKOF3oMAPcGA5gCWgIzGAFNETYC2xILLBQBRzgUTpIBdKU9AWJaAP4DOkgA/wCSKh4ZkGsAKmEAagAvAIoDlcyM8K+FWwa7LA/DEgKe1nUrCwQkWwGzAN5/gYB/gX+Cg4N/hIeFf4aJh4GIg4mDin+Lf4x/jYuOf49/kIORf5J/k3+Uf5WElomXg5h/AIMloQCEBDwEOQQ7BD4EPARCBD8EOgRABEIEQQQ9BD8EQgCkA4gAylIA0AINAPdbAPcBGgD3APUA9QD2APXVhSRmvwD3APUA9QD2APUdAIpbAPcAigEaAPcAigLtAPcAitWFJGa/HQD4WwEaAPcA9wD1APUA9gD1APgA9QD1APYA9dWFJGa/HQCKWwEaAPcAigD3AIoC7QD3AIrVhSRmvx0CRAE3AksBOgJMwgOfAu0Dn9WFJGa/HQCKWwEaA58AigOfAIoC7QOfAIrVhSRmvx0EMQCKBDIAigeOMm4hLQCKAT9vBCQA/gDHWwMAVVv/FDMDAIoDPtkASgMAigMAl2dBtv/TrfLzakaPh3aztmIuZQrR3ER2n5Yo+qNR2jK/aP/V04UK1njIJXLgkab9PjOxyJDVbIN3R/FZLoZVl2kYFQIZ7V6LpRqGDt9OdDohnJKp5yX/HLj0voPpLrneDaN11t5W3sSM4ALscgSw8fyWLVkKa/cNcQmjYOgTLZUgOLi2F05g4TR0RfgZ4PBdntxdV3qvdxQt8DeaMMgjJMgwUxYN3tUNpUNx21AvwADDAIa0+raTWaoBXmShAl5AThpMi282o+WzOKMlxjHj7a+DI6AM6VI9w+xyh3Eyg/1XvPmbqjeg2MGXugHt8wW03DQMRTd5iqqOhjLvyOCcKtViGwAHVLyl86KqvxVX7MxSW8HLq6KCrLpB8SspAOHO9IuOwCh9poLoMEha9CHCxlRAXJNDobducWjqhFHqCkzjTM2V9CHslwq4iU19IxqhIFZMve15lDTiMVZIPdADXGxTqzSTv0dDWyk1ht430yvaYCy9qY0MQ3cC5c1uw4mHcTGkMHTAGC99TkNXFAiLQgw9ZWhwKJjGCe+J5FIaMpYhhyUnEgfrF3zEtzn40DdgCIJUJfZ0mo3eXsDwneJ8AYCr7Vx2eHFnt2H6ZEyAHs9JoQ4Lzh5zBoGOGwAz37NOPuqSNmZf51hBEovtpm2T1wI79OBWDyvCFYkONqAKGVYgIL0F+uxTcMLSPtFbiNDbBPFgip8MGDmLLHbSyGXdCMO6f7teiW9EEmorZ+75KzanZwvUySgjoUQBTfHlOIerJs6Y9wLlgDw18AB1ne0tZRNgGjcrqHbtubSUooEpy4hWpDzTSrmvqw0H9AoXQLolMt9eOM+l9RitBB1OBnrdC1XL4yLFyXqZSgZhv7FnnDEXLUeffb4nVDqYTLY6X7gHVaK4ZZlepja2Oe6OhLDI/Ve5SQTCmJdH3HJeb14cw99XsBQAlDy5s5kil2sGezZA3tFok2IsNja7QuFgM30Hff3NGSsSVFYZLOcTBOvlPx8vLhjJrSI7xrNMA/BOzpBIJrdR1+v+zw4RZ7ry6aq4/tFfvPQxQCPDsXlcRvIZYl+E5g3kJ+zLMZon0yElBvEOQTh6SaAdIO6BwdqJqfvgU+e8Y65FQhdiHkZMVt9/39N2jGd26J6cNjq8cQIyp6RonRPgVn2fl89uRDcQ27GacaN0MPrcNyRlbUWelKfDfyrNVVGBG5sjd3jXzTx06ywyzuWn5jbvEfPPCTbpClkgEu9oPLKICxU5HuDe3jA1XnvU85IYYhaEtOU1YVWYhEFsa4/TQj3rHdsU2da2eVbF8YjSI0m619/8bLMZu3xildwqM7zf1cjn4Whx0PSYXcY5bR7wEQfGC7CTOXwZdmsdTO8q3uGm7Rh/RfCWwpzBHCAaVfjxgibL5vUeL0pH6bzDmI9yCXKC/okkmbc28OJvI87L/bjFzpq0DHepw4kT1Od+fL7cyuFaRgfaUWB2++TCFvz11J0leEtrGkpccfX9z2LY39sph4PBHCjNOOkd0ybUm+ZzS8GkFbqMpq8uiX2yHpa0jllTLfGTDBMYR6FT5FWLLDPMkYxt1Q0eyMvxJWztDjy0m6VvZPvamrFXjHmPpU6WxrZqH6WW//I37RwvqPQhPz8I3RPuXAk1C94ZprQWm9iGM/KgiGDO6SV9sjp+Jmk4TBajMNJ5zzWZ1k1jrteQQBp9C2dOvmbIeeEME8y573Q8TgGe+ZCzutM45gYLBzYm2LNvgq2kebAbMpHRDSyh6dQ27GbsAAdCqQVVXWC1C+zpwBM2Lr4eqtobmmu1vJEDlIQR1iN8CUWpztq50z7FFQBn3SKViX6wSqzVQCoYvAjByjeSa+h1PRnYWvBinTDB9cHt4eqDsPS4jcD3FwXJKT0RQsl8EvslI2SFaz2OtmYLFV8FwgvWroZ3fKmh7btewX9tfL2upXsrsqpLJzpzNGyNlnuZyetg7DIOxQTMBR7dqlrTlZ6FWi1g4j1NSjA2j1Yd7fzTH6k9LxCyUCneAKYCU581bnvKih6KJTeTeCX4Zhme/QIz7w2o+AdSgtLAkdrLS9nfweYEqrMLsrGGSWXtgWamAWp6+x6GM/Z8jNw3BqPNQ39hrzYLECn3tPvh/LqKbRSCiDGauDKBBj/kGbpnM1Bb/my8hv4NWStclkwjfl57y4oNDgw1JAG9VOti3QVVoSziMEsSdfEjaCPIDb7SgpLXykQsM+nbqbt97I0mIlzWv0uqFobLMAq8Rd9pszUBKxFhBPwOjf//gVOz2r7URJ2OnpviCXv9iz3a4X/YLBYbXoYwxBv/Kq0a5s4utQHzoTerJ7PmFW/no/ZAsid/hRIV82tD+Qabh5F1ssIM8Ri3chu0PuPD3sSJRMjDoxLAbwUbroiPAz/V52e8s3DIixxlO7OrvhMj3qfzA0kKxzwicr5wJmZwJxTXgrwYsqhRvpgC2Nfdyd+TYYxJSZgk+gk2g9KyHSlwQVAyPtWWgvVGyVBqsU2LpDlLNosSAtolC1uBKt5pQZLhAxTjeGCWIC/HVpagc5rRwkgpCHKEsjA8d+scp8aiMewwQBhp5dYTV5t/Nvl+HbDMu8F3S0psPyZb1bSnqlHPFUnMQeQqSqwDBT23fJO9gO3aVaa1icrXU0PKwlMM5K+iL3ATcVq2fFWKk0irCTF4LDVDG4gUpkyplq6efcZS+WDR1woApjD18x+2JQR9oOXzuA7uy4b+/91WsJd/tSd1QcAH8PVPXApieA37B7YXPhDPH1azP3PKR+HfHmOoDYLeuKsIi/ssSsdYs62qJo14Hw1P2N/6zpr8F3FTWmJ4ysAVcl84Iv/tl///Z8FaAWbBQbyMNDZjrZ2JwdRjtd1jOeNumSodFtr4/Zf45iRJf/8HSW+KIB/+GlKu8Rv1BPLr/4duoL+kFPRqrstEr41gfJupoJRf4hcYDWX93FOcfEBiIivxtjtV8g7mvOReiamYWKE7vfPbv3v2L9Kwq3cIDFGLyhyfOGuf/9vA5muH6Pjg7B4SUj2ydDXra9fSBI+DrsNHA6l51wfHssJb+11TfNk7B8OleUe3Y+ZmHboMFHdv7FFP2cfISFyeAQR0sk/Xv62HBTdW4HmnGSLFk/cqyWVVFJkdIIa+4hos3JRHcqLoRKM5h2Qtk1RZtzISMtlXTfTqIc77YsCCgQD0r61jtxskCctwJOtjE/pL8wC4LBD4AZFjh2wzzFCrT/PNqW0/DeBbkfMfzVm9yy06WiF+1mTdNNEAytVtohBKg3brWd2VQa+aF+cQ0mW5CvbwOlWCT07liX226PjiVLwFCRs/Ax2/u+ZNPjrNFIWIPf5GjHyUKp60OeXe9F01f7IaPf/SDTvyDAf7LSWWejtiZcsqtWZjrdn6A2MqBwnSeKhrZOlUMmgMionmiCIvXqKZfmhGZ1MwD3uMF4n9KJcfWLA3cL5pq48tm5NDYNh3SS/TKUtmFSlQR89MR4+kxcqJgpGbhm9gXneDELkyqAN5nitmIzTscKeJRXqd64RiaOALR2d295NWwbjHRNG2AU5oR9OS2oJg/5CY6BFPc1JvD2Mxdhp2/MZdI8dLePxiP4KRIp8VXmqfg+jqd/RNG7GNuq1U2SiI4735Bdc0MVFx6mH5UOWEa5HuhYykd6t4M1gYLVS8m1B+9bUqi5DziQq7qT8d94cxB6AB4WqMCOF/zPPtRSZUUaMSsvHOWxGASufywTX8ogy6HgUf9p+Z30wUEosl8qgmwm6o2AV6nO9HKQjRHpN6SUegI5pvR61RLnUJ1lqCtmfcsRQutEizVpAaPXN7xMp5UQ5OSZK6tniCK9CpyMd7LjR6+MxfoMEDPpWdf2p2m5N3KO4QMxf+V7vGdYjemQczQ+m2MGIkFNYDMf0Yop2eSx81sP36WHUczqEhKysp2iJSYAvfgJjinKwToPvRKb+HBi+7cJ96S5ngfLOXaHAFRLkulo4TnXTFO51gX0TCCo4ZUHdbpdgkMEwUZAPjh6M+hA8DzycbtxAgH3uD6i0nN1aTiIuQ4BYCE9dEHHwAmINU+4YEWx4EC3OZwFGfYZMPLScVlb+BAAJeARUh+gdWA3/gRqCrf1jecgqeFf1MdzrrP4SVlGm5mMihSP+zYYksAB7O+SBPwNQqSNMiLnkviY/klwgcRmvqtCqeWeA0gjuir4CMZqmw/ntP6M+l0pdN8/P9xI53aP7x/zavJbbKOz8VzO/nXxIr1tjparMnqd6iWdByHKw4lF4p/u57Yv07WeZPDnRl7wgmDVZZ44fQsjdYO/gmXQ+940PRGst8UMQApFC4OOV22e4N+lVOPyFLAOj4t8R3PFw/FjbSWy0ELuAFReNkee8ORcBOT2NPDcs7OfpUmzvn/F9Czk9o9naMyVYy/j8I5qVFmQDFcptBp65J/+sJA3w/j6y/eqUkKxTsf0CZjtNdRSBEmJ2tmfgmJbqpcsSagk+Ul9qdyV+NnqFBIJZFCB1XwPvWGDBOjVUmpWGHsWA5uDuMgLUNKZ4vlq5qfzY1LnRhCc/mh5/EX+hzuGdDy5aYYx4BAdwTTeZHcZpl3X0YyuxZFWNE6wFNppYs3LcFJePOyfKZ8KYb7dmRyvDOcORLPH0sytC6mH1US3JVj6paYM1GEr+CUmyHRnabHPqLlh6Kl0/BWd3ebziDfvpRQpPoR7N+LkUeYWtQ6Rn5v5+NtNeBPs2+DKDlzEVR5aYbTVPrZekJsZ9UC9qtVcP99thVIt1GREnN8zXP8mBfzS+wKYym8fcW6KqrE702Zco+hFQAEIR7qimo7dd7wO8B7R+QZPTuCWm1UAwblDTyURSbd85P4Pz+wBpQyGPeEpsEvxxIZkKsyfSOUcfE3UqzMFwZKYijb7sOkzpou+tC4bPXey5GI1GUAg9c3vLwIwAhcdPHRsYvpAfzkZHWY20vWxxJO0lvKfj6sG2g/pJ1vd/X2EBZkyEjLN4nUZOpOO7MewyHCrxQK8d5aF7rCeQlFX+XksK6l6z971BPuJqwdjj68ULOj9ZTDdOLopMdOLL0PFSS792SXE/EC9EDnIXZGYhr52aQb+9b2zEdBSnpkxAdBUkwJDqGCpZk/HkRidjdp0zKv/Cm52EenmfeKX6HkLUJgMbTTxxIZkIeL/6xuAaAAHbA7mONVduTHNX/UJj1nJEaI7f3HlUyiqKn7VfBE+bdb4HWln1HPJx001Ulq1tOxFf8WZEARvq5Da1+pE7fPVxLntGACz3nkoLsKcPdUqdCwwiyWkmXTd5+bv3j7HaReRt3ESn783Ew3SWsvkEjKtbocNksbrLmV+GVZn1+Uneo35MT1/4r8fngQX5/ptORfgmWfF6KSB/ssJmUSijXxQqUpzkANEkSkYgYj560OOjJr6uqckFuO15TRNgABEwNDjus1V3q2huLPYERMCLXUNmJJpbMrUQsSO7Qnxta55TvPWL6gWmMOvFknqETzqzFVO8SVkovEdYatypLGmDy9VWfgAc0KyIChiOhbd7UlbAeVLPZyEDp4POXKBwN/KP5pT6Cyqs6yaI00vXMn1ubk9OWT9Q/O2t/C25qlnO/zO0xcBzpMBCAB8vsdsh3U8fnPX1XlPEWfaYJxKVaTUgfCESWl4CCkIyjE6iQ5JFcwU6S4/IH0/Agacp8d5Gzq2+GzPnJ7+sqk40mfFQpKrDbAKwLlr3ONEati2k/ycLMSUu7V/7BBkDlNyXoN9tvqXCbbMc4SSQXgC/DBUY9QjtrCtQ+susEomCq8xcNJNNMWCH31GtlTw2BdCXkJBjT+/QNWlBWwQ5SWCh1LdQ99QVii/DyTxjSR6rmdap3l3L3aiplQpPYlrzNm9er88fXd2+ao+YdUNjtqmxiVxmyYPzJxl67OokDcTezEGqldkGgPbRdXA+fGcuZVkembZByo7J1dMnkGNjwwCny+FNcVcWvWYL9mg8oF7jACVWI3bA64EXpdM8bSIEVIAs5JJH+LHXgnCsgcMGPZyAAVBncvbLiexzg9YozcytjPXVlAbQAC7Tc4S0C8QN4LlAGjj4pQAVWrwkaDoUYGxxvkCWKRRHkdzJB5zpREleBDL1oDKEvAqmkDibVC4kTqF89YO6laUjgtJPebBfzr16tg4t10GmN1sJ5vezk2sUOq8blCn5mPZyT3ltaDcddKupQjqusNM9wtFVD0ABzv17fZDn7GPT1nkCtdcgYejcK1qOcTGtPxnCX1rErEjVWCnEJv5HaOAUjgpiKQjUKkQi64D5g2COgwas8FcgIl0Pw95H9dWxE3QG0VbMNffh6BPlAojLDf4es2/5Xfq7hw5NGcON2g8Qsy2UQm94KddKyy3kdJxWgpNaEc15xcylbLC3vnT26u8qS90qc2MU8LdOJc5VPF5KnSpXIhnj1eJJ/jszjZ01oR6JDFJRoeTPO/wh4IPFbdG9KljuSzeuI92p8JF/bpgDE8wG86/W2EBKgPrmzdLijxssQn8mM44ky/KLGOJcrSwXIpZa/Z3v7W6HCRk7ewds99LTsUW1LbeJytw8Q/BFZVZyfO9BUHOCe2suuEkO8DU4fLX0IQSQ2TdOkKXDtPf3sNV9tYhYFueuPRhfQlEEy+aYM/MCz7diDNmFSswYYlZZPmKr2Q5AxLsSVEqqBtn6hVl1BCFOFExnqnIsmyY/NA8jXnDaNzr7Zv3hu+I1Mf/PJjk0gALN2G8ABzdf9FNvWHvZHhv6xIoDCXf964MxG92vGZtx/LYU5PeZqgly8tT5tGeQGeJzMMsJc5p+a5Rn2PtEhiRzo/5Owjy1n0Lzx3ev8GHQmeWb8vagG6O5Qk5nrZuQTiKODI4UqL0LLAusS2Ve7j1Ivdxquu1BR9Rc4QkOiUPwQXJv6du2E8i5pDhVoQpUhyMWGUT2O2YODIhjAfI71gxep5r5zAY7GBUZpy51hAw0pcCCrhOmU8Wp6ujQTdZQsCjtq6SHX8QAMNiPCIIkoxhHEZPgsBcOlP4aErJZPhF7qvx6gHrn8hEwPwYbx8YmT/n7lbcmTip1v8kgsrIjFTAlvLY4Nuil0KDmgz3svYs0ZJ3O3Is/vSx4xpxF1e2VAtZE8dJxGYEIhCSuPvCjP54l/NSNDnwlKvAW8mG+AQkgp7a87Igh26uKMFGD0PoPHTSvoWxiHuk+su8XkQiHIjeYKl/RdcOHpxhQH3zHCNE3aARm83Bl6zGxU/vMltlVPQhubcqhW4RYkl6uXk5JdP/QpzaKFpw2M8zvysv2qj7xaQECuu2akM0Cssj/uB9+wDR7uA6XOnLNaoczalHoMj33eiiu+DRaFsUmlmUZuh9bjDY4INMNSSAivSh03uJvny4Gj+D+neudoa7iJi7c4VFlZ/J5gUR82308zSNAt/ZroBXDWw0fV3eVPAn3aX0mtJabF6RsUZmL+Ehn+wn51/4QipMjD+6y64t7bjL6bjENan2prQ4h7++hBJ9NXvX8CUocJqMC937IasLzm5K0qwXeFMAimMHkEIQIQI2LrQ9sLBfXuyp66zWvlsh74GPv7Xpabj993pRNNDuFud5oIcn/92isbADXdpRPbjmbCNOrwRbxGZx2XmYNGMiV5kjF4IKyxCBvKier9U4uVoheCdmk83rp5G0PihAm2fAtczI4b9BWqX+nrZTrJX5kSwQddi93NQrXG+Cl3eBGNkM77VBsMpEolhXex1MVvMkZN9fG59GGbciH11FEXaY1MxrArovaSjE/lUUqBg2cZBNmiWbvzCHCPJ4RVGFK2dTbObM1m+gJyEX53fa7u3+TZpm74mNEzWbkVL4vjNwfL9uzRCu1cgbrNx5Yv5dDruNrIOgwIk+UZWwJfdbu/WHul6PMmRflVCIzd7B37Pgm/Up/NuCiQW7RXyafevN3AL6ycciCc4ZPlTRzEu+aURGlUBOJbUEsheX7PPyrrhdUt5JAG12EEEZpY/N3Vhbl5uLAfT0CbC2XmpnryFkxZmBTs5prvEeuf0bn73i3O82WTiQtJWEPLsBXnQmdnKhB06NbbhLtlTZYJMxDMJpFeajSNRDB2v61BMUHqXggUwRJ19m6p5zl51v11q34T74lTXdJURuV6+bg2D6qpfGnLy7KGLuLZngobM4pIouz4+n0/UzFKxDgLM4h+fUwKZozQ9UGrHjcif51Ruonz7oIVZ56xWtZS8z7u5zay6J2LD4gCYh2RXoBRLDKsUlZ80R8kmoxlJiL8aZCy2wCAonnucFxCLT1HKoMhbPKt34D97EXPPh0joO93iJVF1Uruew61Qoy3ZUVNX9uIJDt9AQWKLLo+mSzmTibyLHq0D6hhzpvgUgI6ekyVEL3FD+Fi5R3A8MRHPXspN1VyKkfRlC+OGiNgPC4NREZpFETgVmdXrQ2TxChuS3aY+Ndc7CiYv5+CmzfiqeZrWIQJW/C4RvjbGUoJFf1K6ZdR2xL/bG4kVq1+I4jQWX+26YUijpp+lpN7o5c6ZodXJCF56UkFGsqz44sIg8jrdWvbjRCxi2Bk0iyM3a7ecAV93zB6h1Ei38c0s6+8nrbkopArccGP8vntQe1bFeEh2nJIFOHX/k3/UHb5PtKGpnzbkmnRETMX+9X/QduLZWw/feklW/kH/JnzToJe9Kgu9Hct1UGbH5BPCLo4OOtQnZonW0xnyCcdtKyPQ/sbLiSTYJdSx4sJqWLMnfn6fIqPB3WAgk00J+fCOkomPHqtS67pf0mFmKoItYZUlJu6BihSZ8qve8+/X+LX1MhQXF95AshfUleCtmdn6l6QFXzLg2sgLn1oyVFuZecv7fzsIHzoRlAGp0gwYDOn1S4qabWvB5xUaE+Svw4KmjWtxdnuQbI32dw87D4N95u8qQRJTSQg0wLxOLkxSrPMLEn1UIhNKjAa9VLs3WLaXGrtCIt8bKY2AQP/ZdyRU6zT/E8qP2ltyBE2CCZPgWgEYDoJJO4n92y61ylNaSFXKohJhLjkfvYWm592539sIpmBNLlDo1bExFBfmHJJ0lFEiC/fj8v42OoMC9Mo3whIoWvyHfq6Uacqq55mzFf/EGC+NP/gHjhd6urc6R0hES27VXux7UY8CGKPohplWIZtTrFSaPWslCWy78E22Pw8fvReSUZx/txqLtHrFqg1DY/Eus6Iq1heZdrdcqE0/c971Bz1HW/XNXHsXpUIbI4kHdOfCc6T5zHZzvzQJB0ggMFL6IGPAilU9bj/ASdPk6fNvNtZqPuwEDhMBtBnhCexo6D6VAGIOPvJPPV523Y8R8a9vCqZbswSZKzOT1291BsUbmUWehtbb1fdRX9hiJKXvwr1QX6GjnZMgyMvnwOo2Dr24amr7FqEAbVeJAjRNOceM2EQ1Mna9fInqPJ5mh5X8CzT1aDOv08An0blz0fF5Gq4mS2cwq5glwIOlY5nznE8X4j/UdZ3FJsVIXte1JH0A7iibuPfazStM5O/Vo3KXIpXBeGORV0M9XDXFvsYZUHGvFCUubWzTw248EHE0cpQM2zNg6rjavreq3NHCAWsoZ7wvVy7l5gvtKRmIj1MnvfWEm0yFnGcuOq192350a5WefpfKCcX3Sn+AgHU+qnpstNtddbdVebagJU390lq9ko4aI9rqdaWXYG8tv5O/ZQHSqDRYHC6zfH10l5z++opso7aOSaIczlQ13iAzXvLdEu0V7kwNUZ1c8Y8aq7SeIEe5p902FlNkW8DnwHyueHchbK8vVFJfmr9mz7P8nUSccl1ULaoWMRSI1ls32kvlK0h46h3J25Yd9AzfcJbp9qYF/SEt3H5j69mMdcsNxZcAzT/A89ov3tglTX54y/EwjMfuoDoxPwLJDm5I7q6F9Kp469yNy1zSxz0N4HbRRBj9xFFuogvBspv7DXUNIsGxTINEQfmctb42XImWAODgARNo7dfcTqFKq6aTfivmvunLmzP9f8yLsJvXD3JbcPcDGNriMAcjzeDTNr65t8YB5tsnFDFLa0Uwmd2OvUdkLMX9TsAUYUfooSv47sw5J88j7CpahRjjO3/UhOXjTS39W5YZAel2KTbQd1h7INOw9P23GW7GDAe4agIUFHP48MZr7ubq0efFmmtwYMyk7D0r1oeG/CGOODgb9Ur+JMHxkwzPbtCX2ZnENQuI0RN5SyTIZuoY4XS9Rd/tPe3vNAZGSHM/YYwqs9xkkENx0O+eC2YVW1cwOJ3ckE890nbQeHLKlW15L0P0W2VliyYrfNr0nrIYddoRyGaCtj4OYd2MT7ebApqZOAQIaSHJM4mphhfjNjtnjg6YRyx9qM2FT3xOiYIMqXPFWdzhSgFF8ItocqVV09CmIoO8k6U/oJB7++wSX/YksxfPXHyjSgAGZOj1aKEq9fSvXBqtp2wu8/FxEf5AxapAD06pPGuLVUYLdgEzHR8wqRGYEwiUO9MyYbgswstuLYhwYFpSVKOdzAihZ9LuHtD598EGhINU9xc9xhL+QgTLAstmPIvvm2xyRw/WTUPXkP3ZHu6GyPmj5xFH9/QGpkglKXRVUBgVmLOJx8uZO2AstxQYocZH2JhORlxawj66BAXUEs7K/gPxINIRAFyK3WLuyq9oBTF9wEbnmCot82WjIg7CPNwYK3KrZMrKAz5yFszg4wCVLJVnIL8+OYA0xRDH8cHQjQUiQ2i1mr/be32k/3Xej9sdf3iuGvZHyLFSJvPSqz/wltnxumTJYKZsrWXtx/Rmu39jjV9lFaJttfFn57/No2h/unsJmMHbrnZ8csxkp5HQ4xR1s0HH+t3Iz82a3iQWTUDGq/+l2W3TUYLE8zNdL8Y+5oXaIH/Y2UUcX67cXeN4WvENZjz4+8q7vjhowOI3rSjFhGZ6KzwmU7+5nFV+kGWAZ5z2UWvzq0TK0pk1hPwAN4jbw//1CApRvIaIjhSGhioY6TUmsToek9cF9XjJdHvLPcyyCV3lbR5Jiz/ts46ay2F820VjTXvllElwrGzKcNSyvQlWDXdwrUINXmHorAM3fE19ngLZmgeUaCJLsSITf2VcfAOuWwX7mTPdP8Zb/04KqRniufCpwnDUk7sP0RX6cud/sanFMagnzKInSRVey0YzlVSOtA/AjrofmSH6RYbJQ8b4NDeTkIGc6247+Mnbez/qhJ9GAv9fGNFercPnnrf285Qgs+UqThLRgflcAKFuqWhLzZaR4QqvSwa3xe0LPkqj9xJWub195r7NrrR0e78FR+0mRBNMPsraqZctAUVAJfYKehTDV1MGGQSeDsOK9J3sbUuKRIS/WilX/64CBms9jCZocBlsBSZaIAjWm/SUZ8daWL2a/cJFyUOFqE3Epc2RWbtjNyPwOGpWtzu32kUooUqsJud7IV4E8rstUBXM7tGEtBx99x60g1duhyvxeKJSl8s5E34HTMmADT0836aEdg5Dv9rVyCz8i2REOmiz6wtIVFN0HsjAoN37SrY0bV1Ms8CRUILhvZvvRaDzoVCaSI0u8EPuTe4b7OPowgRGODl22UBBmHSTUY8e4DyL+Bc7bngo+2T8HtNvzyATSL5iJZgFPKpmUyZv54vVL90+/RQGATUmNKnrIvcJMYON9fl83naW5sf6hRkbbTC9RUEE6XADwjgA46wWfUQ+QWZl0J4PVTWAln/YfAz/SV3q3J9+yCYDleruoN5uoc/wT2f4YONGTb6zTGq3V+3JqzmCOjwebKln+fExVLN7sqtqfMnsKVXWbb2Ai5m3D/fCTgX7oKYzTZvj+m28XnDqPbXuP4MyWdmPezcesdrh7rCzA7BWdObiuyDEKjjzBbQ0qnuwjliz+b+j7aPMKlkXyIznV3tGzAfYwIbzGGt098oh4eq3ruDjdgHtjxfFCjHrjjRbHajoz/YOY4raojPFQ910GIlBV7hq47UDgpyajBxQUmD8NctiLV1rTSLAEsQDLTeRKcmPBMVMFF0SPBBhZ5oXoxtD3lMhuAQXmA+57OcciczVW9e9zwSIAHS+FJmvfXMJGF1dMBsIUMaPjvgaVqUc3p32qVCMQYFEiRLzlVSOGMCmv/HJIxAHe3mL/XnoZ1IkWLeRZfgyByjnDbbeRK5KL7bYHSVJZ9UFq+yCiNKeRUaYjgbC3hVUvfJAhy/QNl/JqLKVvGMk9ZcfyGidNeo/VTxK9vUpodzfQI9Z2eAre4nmrkzgxKSnT5IJ1D69oHuUS5hp7pK9IAWuNrAOtOH0mAuwCrY8mXAtVXUeaNK3OXr6PRvmWg4VQqFSy+a1GZfFYgdsJELG8N0kvqmzvwZ02Plf5fH9QTy6br0oY/IDsEA+GBf9pEVWCIuBCjsup3LDSDqI+5+0IKSUFr7A96A2f0FbcU9fqljdqvsd8sG55KcKloHIFZem2Wb6pCLXybnVSB0sjCXzdS8IKvE");const ci=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),ui=4;function li(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function fi(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let r=[];for(let n=0;n<t;)r.push(String.fromCodePoint(...e.slice(n,n+=4096)));return r.join("")}var di=Yn("AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g");function hi(e){return e>>24&255}function pi(e){return 16777215&e}const gi=new Map(ti(di).flatMap(((e,t)=>e.map((e=>[e,t+1<<24]))))),yi=new Set(ei(di)),mi=new Map,bi=new Map;for(let[e,t]of ri(di)){if(!yi.has(e)&&2==t.length){let[r,n]=t,i=bi.get(r);i||(i=new Map,bi.set(r,i)),i.set(n,e)}mi.set(e,t.reverse())}const vi=44032,wi=4352,Ai=4449,Ei=4519,_i=28,Si=21*_i,xi=vi+19*Si,Ti=wi+19,Pi=Ai+21,Ii=Ei+_i;function ki(e){return e>=vi&&e<xi}function Oi(e,t){if(e>=wi&&e<Ti&&t>=Ai&&t<Pi)return vi+(e-wi)*Si+(t-Ai)*_i;if(ki(e)&&t>Ei&&t<Ii&&(e-vi)%_i==0)return e+(t-Ei);{let r=bi.get(e);return r&&(r=r.get(t),r)?r:-1}}function Ci(e){let t=[],r=[],n=!1;function i(e){let r=gi.get(e);r&&(n=!0,e|=r),t.push(e)}for(let n of e)for(;;){if(n<128)t.push(n);else if(ki(n)){let e=n-vi,t=e%Si/_i|0,r=e%_i;i(wi+(e/Si|0)),i(Ai+t),r>0&&i(Ei+r)}else{let e=mi.get(n);e?r.push(...e):i(n)}if(!r.length)break;n=r.pop()}if(n&&t.length>1){let e=hi(t[0]);for(let r=1;r<t.length;r++){let n=hi(t[r]);if(0==n||e<=n){e=n;continue}let i=r-1;for(;;){let r=t[i+1];if(t[i+1]=t[i],t[i]=r,!i)break;if(e=hi(t[--i]),e<=n)break}e=hi(t[r])}}return t}function Ni(e){return Ci(e).map(pi)}function Ri(e){return function(e){let t=[],r=[],n=-1,i=0;for(let o of e){let e=hi(o),s=pi(o);if(-1==n)0==e?n=s:t.push(s);else if(i>0&&i>=e)0==e?(t.push(n,...r),r.length=0,n=s):r.push(s),i=e;else{let o=Oi(n,s);o>=0?n=o:0==i&&0==e?(t.push(n),n=s):(r.push(s),i=e)}}return n>=0&&t.push(n,...r),t}(Ci(e))}const Bi=65039,Mi=".",Li=1,Fi=45;function ji(){return new Set(ei(ai))}const Ui=new Map(ri(ai)),Di=ji(),Zi=ji(),Hi=new Set(ei(ai).map((function(e){return this[e]}),[...Zi])),$i=ji(),Gi=(ji(),ti(ai));function zi(){return new Set([ei(ai).map((e=>Gi[e])),ei(ai)].flat(2))}const Vi=ai(),Wi=ni((e=>{let t=ni(ai).map((e=>e+96));if(t.length){let r=e>=Vi;t[0]-=32,t=fi(t),r&&(t=`Restricted[${t}]`);let n=zi(),i=zi(),o=[...n,...i].sort(((e,t)=>e-t));return{N:t,P:n,M:!ai(),R:r,V:new Set(o)}}})),qi=ji(),Ki=new Map;[...qi,...ji()].sort(((e,t)=>e-t)).map(((e,t,r)=>{let n=ai(),i=r[t]=n?r[t-n]:{V:[],M:new Map};i.V.push(e),qi.has(e)||Ki.set(e,i)}));for(let{V:e,M:t}of new Set(Ki.values())){let r=[];for(let t of e){let e=Wi.filter((e=>e.V.has(t))),n=r.find((({G:t})=>e.some((e=>t.has(e)))));n||(n={G:new Set,V:[]},r.push(n)),n.V.push(t),e.forEach((e=>n.G.add(e)))}let n=r.flatMap((({G:e})=>[...e]));for(let{G:e,V:i}of r){let r=new Set(n.filter((t=>!e.has(t))));for(let e of i)t.set(e,r)}}let Ji=new Set,Yi=new Set;for(let e of Wi)for(let t of e.V)(Ji.has(t)?Yi:Ji).add(t);for(let e of Ji)Ki.has(e)||Yi.has(e)||Ki.set(e,Li);const Qi=new Set([...Ji,...Ni(Ji)]),Xi=ei(ai),eo=function e(t){let r=ni((()=>{let t=ei(ai).map((e=>Xi[e]));if(t.length)return e(t)})).sort(((e,t)=>t.Q.size-e.Q.size)),n=ai(),i=n%3;n=n/3|0;let o=1&n;return n>>=1,{B:r,V:i,F:o,S:1&n,C:2&n,Q:new Set(t)}}([]);class to extends Array{get is_emoji(){return!0}}function ro(e,t=li){let r=[];var n;n=e[0],Zi.has(n)&&r.push("◌");let i=0,o=e.length;for(let n=0;n<o;n++){let o=e[n];so(o)&&(r.push(fi(e.slice(i,n))),r.push(t(o)),i=n+1)}return r.push(fi(e.slice(i,o))),r.join("")}function no(e){return(so(e)?"":`${io(ro([e]))} `)+li(e)}function io(e){return`"${e}"‎`}function oo(e){for(let t=e.lastIndexOf(95);t>0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}function so(e){return $i.has(e)}function ao(e,t){let r=0;return e.split(Mi).map((e=>{let n,i=function(e){let t=[];for(let r=0,n=e.length;r<n;){let n=e.codePointAt(r);r+=n<65536?1:2,t.push(n)}return t}(e),o={input:i,offset:r};r+=i.length+1;try{let e,r=o.tokens=function(e,t){let r=[],n=[];for(e=e.slice().reverse();e.length;){let i=fo(e);if(i)n.length&&(r.push(t(n)),n=[]),r.push(i);else{let t=e.pop();if(Qi.has(t))n.push(t);else{let e=Ui.get(t);if(e)n.push(...e);else if(!Di.has(t))throw co(t)}}}return n.length&&r.push(t(n)),r}(i,Ri),s=r.length;if(!s)throw new Error("empty label");{let i=r[0],a=s>1||i.is_emoji;if(!a&&i.every((e=>e<128)))n=i,oo(n),function(e){if(e.length>=4&&e[2]==Fi&&e[3]==Fi)throw new Error("invalid label extension")}(n),e="ASCII";else if(a&&(o.emoji=!0,i=r.flatMap((e=>e.is_emoji?[]:e))),n=r.flatMap((e=>!t&&e.is_emoji?e.filter((e=>e!=Bi)):e)),oo(n),i.length){if(Zi.has(n[0]))throw lo("leading combining mark");for(let e=1;e<s;e++){let t=r[e];if(!t.is_emoji&&Zi.has(t[0]))throw lo(`emoji + combining mark: "${fi(r[e-1])} + ${ro([t[0]])}"`)}!function(e){let t=e[0],r=ci.get(t);if(r)throw lo(`leading ${r}`);let n=e.length,i=-1;for(let o=1;o<n;o++){t=e[o];let n=ci.get(t);if(n){if(i==o)throw lo(`${r} + ${n}`);i=o+1,r=n}}if(i==n)throw lo(`trailing ${r}`)}(n);let t=[...new Set(i)],[o]=function(e){let t=Wi;for(let r of e){let e=t.filter((e=>e.V.has(r)));if(!e.length)throw t===Wi?co(r):uo(t[0],r);if(t=e,1==e.length)break}return t}(t);!function(e,t){let{V:r,M:n}=e;for(let n of t)if(!r.has(n))throw uo(e,n);if(n){let e=Ni(t);for(let t=1,r=e.length;t<r;t++)if(Hi.has(e[t])){let n=t+1;for(let i;n<r&&Hi.has(i=e[n]);n++)for(let r=t;r<n;r++)if(e[r]==i)throw new Error(`non-spacing marks: repeated ${no(i)}`);if(n-t>ui)throw new Error(`non-spacing marks: too many ${io(ro(e.slice(t-1,n)))} (${n-t}/${ui})`);t=n}}}(o,i),function(e,t){let r,n=[];for(let e of t){let t=Ki.get(e);if(t===Li)return;if(t){let n=t.M.get(e);if(r=r?r.filter((e=>n.has(e))):[...n],!r.length)return}else n.push(e)}if(r)for(let t of r)if(n.every((e=>t.V.has(e))))throw new Error(`whole-script confusable: ${e.N}/${t.N}`)}(o,t),e=o.N}else e="Emoji"}o.type=e}catch(e){o.error=e}return o.output=n,o}))}function co(e){return new Error(`disallowed character: ${no(e)}`)}function uo(e,t){let r=no(t),n=Wi.find((e=>e.P.has(t)));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${e.N} + ${r}`)}function lo(e){return new Error(`illegal placement: ${e}`)}function fo(e,t){let r,n,i=eo,o=[],s=e.length;for(t&&(t.length=0);s;){let a=e[--s];if(i=i.B.find((e=>e.Q.has(a))),!i)break;if(i.S)n=a;else if(i.C&&a===n)break;o.push(a),i.F&&(o.push(Bi),s>0&&e[s-1]==Bi&&s--),i.V&&(r=ho(o,i),t&&t.push(...e.slice(s).reverse()),e.length=s)}return r}function ho(e,t){let r=to.from(e);return 2==t.V&&r.splice(1,1),r}const po=new Uint8Array(32);function go(e){return w(0!==e.length,"invalid ENS name; empty component","comp",e),e}function yo(e){const t=Ft(function(e){try{return function(e){return(t=ao(e)).map((({input:e,error:r,output:n})=>{if(r){let n=r.message;throw new Error(1==t.length?n:`Invalid label ${io(ro(e))}: ${n}`)}return fi(n)})).join(Mi);var t}(e)}catch(t){w(!1,`invalid ENS name (${t.message})`,"name",e)}}(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++)46===t[e]&&(r.push(go(t.slice(n,e))),n=e+1);return w(n<t.length,"invalid ENS name; empty component","name",e),r.push(go(t.slice(n))),r}function mo(e){w("string"==typeof e,"invalid ENS name; not a string","name",e);let t=po;const r=yo(e);for(;r.length;)t=at(N([t,at(r.pop())]));return C(t)}po.fill(0);const bo="0x0000000000000000000000000000000000000000000000000000000000000000",vo=BigInt(0),wo=BigInt(1),Ao=BigInt(2),Eo=BigInt(27),_o=BigInt(28),So=BigInt(35),xo={};function To(e){return L(q(e),32)}class Po{#P;#I;#k;#O;get r(){return this.#P}set r(e){w(32===R(e),"invalid r","value",e),this.#P=C(e)}get s(){return this.#I}set s(e){w(32===R(e),"invalid s","value",e);const t=C(e);w(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),this.#I=t}get v(){return this.#k}set v(e){const t=V(e,"value");w(27===t||28===t,"invalid v","v",e),this.#k=t}get networkV(){return this.#O}get legacyChainId(){const e=this.networkV;return null==e?null:Po.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=T(this.s);return this.yParity&&(e[0]|=128),C(e)}get compactSerialized(){return N([this.r,this.yParityAndS])}get serialized(){return N([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,r,n){S(e,xo,"Signature"),this.#P=t,this.#I=r,this.#k=n,this.#O=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Po(xo,this.r,this.s,this.v);return this.networkV&&(e.#O=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const t=H(e,"v");return t==Eo||t==_o?vo:(w(t>=So,"invalid EIP-155 v","v",e),(t-So)/Ao)}static getChainIdV(e,t){return H(e)*Ao+BigInt(35+t-27)}static getNormalizedV(e){const t=H(e);return t===vo||t===Eo?27:t===wo||t===_o?28:(w(t>=So,"invalid v","v",e),t&wo?27:28)}static from(e){function t(t,r){w(t,r,"signature",e)}if(null==e)return new Po(xo,bo,bo,27);if("string"==typeof e){const r=T(e,"signature");if(64===r.length){const e=C(r.slice(0,32)),t=r.slice(32,64),n=128&t[0]?28:27;return t[0]&=127,new Po(xo,e,C(t),n)}if(65===r.length){const e=C(r.slice(0,32)),n=r.slice(32,64);t(0==(128&n[0]),"non-canonical s");const i=Po.getNormalizedV(r[64]);return new Po(xo,e,C(n),i)}t(!1,"invalid raw signature length")}if(e instanceof Po)return e.clone();const r=e.r;t(null!=r,"missing r");const n=To(r),i=function(e,r){if(null!=e)return To(e);if(null!=r){t(I(r,32),"invalid yParityAndS");const e=T(r);return e[0]&=127,C(e)}t(!1,"missing s")}(e.s,e.yParityAndS);t(0==(128&T(i)[0]),"non-canonical s");const{networkV:o,v:s}=function(e,r,n){if(null!=e){const t=H(e);return{networkV:t>=So?t:void 0,v:Po.getNormalizedV(t)}}if(null!=r)return t(I(r,32),"invalid yParityAndS"),{v:128&T(r)[0]?28:27};if(null!=n){switch(V(n,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),a=new Po(xo,n,i,s);return o&&(a.#O=o),t(null==e.yParity||V(e.yParity,"sig.yParity")===a.yParity,"yParity mismatch"),t(null==e.yParityAndS||e.yParityAndS===a.yParityAndS,"yParityAndS mismatch"),a}}var Io=i(9314),ko=i.t(Io,2);const Oo=BigInt(0),Co=BigInt(1),No=BigInt(2),Ro=BigInt(3),Bo=BigInt(8),Mo=Object.freeze({a:Oo,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:Co,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),Lo=(e,t)=>(e+t/No)/t,Fo={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(e){const{n:t}=Mo,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Co*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),a=Lo(o*e,t),c=Lo(-n*e,t);let u=fs(e-a*r-c*i,t),l=fs(-a*n-c*o,t);const f=u>s,d=l>s;if(f&&(u=t-u),d&&(l=t-l),u>s||l>s)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:l}}},jo=32,Uo=32,Do=jo+1,Zo=2*jo+1;function Ho(e){const{a:t,b:r}=Mo,n=fs(e*e),i=fs(n*e);return fs(i+t*e+r)}const $o=Mo.a===Oo;class Go extends Error{constructor(e){super(e)}}function zo(e){if(!(e instanceof Vo))throw new TypeError("JacobianPoint expected")}class Vo{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof Ko))throw new TypeError("JacobianPoint#fromAffine: expected Point");return e.equals(Ko.ZERO)?Vo.ZERO:new Vo(e.x,e.y,Co)}static toAffineBatch(e){const t=function(e,t=Mo.P){const r=new Array(e.length),n=hs(e.reduce(((e,n,i)=>n===Oo?e:(r[i]=e,fs(e*n,t))),Co),t);return e.reduceRight(((e,n,i)=>n===Oo?e:(r[i]=fs(e*r[i],t),fs(e*n,t))),n),r}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return Vo.toAffineBatch(e).map(Vo.fromAffine)}equals(e){zo(e);const{x:t,y:r,z:n}=this,{x:i,y:o,z:s}=e,a=fs(n*n),c=fs(s*s),u=fs(t*c),l=fs(i*a),f=fs(fs(r*s)*c),d=fs(fs(o*n)*a);return u===l&&f===d}negate(){return new Vo(this.x,fs(-this.y),this.z)}double(){const{x:e,y:t,z:r}=this,n=fs(e*e),i=fs(t*t),o=fs(i*i),s=e+i,a=fs(No*(fs(s*s)-n-o)),c=fs(Ro*n),u=fs(c*c),l=fs(u-No*a),f=fs(c*(a-l)-Bo*o),d=fs(No*t*r);return new Vo(l,f,d)}add(e){zo(e);const{x:t,y:r,z:n}=this,{x:i,y:o,z:s}=e;if(i===Oo||o===Oo)return this;if(t===Oo||r===Oo)return e;const a=fs(n*n),c=fs(s*s),u=fs(t*c),l=fs(i*a),f=fs(fs(r*s)*c),d=fs(fs(o*n)*a),h=fs(l-u),p=fs(d-f);if(h===Oo)return p===Oo?this.double():Vo.ZERO;const g=fs(h*h),y=fs(h*g),m=fs(u*g),b=fs(p*p-y-No*m),v=fs(p*(m-b)-f*y),w=fs(n*s*h);return new Vo(b,v,w)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){const t=Vo.ZERO;if("bigint"==typeof e&&e===Oo)return t;let r=ls(e);if(r===Co)return this;if(!$o){let e=t,n=this;for(;r>Oo;)r&Co&&(e=e.add(n)),n=n.double(),r>>=Co;return e}let{k1neg:n,k1:i,k2neg:o,k2:s}=Fo.splitScalar(r),a=t,c=t,u=this;for(;i>Oo||s>Oo;)i&Co&&(a=a.add(u)),s&Co&&(c=c.add(u)),u=u.double(),i>>=Co,s>>=Co;return n&&(a=a.negate()),o&&(c=c.negate()),c=new Vo(fs(c.x*Fo.beta),c.y,c.z),a.add(c)}precomputeWindow(e){const t=$o?128/e+1:256/e+1,r=[];let n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(Vo.BASE)&&(t=Ko.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&qo.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=Vo.normalizeZ(n),qo.set(t,n)));let i=Vo.ZERO,o=Vo.BASE;const s=1+($o?128/r:256/r),a=2**(r-1),c=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let t=0;t<s;t++){const r=t*a;let s=Number(e&c);e>>=l,s>a&&(s-=u,e+=Co);const f=r,d=r+Math.abs(s)-1,h=t%2!=0,p=s<0;0===s?o=o.add(Wo(h,n[f])):i=i.add(Wo(p,n[d]))}return{p:i,f:o}}multiply(e,t){let r,n,i=ls(e);if($o){const{k1neg:e,k1:o,k2neg:s,k2:a}=Fo.splitScalar(i);let{p:c,f:u}=this.wNAF(o,t),{p:l,f}=this.wNAF(a,t);c=Wo(e,c),l=Wo(s,l),l=new Vo(fs(l.x*Fo.beta),l.y,l.z),r=c.add(l),n=u.add(f)}else{const{p:e,f:o}=this.wNAF(i,t);r=e,n=o}return Vo.normalizeZ([r,n])[0]}toAffine(e){const{x:t,y:r,z:n}=this,i=this.equals(Vo.ZERO);null==e&&(e=i?Bo:hs(n));const o=e,s=fs(o*o),a=fs(s*o),c=fs(t*s),u=fs(r*a),l=fs(n*o);if(i)return Ko.ZERO;if(l!==Co)throw new Error("invZ was invalid");return new Ko(c,u)}}function Wo(e,t){const r=t.negate();return e?r:t}Vo.BASE=new Vo(Mo.Gx,Mo.Gy,Co),Vo.ZERO=new Vo(Oo,Co,Oo);const qo=new WeakMap;class Ko{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,qo.delete(this)}hasEvenY(){return this.y%No===Oo}static fromCompressedHex(e){const t=32===e.length,r=cs(t?e:e.subarray(1));if(!vs(r))throw new Error("Point is not on curve");let n=function(e){const{P:t}=Mo,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),a=BigInt(88),c=e*e*e%t,u=c*c*e%t,l=ds(u,Ro)*u%t,f=ds(l,Ro)*u%t,d=ds(f,No)*c%t,h=ds(d,n)*d%t,p=ds(h,i)*h%t,g=ds(p,s)*p%t,y=ds(g,a)*g%t,m=ds(y,s)*p%t,b=ds(m,Ro)*u%t,v=ds(b,o)*h%t,w=ds(v,r)*c%t,A=ds(w,No);if(A*A%t!==e)throw new Error("Cannot find square root");return A}(Ho(r));const i=(n&Co)===Co;t?i&&(n=fs(-n)):1==(1&e[0])!==i&&(n=fs(-n));const o=new Ko(r,n);return o.assertValidity(),o}static fromUncompressedHex(e){const t=cs(e.subarray(1,jo+1)),r=cs(e.subarray(jo+1,2*jo+1)),n=new Ko(t,r);return n.assertValidity(),n}static fromHex(e){const t=us(e),r=t.length,n=t[0];if(r===jo)return this.fromCompressedHex(t);if(r===Do&&(2===n||3===n))return this.fromCompressedHex(t);if(r===Zo&&4===n)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-${Do} compressed bytes or ${Zo} uncompressed bytes, not ${r}`)}static fromPrivateKey(e){return Ko.BASE.multiply(As(e))}static fromSignature(e,t,r){const{r:n,s:i}=function(e){if(e instanceof Qo)return e.assertValidity(),e;try{return Qo.fromDER(e)}catch(t){return Qo.fromCompact(e)}}(t);if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");const o=ps(us(e)),{n:s}=Mo,a=2===r||3===r?n+s:n,c=hs(a,s),u=fs(-o*c,s),l=fs(i*c,s),f=1&r?"03":"02",d=Ko.fromHex(f+ns(a)),h=Ko.BASE.multiplyAndAddUnsafe(d,u,l);if(!h)throw new Error("Cannot recover signature: point at infinify");return h.assertValidity(),h}toRawBytes(e=!1){return as(this.toHex(e))}toHex(e=!1){const t=ns(this.x);return e?`${this.hasEvenY()?"02":"03"}${t}`:`04${t}${ns(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!vs(t)||!vs(r))throw new Error(e);const n=fs(r*r);if(fs(n-Ho(t))!==Oo)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new Ko(this.x,fs(-this.y))}double(){return Vo.fromAffine(this).double().toAffine()}add(e){return Vo.fromAffine(this).add(Vo.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return Vo.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){const n=Vo.fromAffine(this),i=t===Oo||t===Co||this!==Ko.BASE?n.multiplyUnsafe(t):n.multiply(t),o=Vo.fromAffine(e).multiplyUnsafe(r),s=i.add(o);return s.equals(Vo.ZERO)?void 0:s.toAffine()}}function Jo(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function Yo(e){if(e.length<2||2!==e[0])throw new Error(`Invalid signature integer tag: ${ts(e)}`);const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:cs(r),left:e.subarray(t+2)}}Ko.BASE=new Ko(Mo.Gx,Mo.Gy),Ko.ZERO=new Ko(Oo,Oo);class Qo{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=e instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=t?ts(e):e;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new Qo(ss(n.slice(0,64)),ss(n.slice(64,128)))}static fromDER(e){const t=e instanceof Uint8Array;if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error(`Invalid signature tag: ${ts(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=Yo(e.subarray(2)),{data:n,left:i}=Yo(r);if(i.length)throw new Error(`Invalid signature: left bytes after parsing: ${ts(i)}`);return{r:t,s:n}}(t?e:as(e));return new Qo(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!bs(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!bs(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=Mo.n>>Co;return this.s>e}normalizeS(){return this.hasHighS()?new Qo(this.r,fs(-this.s,Mo.n)):this}toDERRawBytes(){return as(this.toDERHex())}toDERHex(){const e=Jo(os(this.s)),t=Jo(os(this.r)),r=e.length/2,n=t.length/2,i=os(r),o=os(n);return`30${os(n+r+4)}02${o}${t}02${i}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return as(this.toCompactHex())}toCompactHex(){return ns(this.r)+ns(this.s)}}function Xo(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const es=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function ts(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let r=0;r<e.length;r++)t+=es[e[r]];return t}const rs=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function ns(e){if("bigint"!=typeof e)throw new Error("Expected bigint");if(!(Oo<=e&&e<rs))throw new Error("Expected number 0 <= n < 2^256");return e.toString(16).padStart(64,"0")}function is(e){const t=as(ns(e));if(32!==t.length)throw new Error("Error: expected 32 bytes");return t}function os(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function ss(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function as(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function cs(e){return ss(ts(e))}function us(e){return e instanceof Uint8Array?Uint8Array.from(e):as(e)}function ls(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&bs(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function fs(e,t=Mo.P){const r=e%t;return r>=Oo?r:t+r}function ds(e,t){const{P:r}=Mo;let n=e;for(;t-- >Oo;)n*=n,n%=r;return n}function hs(e,t=Mo.P){if(e===Oo||t<=Oo)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=fs(e,t),n=t,i=Oo,o=Co,s=Co,a=Oo;for(;r!==Oo;){const e=n/r,t=n%r,c=i-s*e,u=o-a*e;n=r,r=t,i=s,o=a,s=c,a=u}if(n!==Co)throw new Error("invert: does not exist");return fs(i,t)}function ps(e,t=!1){const r=function(e){const t=8*e.length-8*Uo,r=cs(e);return t>0?r>>BigInt(t):r}(e);if(t)return r;const{n}=Mo;return r>=n?r-n:r}let gs,ys;class ms{constructor(e,t){if(this.hashLen=e,this.qByteLen=t,"number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(e).fill(1),this.k=new Uint8Array(e).fill(0),this.counter=0}hmac(...e){return Is.hmacSha256(this.k,...e)}hmacSync(...e){return ys(this.k,...e)}checkSync(){if("function"!=typeof ys)throw new Go("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),0!==e.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){this.incr();let e=0;const t=[];for(;e<this.qByteLen;){this.v=await this.hmac(this.v);const r=this.v.slice();t.push(r),e+=this.v.length}return Xo(...t)}generateSync(){this.checkSync(),this.incr();let e=0;const t=[];for(;e<this.qByteLen;){this.v=this.hmacSync(this.v);const r=this.v.slice();t.push(r),e+=this.v.length}return Xo(...t)}}function bs(e){return Oo<e&&e<Mo.n}function vs(e){return Oo<e&&e<Mo.P}function ws(e,t,r,n=!0){const{n:i}=Mo,o=ps(e,!0);if(!bs(o))return;const s=hs(o,i),a=Ko.BASE.multiply(o),c=fs(a.x,i);if(c===Oo)return;const u=fs(s*fs(t+r*c,i),i);if(u===Oo)return;let l=new Qo(c,u),f=(a.x===l.r?0:2)|Number(a.y&Co);return n&&l.hasHighS()&&(l=l.normalizeS(),f^=1),{sig:l,recovery:f}}function As(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(e.length!==2*Uo)throw new Error("Expected 32 bytes of private key");t=ss(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(e.length!==Uo)throw new Error("Expected 32 bytes of private key");t=cs(e)}if(!bs(t))throw new Error("Expected private key: 0 < key < n");return t}function Es(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===Do||n===Zo:r?n===2*Do||n===2*Zo:e instanceof Ko}function _s(e){return cs(e.length>jo?e.slice(0,jo):e)}function Ss(e){const t=_s(e),r=fs(t,Mo.n);return xs(r<Oo?t:r)}function xs(e){return is(e)}Ko.BASE._setWindowSize(8);const Ts={node:ko,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},Ps={},Is={bytesToHex:ts,hexToBytes:as,concatBytes:Xo,mod:fs,invert:hs,isValidPrivateKey(e){try{return As(e),!0}catch(e){return!1}},_bigintTo32Bytes:is,_normalizePrivateKey:As,hashToPrivateKey:e=>{e=us(e);const t=Uo+8;if(e.length<t||e.length>1024)throw new Error("Expected valid bytes of private key as per FIPS 186");return is(fs(cs(e),Mo.n-Co)+Co)},randomBytes:(e=32)=>{if(Ts.web)return Ts.web.getRandomValues(new Uint8Array(e));if(Ts.node){const{randomBytes:t}=Ts.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>Is.hashToPrivateKey(Is.randomBytes(Uo+8)),precompute(e=8,t=Ko.BASE){const r=t===Ko.BASE?t:new Ko(t.x,t.y);return r._setWindowSize(e),r.multiply(Ro),r},sha256:async(...e)=>{if(Ts.web){const t=await Ts.web.subtle.digest("SHA-256",Xo(...e));return new Uint8Array(t)}if(Ts.node){const{createHash:t}=Ts.node,r=t("sha256");return e.forEach((e=>r.update(e))),Uint8Array.from(r.digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(Ts.web){const r=await Ts.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=Xo(...t),i=await Ts.web.subtle.sign("HMAC",r,n);return new Uint8Array(i)}if(Ts.node){const{createHmac:r}=Ts.node,n=r("sha256",e);return t.forEach((e=>n.update(e))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...t)=>{let r=Ps[e];if(void 0===r){const t=await Is.sha256(Uint8Array.from(e,(e=>e.charCodeAt(0))));r=Xo(t,t),Ps[e]=r}return Is.sha256(r,...t)},taggedHashSync:(e,...t)=>{if("function"!=typeof gs)throw new Go("sha256Sync is undefined, you need to set it");let r=Ps[e];if(void 0===r){const t=gs(Uint8Array.from(e,(e=>e.charCodeAt(0))));r=Xo(t,t),Ps[e]=r}return gs(r,...t)},_JacobianPoint:Vo};Object.defineProperties(Is,{sha256Sync:{configurable:!1,get:()=>gs,set(e){gs||(gs=e)}},hmacSha256Sync:{configurable:!1,get:()=>ys,set(e){ys||(ys=e)}}});class ks extends Fe{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ue.hash(e);const r=Le(t);if(this.iHash=e.create(),!(this.iHash instanceof Fe))throw new TypeError("Expected instance of class which extends utils.Hash");const n=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const i=new Uint8Array(n);i.set(r.length>this.iHash.blockLen?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return ue.exists(this),this.iHash.update(e),this}digestInto(e){ue.exists(this),ue.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Os=(e,t,r)=>new ks(e,t).update(r).digest();function Cs(e,t,r,n){const{c:i,dkLen:o,DK:s,PRF:a,PRFSalt:c}=function(e,t,r,n){ue.hash(e);const i=Ue({dkLen:32,asyncTick:10},n),{c:o,dkLen:s,asyncTick:a}=i;if(ue.number(o),ue.number(s),ue.number(a),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=Le(t),u=Le(r),l=new Uint8Array(s),f=Os.create(e,c),d=f._cloneInto().update(u);return{c:o,dkLen:s,asyncTick:a,DK:l,PRF:f,PRFSalt:d}}(e,t,r,n);let u;const l=new Uint8Array(4),f=Ne(l),d=new Uint8Array(a.outputLen);for(let e=1,t=0;t<o;e++,t+=a.outputLen){const r=s.subarray(t,t+a.outputLen);f.setInt32(0,e,!1),(u=c._cloneInto(u)).update(l).digestInto(d),r.set(d.subarray(0,r.length));for(let e=1;e<i;e++){a._cloneInto(u).update(d).digestInto(d);for(let e=0;e<r.length;e++)r[e]^=d[e]}}return function(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}(a,c,s,u,d)}Os.create=(e,t)=>new ks(e,t);class Ns extends Fe{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ne(this.buffer)}update(e){ue.exists(this);const{view:t,buffer:r,blockLen:n}=this,i=(e=Le(e)).length;for(let o=0;o<i;){const s=Math.min(n-this.pos,i-o);if(s!==n)r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=Ne(e);for(;n<=i-o;o+=n)this.process(t,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){ue.exists(this),ue.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:i}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=Ne(e);this.get().forEach(((e,t)=>s.setUint32(4*t,e,i)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}const Rs=(e,t,r)=>e&t^~e&r,Bs=(e,t,r)=>e&t^e&r^t&r,Ms=new Uint32Array([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]),Ls=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Fs=new Uint32Array(64);class js extends Ns{constructor(){super(64,32,8,!1),this.A=0|Ls[0],this.B=0|Ls[1],this.C=0|Ls[2],this.D=0|Ls[3],this.E=0|Ls[4],this.F=0|Ls[5],this.G=0|Ls[6],this.H=0|Ls[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)Fs[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Fs[e-15],r=Fs[e-2],n=Re(t,7)^Re(t,18)^t>>>3,i=Re(r,17)^Re(r,19)^r>>>10;Fs[e]=i+Fs[e-7]+n+Fs[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(Re(s,6)^Re(s,11)^Re(s,25))+Rs(s,a,c)+Ms[e]+Fs[e]|0,l=(Re(r,2)^Re(r,13)^Re(r,22))+Bs(r,n,i)|0;u=c,c=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){Fs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Us=De((()=>new js)),[Ds,Zs]=he(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))),Hs=new Uint32Array(80),$s=new Uint32Array(80);class Gs extends Ns{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:f,Gh:d,Gl:h,Hh:p,Hl:g}=this;return[e,t,r,n,i,o,s,a,c,u,l,f,d,h,p,g]}set(e,t,r,n,i,o,s,a,c,u,l,f,d,h,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|f,this.Gh=0|d,this.Gl=0|h,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)Hs[r]=e.getUint32(t),$s[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|Hs[e-15],r=0|$s[e-15],n=ye(t,r,1)^ye(t,r,8)^pe(t,r,7),i=me(t,r,1)^me(t,r,8)^ge(t,r,7),o=0|Hs[e-2],s=0|$s[e-2],a=ye(o,s,19)^be(o,s,61)^pe(o,s,6),c=me(o,s,19)^ve(o,s,61)^ge(o,s,6),u=Pe(i,c,$s[e-7],$s[e-16]),l=Ie(u,n,a,Hs[e-7],Hs[e-16]);Hs[e]=0|l,$s[e]=0|u}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:f,Fh:d,Fl:h,Gh:p,Gl:g,Hh:y,Hl:m}=this;for(let e=0;e<80;e++){const t=ye(l,f,14)^ye(l,f,18)^be(l,f,41),b=me(l,f,14)^me(l,f,18)^ve(l,f,41),v=l&d^~l&p,w=Oe(m,b,f&h^~f&g,Zs[e],$s[e]),A=ke(w,y,t,v,Ds[e],Hs[e]),E=0|w,_=ye(r,n,28)^be(r,n,34)^be(r,n,39),S=me(r,n,28)^ve(r,n,34)^ve(r,n,39),x=r&i^r&s^i&s,T=n&o^n&a^o&a;y=0|p,m=0|g,p=0|d,g=0|h,d=0|l,h=0|f,({h:l,l:f}=Se(0|c,0|u,0|A,0|E)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|r,o=0|n;const P=xe(E,S,T);r=Te(P,A,_,x),n=0|P}({h:r,l:n}=Se(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=Se(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=Se(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=Se(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:f}=Se(0|this.Eh,0|this.El,0|l,0|f)),({h:d,l:h}=Se(0|this.Fh,0|this.Fl,0|d,0|h)),({h:p,l:g}=Se(0|this.Gh,0|this.Gl,0|p,0|g)),({h:y,l:m}=Se(0|this.Hh,0|this.Hl,0|y,0|m)),this.set(r,n,i,o,s,a,c,u,l,f,d,h,p,g,y,m)}roundClean(){Hs.fill(0),$s.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class zs extends Gs{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class Vs extends Gs{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const Ws=De((()=>new Gs));De((()=>new zs)),De((()=>new Vs));const qs=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}(),Ks=qs.crypto||qs.msCrypto;function Js(e){switch(e){case"sha256":return Us.create();case"sha512":return Ws.create()}w(!1,"invalid hashing algorithm name","algorithm",e)}let Ys=!1;const Qs=function(e,t,r){return function(e,t){const r={sha256:Us,sha512:Ws}[e];return w(null!=r,"invalid hmac algorithm","algorithm",e),Os.create(r,t)}(e,t).update(r).digest()};let Xs=Qs;function ea(e,t,r){const n=T(t,"key"),i=T(r,"data");return C(Xs(e,n,i))}ea._=Qs,ea.lock=function(){Ys=!0},ea.register=function(e){if(Ys)throw new Error("computeHmac is locked");Xs=e},Object.freeze(ea),Is.hmacSha256Sync=function(e,...t){return T(ea("sha256",e,N(t)))};class ta{#C;constructor(e){w(32===R(e),"invalid private key","privateKey","[REDACTED]"),this.#C=C(e)}get privateKey(){return this.#C}get publicKey(){return ta.computePublicKey(this.#C)}get compressedPublicKey(){return ta.computePublicKey(this.#C,!0)}sign(e){w(32===R(e),"invalid digest length","digest",e);const[t,r]=function(e,t,r={}){const{seed:n,m:i,d:o}=function(e,t,r){if(null==e)throw new Error(`sign: expected valid message hash, not "${e}"`);const n=us(e),i=As(t),o=[xs(i),Ss(n)];if(null!=r){!0===r&&(r=Is.randomBytes(jo));const e=us(r);if(e.length!==jo)throw new Error(`sign: Expected ${jo} bytes of extra data`);o.push(e)}return{seed:Xo(...o),m:_s(n),d:i}}(e,t,r.extraEntropy),s=new ms(32,Uo);let a;for(s.reseedSync(n);!(a=ws(s.generateSync(),i,o,r.canonical));)s.reseedSync();return function(e,t){const{sig:r,recovery:n}=e,{der:i,recovered:o}=Object.assign({canonical:!0,der:!0},t),s=i?r.toDERRawBytes():r.toCompactRawBytes();return o?[s,n]:s}(a,r)}(P(e),P(this.#C),{recovered:!0,canonical:!0}),n=Qo.fromHex(t);return Po.from({r:W("0x"+n.r.toString(16),32),s:W("0x"+n.s.toString(16),32),v:r?28:27})}computeSharedSecret(e){const t=ta.computePublicKey(e);return C(function(e,t,r=!1){if(Es(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!Es(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=(i=t)instanceof Ko?(i.assertValidity(),i):Ko.fromHex(i);var i;return n.assertValidity(),n.multiply(As(e)).toRawBytes(r)}(P(this.#C),T(t)))}static computePublicKey(e,t){let r=T(e,"key");if(32===r.length)return C(function(e,t=!1){return Ko.fromPrivateKey(e).toRawBytes(t)}(r,!!t));if(64===r.length){const e=new Uint8Array(65);e[0]=4,e.set(r,1),r=e}return C(Ko.fromHex(r).toRawBytes(t))}static recoverPublicKey(e,t){w(32===R(e),"invalid digest length","digest",e);const r=Po.from(t),n=Qo.fromCompact(P(N([r.r,r.s]))).toDERRawBytes(),i=function(e,t,r,n=!1){return Ko.fromSignature(e,t,r).toRawBytes(n)}(P(e),n,r.yParity);return w(null!=i,"invalid signature for digest","signature",t),C(i)}static addPoints(e,t,r){const n=Ko.fromHex(ta.computePublicKey(e).substring(2)),i=Ko.fromHex(ta.computePublicKey(t).substring(2));return"0x"+n.add(i).toHex(!!r)}}function ra(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function na(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function ia(e,t,r,n){const i=[];for(;r<t+1+n;){const o=oa(e,r);i.push(o.result),v((r+=o.consumed)<=t+1+n,"child data too short","BUFFER_OVERRUN",{buffer:e,length:n,offset:t})}return{consumed:1+n,result:i}}function oa(e,t){v(0!==e.length,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const r=t=>{v(t<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:t})};if(e[t]>=248){const n=e[t]-247;r(t+1+n);const i=na(e,t+1,n);return r(t+1+n+i),ia(e,t,t+1+n,n+i)}if(e[t]>=192){const n=e[t]-192;return r(t+1+n),ia(e,t,t+1,n)}if(e[t]>=184){const n=e[t]-183;r(t+1+n);const i=na(e,t+1,n);return r(t+1+n+i),{consumed:1+n+i,result:C(e.slice(t+1+n,t+1+n+i))}}if(e[t]>=128){const n=e[t]-128;return r(t+1+n),{consumed:1+n,result:C(e.slice(t+1,t+1+n))}}return{consumed:1,result:ra(e[t])}}function sa(e){const t=T(e,"data"),r=oa(t,0);return w(r.consumed===t.length,"unexpected junk after rlp payload","data",e),r.result}function aa(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function ca(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(ca(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=aa(t.length);return r.unshift(247+r.length),r.concat(t)}const t=Array.prototype.slice.call(T(e,"object"));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=aa(t.length);return r.unshift(183+r.length),r.concat(t)}const ua="0123456789abcdef";function la(e){let t="0x";for(const r of ca(e))t+=ua[r>>4],t+=ua[15&r];return t}function fa(e){let t;return t="string"==typeof e?ta.computePublicKey(e,!1):e.publicKey,pt(at("0x"+t.substring(4)).substring(26))}const da=BigInt(0),ha=BigInt(2),pa=BigInt(27),ga=BigInt(28),ya=BigInt(35),ma=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function ba(e){return"0x"===e?null:pt(e)}function va(e,t){try{return rn(e)}catch(r){w(!1,r.message,t,e)}}function wa(e,t){return"0x"===e?0:V(e,t)}function Aa(e,t){if("0x"===e)return da;const r=H(e,t);return w(r<=ma,"value exceeds uint size",t,r),r}function Ea(e,t){const r=H(e,"value"),n=q(r);return w(n.length<=32,"value too large",`tx.${t}`,r),n}function _a(e){return rn(e).map((e=>[e.address,e.storageKeys]))}function Sa(e,t){const r=[Ea(e.nonce||0,"nonce"),Ea(e.gasPrice||0,"gasPrice"),Ea(e.gasLimit||0,"gasLimit"),null!=e.to?pt(e.to):"0x",Ea(e.value||0,"value"),e.data||"0x"];let n=da;if(e.chainId!=da)n=H(e.chainId,"tx.chainId"),w(!t||null==t.networkV||t.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const t=e.signature.legacyChainId;null!=t&&(n=t)}if(!t)return n!==da&&(r.push(q(n)),r.push("0x"),r.push("0x")),la(r);let i=BigInt(27+t.yParity);return n!==da?i=Po.getChainIdV(n,t.v):BigInt(t.v)!==i&&w(!1,"tx.chainId/sig.v mismatch","sig",t),r.push(q(i)),r.push(q(t.r)),r.push(q(t.s)),la(r)}function xa(e,t){let r;try{if(r=wa(t[0],"yParity"),0!==r&&1!==r)throw new Error("bad yParity")}catch(e){w(!1,"invalid yParity","yParity",t[0])}const n=L(t[1],32),i=L(t[2],32),o=Po.from({r:n,s:i,yParity:r});e.signature=o}function Ta(e,t){const r=[Ea(e.chainId||0,"chainId"),Ea(e.nonce||0,"nonce"),Ea(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Ea(e.maxFeePerGas||0,"maxFeePerGas"),Ea(e.gasLimit||0,"gasLimit"),null!=e.to?pt(e.to):"0x",Ea(e.value||0,"value"),e.data||"0x",_a(e.accessList||[])];return t&&(r.push(Ea(t.yParity,"yParity")),r.push(q(t.r)),r.push(q(t.s))),N(["0x02",la(r)])}function Pa(e,t){const r=[Ea(e.chainId||0,"chainId"),Ea(e.nonce||0,"nonce"),Ea(e.gasPrice||0,"gasPrice"),Ea(e.gasLimit||0,"gasLimit"),null!=e.to?pt(e.to):"0x",Ea(e.value||0,"value"),e.data||"0x",_a(e.accessList||[])];return t&&(r.push(Ea(t.yParity,"recoveryParam")),r.push(q(t.r)),r.push(q(t.s))),N(["0x01",la(r)])}class Ia{#N;#R;#t;#B;#M;#L;#F;#j;#U;#D;#Z;#H;get type(){return this.#N}set type(e){switch(e){case null:this.#N=null;break;case 0:case"legacy":this.#N=0;break;case 1:case"berlin":case"eip-2930":this.#N=1;break;case 2:case"london":case"eip-1559":this.#N=2;break;default:w(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559"}return null}get to(){return this.#R}set to(e){this.#R=null==e?null:pt(e)}get nonce(){return this.#B}set nonce(e){this.#B=V(e,"value")}get gasLimit(){return this.#M}set gasLimit(e){this.#M=H(e)}get gasPrice(){const e=this.#L;return null!=e||0!==this.type&&1!==this.type?e:da}set gasPrice(e){this.#L=null==e?null:H(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#F;return null==e?2===this.type?da:null:e}set maxPriorityFeePerGas(e){this.#F=null==e?null:H(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#j;return null==e?2===this.type?da:null:e}set maxFeePerGas(e){this.#j=null==e?null:H(e,"maxFeePerGas")}get data(){return this.#t}set data(e){this.#t=C(e)}get value(){return this.#U}set value(e){this.#U=H(e,"value")}get chainId(){return this.#D}set chainId(e){this.#D=H(e)}get signature(){return this.#Z||null}set signature(e){this.#Z=null==e?null:Po.from(e)}get accessList(){const e=this.#H||null;return null==e?1===this.type||2===this.type?[]:null:e}set accessList(e){this.#H=null==e?null:rn(e)}constructor(){this.#N=null,this.#R=null,this.#B=0,this.#M=BigInt(0),this.#L=null,this.#F=null,this.#j=null,this.#t="0x",this.#U=BigInt(0),this.#D=BigInt(0),this.#Z=null,this.#H=null}get hash(){return null==this.signature?null:at(this.serialized)}get unsignedHash(){return at(this.unsignedSerialized)}get from(){return null==this.signature?null:(e=this.unsignedHash,t=this.signature,fa(ta.recoverPublicKey(e,t)));var e,t}get fromPublicKey(){return null==this.signature?null:ta.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return null!=this.signature}get serialized(){switch(v(null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"}),this.inferType()){case 0:return Sa(this,this.signature);case 1:return Pa(this,this.signature);case 2:return Ta(this,this.signature)}v(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get unsignedSerialized(){switch(this.inferType()){case 0:return Sa(this);case 1:return Pa(this);case 2:return Ta(this)}v(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".unsignedSerialized"})}inferType(){return this.inferTypes().pop()}inferTypes(){const e=null!=this.gasPrice,t=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,r=null!=this.accessList;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&v(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),v(!t||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),v(0!==this.type||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const n=[];return null!=this.type?n.push(this.type):t?n.push(2):e?(n.push(1),r||n.push(0)):r?(n.push(1),n.push(2)):(n.push(0),n.push(1),n.push(2)),n.sort(),n}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}clone(){return Ia.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new Ia;if("string"==typeof e){const t=T(e);if(t[0]>=127)return Ia.from(function(e){const t=sa(e);w(Array.isArray(t)&&(9===t.length||6===t.length),"invalid field count for legacy transaction","data",e);const r={type:0,nonce:wa(t[0],"nonce"),gasPrice:Aa(t[1],"gasPrice"),gasLimit:Aa(t[2],"gasLimit"),to:ba(t[3]),value:Aa(t[4],"value"),data:C(t[5]),chainId:da};if(6===t.length)return r;const n=Aa(t[6],"v"),i=Aa(t[7],"r"),o=Aa(t[8],"s");if(i===da&&o===da)r.chainId=n;else{let i=(n-ya)/ha;i<da&&(i=da),r.chainId=i,w(i!==da||n===pa||n===ga,"non-canonical legacy v","v",t[6]),r.signature=Po.from({r:L(t[7],32),s:L(t[8],32),v:n}),r.hash=at(e)}return r}(t));switch(t[0]){case 1:return Ia.from(function(e){const t=sa(T(e).slice(1));w(Array.isArray(t)&&(8===t.length||11===t.length),"invalid field count for transaction type: 1","data",C(e));const r={type:1,chainId:Aa(t[0],"chainId"),nonce:wa(t[1],"nonce"),gasPrice:Aa(t[2],"gasPrice"),gasLimit:Aa(t[3],"gasLimit"),to:ba(t[4]),value:Aa(t[5],"value"),data:C(t[6]),accessList:va(t[7],"accessList")};return 8===t.length||(r.hash=at(e),xa(r,t.slice(8))),r}(t));case 2:return Ia.from(function(e){const t=sa(T(e).slice(1));w(Array.isArray(t)&&(9===t.length||12===t.length),"invalid field count for transaction type: 2","data",C(e));const r=Aa(t[2],"maxPriorityFeePerGas"),n=Aa(t[3],"maxFeePerGas"),i={type:2,chainId:Aa(t[0],"chainId"),nonce:wa(t[1],"nonce"),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Aa(t[4],"gasLimit"),to:ba(t[5]),value:Aa(t[6],"value"),data:C(t[7]),accessList:va(t[8],"accessList")};return 9===t.length||(i.hash=at(e),xa(i,t.slice(9))),i}(t))}v(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new Ia;return null!=e.type&&(t.type=e.type),null!=e.to&&(t.to=e.to),null!=e.nonce&&(t.nonce=e.nonce),null!=e.gasLimit&&(t.gasLimit=e.gasLimit),null!=e.gasPrice&&(t.gasPrice=e.gasPrice),null!=e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),null!=e.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null!=e.data&&(t.data=e.data),null!=e.value&&(t.value=e.value),null!=e.chainId&&(t.chainId=e.chainId),null!=e.signature&&(t.signature=Po.from(e.signature)),null!=e.accessList&&(t.accessList=e.accessList),null!=e.hash&&(w(t.isSigned(),"unsigned transaction cannot define hash","tx",e),w(t.hash===e.hash,"hash mismatch","tx",e)),null!=e.from&&(w(t.isSigned(),"unsigned transaction cannot define from","tx",e),w(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}let ka=async function(e,t){const r=e.url.split(":")[0].toLowerCase();let n;if(v("http"===r||"https"===r,`unsupported protocol ${r}`,"UNSUPPORTED_OPERATION",{info:{protocol:r},operation:"request"}),v("https"===r||!e.credentials||e.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"}),t){const e=new AbortController;n=e.signal,t.addListener((()=>{e.abort()}))}const i={method:e.method,headers:new Headers(Array.from(e)),body:e.body||void 0,signal:n},o=await fetch(e.url,i),s={};o.headers.forEach(((e,t)=>{s[t.toLowerCase()]=e}));const a=await o.arrayBuffer(),c=null==a?null:new Uint8Array(a);return{statusCode:o.status,statusMessage:o.statusText,headers:s,body:c}};const Oa=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Ca=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Na=!1;async function Ra(e,t){try{const t=e.match(Oa);if(!t)throw new Error("invalid data");return new Da(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?function(e){e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return T(t)}(t[3]):Ft(t[3].replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))}catch(t){return new Da(599,"BAD REQUEST (invalid data: URI)",{},null,new Ua(e))}}function Ba(e){return async function(t,r){try{const r=t.match(Ca);if(!r)throw new Error("invalid link");return new Ua(`${e}${r[2]}`)}catch(e){return new Da(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Ua(t))}}}const Ma={data:Ra,ipfs:Ba("https://gateway.ipfs.io/ipfs/")},La=new WeakMap;class Fa{#$;#G;constructor(e){this.#$=[],this.#G=!1,La.set(e,(()=>{if(!this.#G){this.#G=!0;for(const e of this.#$)setTimeout((()=>{e()}),0);this.#$=[]}}))}addListener(e){v(!this.#G,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#$.push(e)}get cancelled(){return this.#G}checkSignal(){v(!this.cancelled,"cancelled","CANCELLED",{})}}function ja(e){if(null==e)throw new Error("missing signal; should not happen");return e.checkSignal(),e}class Ua{#z;#V;#W;#q;#K;#J;#Y;#Q;#X;#ee;#te;#re;#ne;#ie;get url(){return this.#J}set url(e){this.#J=String(e)}get body(){return null==this.#Y?null:new Uint8Array(this.#Y)}set body(e){if(null==e)this.#Y=void 0,this.#Q=void 0;else if("string"==typeof e)this.#Y=Ft(e),this.#Q="text/plain";else if(e instanceof Uint8Array)this.#Y=e,this.#Q="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#Y=Ft(JSON.stringify(e)),this.#Q="application/json"}}hasBody(){return null!=this.#Y}get method(){return this.#q?this.#q:this.hasBody()?"POST":"GET"}set method(e){null==e&&(e=""),this.#q=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#W);return this.#X&&(e.authorization=`Basic ${function(e){const t=T(e);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}(Ft(this.#X))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),null==e["content-type"]&&this.#Q&&(e["content-type"]=this.#Q),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#W[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#W={}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r<t.length){const n=t[r++];return{value:[n,e[n]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#X||null}setCredentials(e,t){w(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#X=`${e}:${t}`}get allowGzip(){return this.#V}set allowGzip(e){this.#V=!!e}get allowInsecureAuthentication(){return!!this.#z}set allowInsecureAuthentication(e){this.#z=!!e}get timeout(){return this.#K}set timeout(e){w(e>=0,"timeout must be non-zero","timeout",e),this.#K=e}get preflightFunc(){return this.#ee||null}set preflightFunc(e){this.#ee=e}get processFunc(){return this.#te||null}set processFunc(e){this.#te=e}get retryFunc(){return this.#re||null}set retryFunc(e){this.#re=e}constructor(e){this.#J=String(e),this.#z=!1,this.#V=!0,this.#W={},this.#q="",this.#K=3e5,this.#ie={slotInterval:250,maxAttempts:12}}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#Y?C(this.#Y):"null"}>`}setThrottleParams(e){null!=e.slotInterval&&(this.#ie.slotInterval=e.slotInterval),null!=e.maxAttempts&&(this.#ie.maxAttempts=e.maxAttempts)}async#oe(e,t,r,n,i){if(e>=this.#ie.maxAttempts)return i.makeServerError("exceeded maximum retry limit");v(Za()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:n}),r>0&&await function(e){return new Promise((t=>setTimeout(t,e)))}(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in Ma){const e=await Ma[s](o.url,ja(n.#ne));if(e instanceof Da){let t=e;if(this.processFunc){ja(n.#ne);try{t=await this.processFunc(o,t)}catch(e){null!=e.throttle&&"number"==typeof e.stall||t.makeServerError("error in post-processing function",e).assertOk()}}return t}o=e}this.preflightFunc&&(o=await this.preflightFunc(o));const a=await ka(o,ja(n.#ne));let c=new Da(a.statusCode,a.statusMessage,a.headers,a.body,n);if(301===c.statusCode||302===c.statusCode){try{const r=c.headers.location||"";return o.redirect(r).#oe(e+1,t,0,n,c)}catch(e){}return c}if(429===c.statusCode&&(null==this.retryFunc||await this.retryFunc(o,c,e))){const r=c.headers["retry-after"];let i=this.#ie.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof r&&r.match(/^[1-9][0-9]*$/)&&(i=parseInt(r)),o.clone().#oe(e+1,t,i,n,c)}if(this.processFunc){ja(n.#ne);try{c=await this.processFunc(o,c)}catch(r){null!=r.throttle&&"number"==typeof r.stall||c.makeServerError("error in post-processing function",r).assertOk();let i=this.#ie.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return r.stall>=0&&(i=r.stall),o.clone().#oe(e+1,t,i,n,c)}}return c}send(){return v(null==this.#ne,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#ne=new Fa(this),this.#oe(0,Za()+this.timeout,0,this,new Da(0,"",{},null,this))}cancel(){v(null!=this.#ne,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=La.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();v("GET"===this.method&&("https"!==t||"http"!==r)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const n=new Ua(e);return n.method="GET",n.allowGzip=this.allowGzip,n.timeout=this.timeout,n.#W=Object.assign({},this.#W),this.#Y&&(n.#Y=new Uint8Array(this.#Y)),n.#Q=this.#Q,n}clone(){const e=new Ua(this.url);return e.#q=this.#q,this.#Y&&(e.#Y=this.#Y),e.#Q=this.#Q,e.#W=Object.assign({},this.#W),e.#X=this.#X,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#ee=this.#ee,e.#te=this.#te,e.#re=this.#re,e}static lockConfig(){Na=!0}static getGateway(e){return Ma[e.toLowerCase()]||null}static registerGateway(e,t){if("http"===(e=e.toLowerCase())||"https"===e)throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Na)throw new Error("gateways locked");Ma[e]=t}static registerGetUrl(e){if(Na)throw new Error("gateways locked");ka=e}static createDataGateway(){return Ra}static createIpfsGatewayFunc(e){return Ba(e)}}class Da{#se;#ae;#W;#Y;#ce;#ue;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#Y?C(this.#Y):"null"}>`}get statusCode(){return this.#se}get statusMessage(){return this.#ae}get headers(){return Object.assign({},this.#W)}get body(){return null==this.#Y?null:new Uint8Array(this.#Y)}get bodyText(){try{return null==this.#Y?"":jt(this.#Y)}catch(e){v(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){v(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r<t.length){const n=t[r++];return{value:[n,e[n]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,r,n,i){this.#se=e,this.#ae=t,this.#W=Object.keys(r).reduce(((e,t)=>(e[t.toLowerCase()]=String(r[t]),e)),{}),this.#Y=null==n?null:new Uint8Array(n),this.#ce=i||null,this.#ue={message:""}}makeServerError(e,t){let r;r=e?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:`CLIENT ESCALATED SERVER ERROR (${e=`${this.statusCode} ${this.statusMessage}`})`;const n=new Da(599,r,this.headers,this.body,this.#ce||void 0);return n.#ue={message:e,error:t},n}throwThrottleError(e,t){null==t?t=-1:w(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);const r=new Error(e||"throttling requests");throw p(r,{stall:t,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return null!=this.#Y}get request(){return this.#ce}ok(){return""===this.#ue.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#ue;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`),v(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t})}}function Za(){return(new Date).getTime()}const Ha="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let $a=null;function Ga(e){if(null==$a){$a={};for(let e=0;e<Ha.length;e++)$a[Ha[e]]=BigInt(e)}const t=$a[e];return w(null!=t,"invalid base58 value","letter",e),t}const za=BigInt(0),Va=BigInt(58);function Wa(e){let t=z(T(e)),r="";for(;t;)r=Ha[Number(t%Va)]+r,t/=Va;return r}function qa(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):w(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class Ka{name;constructor(e){p(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const Ja=new RegExp("^(ipfs)://(.*)$","i"),Ya=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Ja,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class Qa{provider;address;name;#le;#fe;constructor(e,t,r){p(this,{provider:e,address:t,name:r}),this.#le=null,this.#fe=new Jn(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return null==this.#le&&(this.#le=(async()=>{try{return await this.#fe.supportsInterface("0x9061b923")}catch(e){if(y(e,"CALL_EXCEPTION"))return!1;throw this.#le=null,e}})()),await this.#le}async#de(e,t){t=(t||[]).slice();const r=this.#fe.interface;t.unshift(mo(this.name));let n=null;var i;await this.supportsWildcard()&&(n=r.getFunction(e),v(n,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[(i=this.name,C(N(yo(i).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),r.encodeFunctionData(n,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{const i=await this.#fe[e](...t);return n?r.decodeFunctionResult(n,i)[0]:i}catch(e){if(!y(e,"CALL_EXCEPTION"))throw e}return null}async getAddress(e){if(null==e&&(e=60),60===e)try{const e=await this.#de("addr(bytes32)");return null==e||e===nn?null:e}catch(e){if(y(e,"CALL_EXCEPTION"))return null;throw e}if(e>=0&&e<2147483648){let t=e+2147483648;const r=await this.#de("addr(bytes32,uint)",[t]);if(I(r,20))return pt(r)}let t=null;for(const r of this.provider.plugins)if(r instanceof Ka&&r.supportsCoinType(e)){t=r;break}if(null==t)return null;const r=await this.#de("addr(bytes32,uint)",[e]);if(null==r||"0x"===r)return null;const n=await t.decodeAddress(e,r);if(null!=n)return n;v(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const t=await this.#de("text(bytes32,string)",[e]);return null==t||"0x"===t?null:t}async getContentHash(){const e=await this.#de("contenthash(bytes32)");if(null==e||"0x"===e)return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e="e3010170"===t[1]?"ipfs":"ipns",r=parseInt(t[4],16);if(t[5].length===2*r)return`${e}://${Wa("0x"+t[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return`bzz://${r[1]}`;v(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(null==t)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let r=0;r<Ya.length;r++){const n=t.match(Ya[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{const r=qa(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:r}),{linkage:e,url:r}}case"erc721":case"erc1155":{const r="erc721"===i?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:t});const o=await this.getAddress();if(null==o)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const s=(n[2]||"").split("/");if(2!==s.length)return e.push({type:`!${i}caip`,value:n[2]||""}),{url:null,linkage:e};const a=s[1],c=new Jn(s[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if("erc721"===i){const t=await c.ownerOf(a);if(o!==t)return e.push({type:"!owner",value:t}),{url:null,linkage:e};e.push({type:"owner",value:t})}else if("erc1155"===i){const t=await c.balanceOf(o,a);if(!t)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:t.toString()})}let u=await c[r](a);if(null==u||"0x"===u)return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:u}),"erc1155"===i&&(u=u.replace("{id}",W(a,32).substring(2)),e.push({type:"metadata-url-expanded",value:u})),u.match(/^ipfs:/i)&&(u=qa(u)),e.push({type:"metadata-url",value:u});let l={};const f=await new Ua(u).send();f.assertOk();try{l=f.bodyJson}catch(t){try{e.push({type:"!metadata",value:f.bodyText})}catch(t){const r=f.body;return r&&e.push({type:"!metadata",value:C(r)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!l)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(l)});let d=l.image;if("string"!=typeof d)return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(d.match(/^(https:\/\/|data:)/i));else{if(null==d.match(Ja))return e.push({type:"!imageUrl-ipfs",value:d}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:d}),d=qa(d)}return e.push({type:"url",value:d}),{linkage:e,url:d}}}}}catch(e){}return{linkage:e,url:null}}static async getEnsAddress(e){const t=await e.getNetwork(),r=t.getPlugin("org.ethers.plugins.network.Ens");return v(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),r.address}static async#he(e,t){const r=await Qa.getEnsAddress(e);try{const n=new Jn(r,["function resolver(bytes32) view returns (address)"],e),i=await n.resolver(mo(t),{enableCcipRead:!0});return i===nn?null:i}catch(e){throw e}return null}static async fromName(e,t){let r=t;for(;;){if(""===r||"."===r)return null;if("eth"!==t&&"eth"===r)return null;const n=await Qa.#he(e,r);if(null!=n){const i=new Qa(e,n,t);return r===t||await i.supportsWildcard()?i:null}r=r.split(".").slice(1).join(".")}}}const Xa=BigInt(0);function ec(e,t){return function(r){return null==r?t:e(r)}}function tc(e){return t=>{if(!Array.isArray(t))throw new Error("not an array");return t.map((t=>e(t)))}}function rc(e,t){return r=>{const n={};for(const i in e){let o=i;if(t&&i in t&&!(o in r))for(const e of t[i])if(e in r){o=e;break}try{const t=e[i](r[o]);void 0!==t&&(n[i]=t)}catch(e){v(!1,`invalid value for value.${i} (${e instanceof Error?e.message:"not-an-error"})`,"BAD_DATA",{value:r})}}return n}}function nc(e){return w(I(e,!0),"invalid data","value",e),e}function ic(e){return w(I(e,32),"invalid hash","value",e),e}const oc=rc({address:pt,blockHash:ic,blockNumber:V,data:nc,index:V,removed:ec((function(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}w(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}),!1),topics:tc(ic),transactionHash:ic,transactionIndex:V},{index:["logIndex"]}),sc=rc({hash:ec(ic),parentHash:ic,number:V,timestamp:V,nonce:ec(nc),difficulty:H,gasLimit:H,gasUsed:H,miner:ec(pt),extraData:nc,baseFeePerGas:ec(H)}),ac=rc({transactionIndex:V,blockNumber:V,transactionHash:ic,address:pt,topics:tc(ic),data:nc,index:V,blockHash:ic},{index:["logIndex"]}),cc=rc({to:ec(pt,null),from:ec(pt,null),contractAddress:ec(pt,null),index:V,root:ec(C),gasUsed:H,logsBloom:ec(nc),blockHash:ic,hash:ic,logs:tc((function(e){return ac(e)})),blockNumber:V,cumulativeGasUsed:H,effectiveGasPrice:ec(H),status:ec(V),type:ec(V,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function uc(e){e.to&&H(e.to)===Xa&&(e.to="0x0000000000000000000000000000000000000000");const t=rc({hash:ic,type:e=>"0x"===e||null==e?0:V(e),accessList:ec(rn,null),blockHash:ec(ic,null),blockNumber:ec(V,null),transactionIndex:ec(V,null),from:pt,gasPrice:ec(H),maxPriorityFeePerGas:ec(H),maxFeePerGas:ec(H),gasLimit:H,to:ec(pt,null),value:H,nonce:V,data:nc,creates:ec(pt,null),chainId:ec(H,null)},{data:["input"],gasLimit:["gas"]})(e);if(null==t.to&&null==t.creates&&(t.creates=function(e){const t=pt(e.from);let r=H(e.nonce,"tx.nonce").toString(16);return r="0"===r?"0x":r.length%2?"0x0"+r:"0x"+r,pt(B(at(la([t,r])),12))}(t)),1!==e.type&&2!==e.type||null!=e.accessList||(t.accessList=[]),e.signature?t.signature=Po.from(e.signature):t.signature=Po.from(e),null==t.chainId){const e=t.signature.legacyChainId;null!=e&&(t.chainId=e)}return t.blockHash&&H(t.blockHash)===Xa&&(t.blockHash=null),t}class lc{name;constructor(e){p(this,{name:e})}clone(){return new lc(this.name)}}class fc extends lc{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){null==e&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const r={effectiveBlock:e};function n(e,n){let i=(t||{})[e];null==i&&(i=n),w("number"==typeof i,`invalud value for ${e}`,"costs",t),r[e]=i}n("txBase",21e3),n("txCreate",32e3),n("txDataZero",4),n("txDataNonzero",16),n("txAccessListStorageKey",1900),n("txAccessListAddress",2400),p(this,r)}clone(){return new fc(this.effectiveBlock,this)}}class dc extends lc{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),p(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==t?1:t})}clone(){return new dc(this.address,this.targetNetwork)}}class hc extends lc{#J;#pe;get url(){return this.#J}get processFunc(){return this.#pe}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#J=e,this.#pe=t}clone(){return this}}const pc=new Map;class gc{#ge;#D;#ye;constructor(e,t){this.#ge=e,this.#D=H(t),this.#ye=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#ge}set name(e){this.#ge=e}get chainId(){return this.#D}set chainId(e){this.#D=H(e,"chainId")}matches(e){if(null==e)return!1;if("string"==typeof e){try{return this.chainId===H(e)}catch(e){}return this.name===e}if("number"==typeof e||"bigint"==typeof e){try{return this.chainId===H(e)}catch(e){}return!1}if("object"==typeof e){if(null!=e.chainId){try{return this.chainId===H(e.chainId)}catch(e){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(this.#ye.values())}attachPlugin(e){if(this.#ye.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#ye.set(e.name,e.clone()),this}getPlugin(e){return this.#ye.get(e)||null}getPlugins(e){return this.plugins.filter((t=>t.name.split("#")[0]===e))}clone(){const e=new gc(this.name,this.chainId);return this.plugins.forEach((t=>{e.attachPlugin(t.clone())})),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new fc;let r=t.txBase;if(null==e.to&&(r+=t.txCreate),e.data)for(let n=2;n<e.data.length;n+=2)"00"===e.data.substring(n,n+2)?r+=t.txDataZero:r+=t.txDataNonzero;if(e.accessList){const n=rn(e.accessList);for(const e in n)r+=t.txAccessListAddress+t.txAccessListStorageKey*n[e].storageKeys.length}return r}static from(e){if(function(){var e;bc||(bc=!0,t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[mc("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[mc("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[(e=BigInt("1000000"),new hc("data:",(async(t,r,n)=>{const i=await t();if(null==i.maxFeePerGas||null==i.maxPriorityFeePerGas)return i;const o=i.maxFeePerGas-i.maxPriorityFeePerGas;return{gasPrice:i.gasPrice,maxFeePerGas:o+e,maxPriorityFeePerGas:e}})))]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1}));function t(e,t,r){const n=function(){const n=new gc(e,t);return null!=r.ensNetwork&&n.attachPlugin(new dc(null,r.ensNetwork)),n.attachPlugin(new fc),(r.plugins||[]).forEach((e=>{n.attachPlugin(e)})),n};gc.register(e,n),gc.register(t,n),r.altNames&&r.altNames.forEach((e=>{gc.register(e,n)}))}}(),null==e)return gc.from("mainnet");if("number"==typeof e&&(e=BigInt(e)),"string"==typeof e||"bigint"==typeof e){const t=pc.get(e);if(t)return t();if("bigint"==typeof e)return new gc("unknown",e);w(!1,"unknown network","network",e)}if("function"==typeof e.clone)return e.clone();if("object"==typeof e){w("string"==typeof e.name&&"number"==typeof e.chainId,"invalid network object name or chainId","network",e);const t=new gc(e.name,e.chainId);return(e.ensAddress||null!=e.ensNetwork)&&t.attachPlugin(new dc(e.ensAddress,e.ensNetwork)),t}w(!1,"invalid network","network",e)}static register(e,t){"number"==typeof e&&(e=BigInt(e));const r=pc.get(e);r&&w(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),pc.set(e,t)}}function yc(e,t){const r=String(e);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const n=r.split(".");if(1===n.length&&n.push(""),2!==n.length)throw new Error(`invalid gwei value: ${e}`);for(;n[1].length<t;)n[1]+="0";if(n[1].length>9){let e=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||e++,n[1]=e.toString()}return BigInt(n[0]+n[1])}function mc(e){return new hc(e,(async(e,t,r)=>{let n;r.setHeader("User-Agent","ethers");try{const[t,i]=await Promise.all([r.send(),e()]);n=t;const o=n.bodyJson.standard;return{gasPrice:i.gasPrice,maxFeePerGas:yc(o.maxFee,9),maxPriorityFeePerGas:yc(o.maxPriorityFee,9)}}catch(e){v(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:n,error:e})}}))}let bc=!1;function vc(e){return JSON.parse(JSON.stringify(e))}class wc{#me;#be;#ve;#we;constructor(e){this.#me=e,this.#be=null,this.#ve=4e3,this.#we=-2}get pollingInterval(){return this.#ve}set pollingInterval(e){this.#ve=e}async#Ae(){try{const e=await this.#me.getBlockNumber();if(-2===this.#we)return void(this.#we=e);if(e!==this.#we){for(let t=this.#we+1;t<=e;t++){if(null==this.#be)return;await this.#me.emit("block",t)}this.#we=e}}catch(e){}null!=this.#be&&(this.#be=this.#me._setTimeout(this.#Ae.bind(this),this.#ve))}start(){this.#be||(this.#be=this.#me._setTimeout(this.#Ae.bind(this),this.#ve),this.#Ae())}stop(){this.#be&&(this.#me._clearTimeout(this.#be),this.#be=null)}pause(e){this.stop(),e&&(this.#we=-2)}resume(){this.start()}}class Ac{#me;#Ae;#Ee;constructor(e){this.#me=e,this.#Ee=!1,this.#Ae=e=>{this._poll(e,this.#me)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#Ee||(this.#Ee=!0,this.#Ae(-2),this.#me.on("block",this.#Ae))}stop(){this.#Ee&&(this.#Ee=!1,this.#me.off("block",this.#Ae))}pause(e){this.stop()}resume(){this.start()}}class Ec extends Ac{#T;constructor(e,t){super(e),this.#T=vc(t)}async _poll(e,t){throw new Error("@TODO")}}class _c extends Ac{#_e;constructor(e,t){super(e),this.#_e=t}async _poll(e,t){const r=await t.getTransactionReceipt(this.#_e);r&&t.emit(this.#_e,r)}}class Sc{#me;#T;#be;#Ee;#we;constructor(e,t){this.#me=e,this.#T=vc(t),this.#be=this.#Ae.bind(this),this.#Ee=!1,this.#we=-2}async#Ae(e){if(-2===this.#we)return;const t=vc(this.#T);t.fromBlock=this.#we+1,t.toBlock=e;const r=await this.#me.getLogs(t);if(0!==r.length)for(const e of r)this.#me.emit(this.#T,e),this.#we=e.blockNumber;else this.#we<e-60&&(this.#we=e-60)}start(){this.#Ee||(this.#Ee=!0,-2===this.#we&&this.#me.getBlockNumber().then((e=>{this.#we=e})),this.#me.on("block",this.#be))}stop(){this.#Ee&&(this.#Ee=!1,this.#me.off("block",this.#be))}pause(e){this.stop(),e&&(this.#we=-2)}resume(){this.start()}}const xc=BigInt(2);function Tc(e){return e&&"function"==typeof e.then}function Pc(e,t){return e+":"+JSON.stringify(t,((e,t)=>{if(null==t)return"null";if("bigint"==typeof t)return`bigint:${t.toString()}`;if("string"==typeof t)return t.toLowerCase();if("object"==typeof t&&!Array.isArray(t)){const e=Object.keys(t);return e.sort(),e.reduce(((e,r)=>(e[r]=t[r],e)),{})}return t}))}class Ic{name;constructor(e){p(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function kc(e){return(e=Array.from(new Set(e).values())).sort(),e}async function Oc(e,t){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"==typeof e)switch(e){case"block":case"pending":case"debug":case"error":case"network":return{type:e,tag:e}}if(I(e,32)){const t=e.toLowerCase();return{type:"transaction",tag:Pc("tx",{hash:t}),hash:t}}if(e.orphan){const t=e;return{type:"orphan",tag:Pc("orphan",t),filter:(r=t,JSON.parse(JSON.stringify(r)))}}var r;if(e.address||e.topics){const r=e,n={topics:(r.topics||[]).map((e=>null==e?null:Array.isArray(e)?kc(e.map((e=>e.toLowerCase()))):e.toLowerCase()))};if(r.address){const e=[],i=[],o=r=>{I(r)?e.push(r):i.push((async()=>{e.push(await Dr(r,t))})())};Array.isArray(r.address)?r.address.forEach(o):o(r.address),i.length&&await Promise.all(i),n.address=kc(e.map((e=>e.toLowerCase())))}return{filter:n,tag:Pc("event",n),type:"event"}}w(!1,"unknown ProviderEvent","event",e)}function Cc(){return(new Date).getTime()}const Nc={cacheTimeout:250,pollingInterval:4e3};class Rc{#Se;#ye;#xe;#Te;#Pe;#Ie;#ke;#Oe;#Ce;#Ne;#Re;#s;constructor(e,t){if(this.#s=Object.assign({},Nc,t||{}),"any"===e)this.#Ie=!0,this.#Pe=null;else if(e){const t=gc.from(e);this.#Ie=!1,this.#Pe=Promise.resolve(t),setTimeout((()=>{this.emit("network",t,null)}),0)}else this.#Ie=!1,this.#Pe=null;this.#Oe=-1,this.#ke=new Map,this.#Se=new Map,this.#ye=new Map,this.#xe=null,this.#Te=!1,this.#Ce=1,this.#Ne=new Map,this.#Re=!1}get pollingInterval(){return this.#s.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#ye.values())}attachPlugin(e){if(this.#ye.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#ye.set(e.name,e.connect(this)),this}getPlugin(e){return this.#ye.get(e)||null}get disableCcipRead(){return this.#Re}set disableCcipRead(e){this.#Re=!!e}async#Be(e){const t=this.#s.cacheTimeout;if(t<0)return await this._perform(e);const r=Pc(e.method,e);let n=this.#ke.get(r);return n||(n=this._perform(e),this.#ke.set(r,n),setTimeout((()=>{this.#ke.get(r)===n&&this.#ke.delete(r)}),t)),await n}async ccipReadFetch(e,t,r){if(this.disableCcipRead||0===r.length||null==e.to)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let t=0;t<r.length;t++){const s=r[t],a=s.replace("{sender}",n).replace("{data}",i),c=new Ua(a);-1===s.indexOf("{data}")&&(c.body={data:i,sender:n}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:c,index:t,urls:r});let u="unknown error";const l=await c.send();try{const e=l.bodyJson;if(e.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:c,result:e}),e.data;e.message&&(u=e.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:c,result:e})}catch(e){}v(l.statusCode<400||l.statusCode>=500,`response not found during CCIP fetch: ${u}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:s,errorMessage:u}}),o.push(u)}v(!1,`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,t){return new mn(function(e){const t=sc(e);return t.transactions=e.transactions.map((e=>"string"==typeof e?e:uc(e))),t}(e),this)}_wrapLog(e,t){return new bn(function(e){return oc(e)}(e),this)}_wrapTransactionReceipt(e,t){return new vn(function(e){return cc(e)}(e),this)}_wrapTransactionResponse(e,t){return new wn(uc(e),this)}_detectNetwork(){v(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){v(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=V(await this.#Be({method:"getBlockNumber"}),"%response");return this.#Oe>=0&&(this.#Oe=e),e}_getAddress(e){return Dr(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}return I(e)?I(e,32)?e:K(e):("bigint"==typeof e&&(e=V(e,"blockTag")),"number"==typeof e?e>=0?K(e):this.#Oe>=0?K(this.#Oe+e):this.getBlockNumber().then((t=>K(t+e))):void w(!1,"invalid blockTag","blockTag",e))}_getFilter(e){const t=(e.topics||[]).map((e=>null==e?null:Array.isArray(e)?kc(e.map((e=>e.toLowerCase()))):e.toLowerCase())),r="blockHash"in e?e.blockHash:void 0,n=(e,n,i)=>{let o;switch(e.length){case 0:break;case 1:o=e[0];break;default:e.sort(),o=e}if(r&&(null!=n||null!=i))throw new Error("invalid filter");const s={};return o&&(s.address=o),t.length&&(s.topics=t),n&&(s.fromBlock=n),i&&(s.toBlock=i),r&&(s.blockHash=r),s};let i,o,s=[];if(e.address)if(Array.isArray(e.address))for(const t of e.address)s.push(this._getAddress(t));else s.push(this._getAddress(e.address));return"fromBlock"in e&&(i=this._getBlockTag(e.fromBlock)),"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),s.filter((e=>"string"!=typeof e)).length||null!=i&&"string"!=typeof i||null!=o&&"string"!=typeof o?Promise.all([Promise.all(s),i,o]).then((e=>n(e[0],e[1],e[2]))):n(s,i,o)}_getTransactionRequest(e){const t=yn(e),r=[];if(["to","from"].forEach((e=>{if(null==t[e])return;const n=Dr(t[e]);Tc(n)?r.push(async function(){t[e]=await n}()):t[e]=n})),null!=t.blockTag){const e=this._getBlockTag(t.blockTag);Tc(e)?r.push(async function(){t.blockTag=await e}()):t.blockTag=e}return r.length?async function(){return await Promise.all(r),t}():t}async getNetwork(){if(null==this.#Pe){const e=this._detectNetwork().then((e=>(this.emit("network",e,null),e)),(t=>{throw this.#Pe===e&&(this.#Pe=null),t}));return this.#Pe=e,(await e).clone()}const e=this.#Pe,[t,r]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==r.chainId&&(this.#Ie?(this.emit("network",r,t),this.#Pe===e&&(this.#Pe=Promise.resolve(r))):v(!1,`network changed: ${t.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:t,gasPrice:r}=await h({_block:this.#Me("latest",!1),gasPrice:(async()=>{try{return H(await this.#Be({method:"getGasPrice"}),"%response")}catch(e){}return null})()});let n=null,i=null;const o=this._wrapBlock(t,e);return o&&o.baseFeePerGas&&(i=BigInt("1000000000"),n=o.baseFeePerGas*xc+i),new gn(r,n,i)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const e=new Ua(r.url),n=await r.processFunc(t,this,e);return new gn(n.gasPrice,n.maxFeePerGas,n.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return Tc(t)&&(t=await t),H(await this.#Be({method:"estimateGas",transaction:t}),"%response")}async#Le(e,t,r){v(r<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});const n=yn(e);try{return C(await this._perform({method:"call",transaction:n,blockTag:t}))}catch(e){if(!this.disableCcipRead&&m(e)&&e.data&&r>=0&&"latest"===t&&null!=n.to&&"0x556f1830"===B(e.data,0,4)){const i=e.data,o=await Dr(n.to,this);let s;try{s=function(e){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};v(R(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=B(e,0,32);v(B(r,0,12)===B(Dc,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=B(r,12);try{const r=[],n=V(B(e,32,64)),i=V(B(e,n,n+32)),o=B(e,n+32);for(let e=0;e<i;e++){const t=Bc(o,32*e);if(null==t)throw new Error("abort");r.push(t)}t.urls=r}catch(e){v(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=Mc(e,64);if(null==r)throw new Error("abort");t.calldata=r}catch(e){v(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}v(B(e,100,128)===B(Dc,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=B(e,96,100);try{const r=Mc(e,128);if(null==r)throw new Error("abort");t.extraData=r}catch(e){v(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return t.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map((e=>t[e])),t}(B(e.data,4))}catch(e){v(!1,e.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:n,info:{data:i}})}v(s.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:i,reason:"OffchainLookup",transaction:n,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:s.errorArgs}});const a=await this.ccipReadFetch(n,s.calldata,s.urls);v(null!=a,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:n,info:{data:e.data,errorArgs:s.errorArgs}});const c={to:o,data:N([s.selector,Uc([a,s.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const e=await this.#Le(c,t,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},c),result:e}),e}catch(e){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},c),error:e}),e}}throw e}}async#Fe(e){const{value:t}=await h({network:this.getNetwork(),value:e});return t}async call(e){const{tx:t,blockTag:r}=await h({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#Fe(this.#Le(t,r,e.enableCcipRead?0:-1))}async#je(e,t,r){let n=this._getAddress(t),i=this._getBlockTag(r);return"string"==typeof n&&"string"==typeof i||([n,i]=await Promise.all([n,i])),await this.#Fe(this.#Be(Object.assign(e,{address:n,blockTag:i})))}async getBalance(e,t){return H(await this.#je({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return V(await this.#je({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return C(await this.#je({method:"getCode"},e,t))}async getStorage(e,t,r){const n=H(t,"position");return C(await this.#je({method:"getStorage",position:n},e,r))}async broadcastTransaction(e){const{blockNumber:t,hash:r,network:n}=await h({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=Ia.from(e);if(i.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,n).replaceableTransaction(t)}async#Me(e,t){if(I(e,32))return await this.#Be({method:"getBlock",blockHash:e,includeTransactions:t});let r=this._getBlockTag(e);return"string"!=typeof r&&(r=await r),await this.#Be({method:"getBlock",blockTag:r,includeTransactions:t})}async getBlock(e,t){const{network:r,params:n}=await h({network:this.getNetwork(),params:this.#Me(e,!!t)});return null==n?null:this._wrapBlock(n,r)}async getTransaction(e){const{network:t,params:r}=await h({network:this.getNetwork(),params:this.#Be({method:"getTransaction",hash:e})});return null==r?null:this._wrapTransactionResponse(r,t)}async getTransactionReceipt(e){const{network:t,params:r}=await h({network:this.getNetwork(),params:this.#Be({method:"getTransactionReceipt",hash:e})});if(null==r)return null;if(null==r.gasPrice&&null==r.effectiveGasPrice){const t=await this.#Be({method:"getTransaction",hash:e});if(null==t)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=t.gasPrice}return this._wrapTransactionReceipt(r,t)}async getTransactionResult(e){const{result:t}=await h({network:this.getNetwork(),result:this.#Be({method:"getTransactionResult",hash:e})});return null==t?null:C(t)}async getLogs(e){let t=this._getFilter(e);Tc(t)&&(t=await t);const{network:r,params:n}=await h({network:this.getNetwork(),params:this.#Be({method:"getLogs",filter:t})});return n.map((e=>this._wrapLog(e,r)))}_getProvider(e){v(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Qa.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){const t=mo((e=pt(e)).substring(2).toLowerCase()+".addr.reverse");try{const r=await Qa.getEnsAddress(this),n=new Jn(r,["function resolver(bytes32) view returns (address)"],this),i=await n.resolver(t);if(null==i||i===nn)return null;const o=new Jn(i,["function name(bytes32) view returns (string)"],this),s=await o.name(t);return await this.resolveName(s)!==e?null:s}catch(e){if(y(e,"BAD_DATA")&&"0x"===e.value)return null;if(y(e,"CALL_EXCEPTION"))return null;throw e}return null}async waitForTransaction(e,t,r){const n=null!=t?t:1;return 0===n?this.getTransactionReceipt(e):new Promise((async(t,i)=>{let o=null;const s=async r=>{try{const i=await this.getTransactionReceipt(e);if(null!=i&&r-i.blockNumber+1>=n)return t(i),void(o&&(clearTimeout(o),o=null))}catch(e){console.log("EEE",e)}this.once("block",s)};null!=r&&(o=setTimeout((()=>{null!=o&&(o=null,this.off("block",s),i(b("timeout","TIMEOUT",{reason:"timeout"})))}),r)),s(await this.getBlockNumber())}))}async waitForBlock(e){v(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=this.#Ne.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#Ne.delete(e))}_setTimeout(e,t){null==t&&(t=0);const r=this.#Ce++,n=()=>{this.#Ne.delete(r),e()};if(this.paused)this.#Ne.set(r,{timer:null,func:n,time:t});else{const e=setTimeout(n,t);this.#Ne.set(r,{timer:e,func:n,time:Cc()})}return r}_forEachSubscriber(e){for(const t of this.#Se.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Ic(e.type);case"block":{const e=new wc(this);return e.pollingInterval=this.pollingInterval,e}case"event":return new Sc(this,e.filter);case"transaction":return new _c(this,e.hash);case"orphan":return new Ec(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const r of this.#Se.values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=t,r.started&&t.start(),null!=this.#xe&&t.pause(this.#xe);break}}async#Ue(e,t){let r=await Oc(e,this);return"event"===r.type&&t&&t.length>0&&!0===t[0].removed&&(r=await Oc({orphan:"drop-log",log:t[0]},this)),this.#Se.get(r.tag)||null}async#De(e){const t=await Oc(e,this),r=t.tag;let n=this.#Se.get(r);return n||(n={subscriber:this._getSubscriber(t),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#Se.set(r,n)),n}async on(e,t){const r=await this.#De(e);return r.listeners.push({listener:t,once:!1}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#xe&&r.subscriber.pause(this.#xe)),this}async once(e,t){const r=await this.#De(e);return r.listeners.push({listener:t,once:!0}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#xe&&r.subscriber.pause(this.#xe)),this}async emit(e,...t){const r=await this.#Ue(e,t);if(!r||0===r.listeners.length)return!1;const n=r.listeners.length;return r.listeners=r.listeners.filter((({listener:r,once:n})=>{const i=new _n(this,n?null:r,e);try{r.call(this,...t,i)}catch(e){}return!n})),0===r.listeners.length&&(r.started&&r.subscriber.stop(),this.#Se.delete(r.tag)),n>0}async listenerCount(e){if(e){const t=await this.#Ue(e);return t?t.listeners.length:0}let t=0;for(const{listeners:e}of this.#Se.values())t+=e.length;return t}async listeners(e){if(e){const t=await this.#Ue(e);return t?t.listeners.map((({listener:e})=>e)):[]}let t=[];for(const{listeners:e}of this.#Se.values())t=t.concat(e.map((({listener:e})=>e)));return t}async off(e,t){const r=await this.#Ue(e);if(!r)return this;if(t){const e=r.listeners.map((({listener:e})=>e)).indexOf(t);e>=0&&r.listeners.splice(e,1)}return t&&0!==r.listeners.length||(r.started&&r.subscriber.stop(),this.#Se.delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:r,subscriber:n}=await this.#De(e);r&&n.stop(),this.#Se.delete(t)}else for(const[e,{started:t,subscriber:r}]of this.#Se)t&&r.stop(),this.#Se.delete(e);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#Te}destroy(){this.removeAllListeners();for(const e of this.#Ne.keys())this._clearTimeout(e);this.#Te=!0}get paused(){return null!=this.#xe}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#Oe=-1,null!=this.#xe){if(this.#xe==!!e)return;v(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber((t=>t.pause(e))),this.#xe=!!e;for(const e of this.#Ne.values())e.timer&&clearTimeout(e.timer),e.time=Cc()-e.time}resume(){if(null!=this.#xe){this._forEachSubscriber((e=>e.resume())),this.#xe=null;for(const e of this.#Ne.values()){let t=e.time;t<0&&(t=0),e.time=Cc(),setTimeout(e.func,t)}}}}function Bc(e,t){try{const r=Mc(e,t);if(r)return jt(r)}catch(e){}return null}function Mc(e,t){if("0x"===e)return null;try{const r=V(B(e,t,t+32)),n=V(B(e,r,r+32));return B(e,r+32,r+32+n)}catch(e){}return null}function Lc(e){const t=q(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function Fc(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}const jc=new Uint8Array([]);function Uc(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(jc),r+=32;for(let n=0;n<e.length;n++){const i=T(e[n]);t[n]=Lc(r),t.push(Lc(i.length)),t.push(Fc(i)),r+=32+32*Math.ceil(i.length/32)}return N(t)}const Dc="0x0000000000000000000000000000000000000000000000000000000000000000";function Zc(e,t){if(e.provider)return e.provider;v(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function Hc(e,t){let r=yn(t);if(null!=r.to&&(r.to=Dr(r.to,e)),null!=r.from){const t=r.from;r.from=Promise.all([e.getAddress(),Dr(t,e)]).then((([e,t])=>(w(e.toLowerCase()===t.toLowerCase(),"transaction from mismatch","tx.from",t),e)))}else r.from=e.getAddress();return await h(r)}class $c{provider;constructor(e){p(this,{provider:e||null})}async getNonce(e){return Zc(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Hc(this,e)}async populateTransaction(e){const t=Zc(this,"populateTransaction"),r=await Hc(this,e);null==r.nonce&&(r.nonce=await this.getNonce("pending")),null==r.gasLimit&&(r.gasLimit=await this.estimateGas(r));const n=await this.provider.getNetwork();null!=r.chainId?w(H(r.chainId)===n.chainId,"transaction chainId mismatch","tx.chainId",e.chainId):r.chainId=n.chainId;const i=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas;if(null==r.gasPrice||2!==r.type&&!i?0!==r.type&&1!==r.type||!i||w(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):w(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas)if(0===r.type||1===r.type){const e=await t.getFeeData();v(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice)}else{const e=await t.getFeeData();if(null==r.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(r.type=2,null!=r.gasPrice){const e=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=e,r.maxPriorityFeePerGas=e}else null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(v(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice),r.type=0):v(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else r.type=2;return await h(r)}async estimateGas(e){return Zc(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Zc(this,"call").call(await this.populateCall(e))}async resolveName(e){const t=Zc(this,"resolveName");return await t.resolveName(e)}async sendTransaction(e){const t=Zc(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const n=Ia.from(r);return await t.broadcastTransaction(await this.signTransaction(n))}}class Gc extends $c{address;constructor(e,t){super(t),p(this,{address:e})}async getAddress(){return this.address}connect(e){return new Gc(this.address,e)}#Ze(e,t){v(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:t})}async signTransaction(e){this.#Ze("transactions","signTransaction")}async signMessage(e){this.#Ze("messages","signMessage")}async signTypedData(e,t,r){this.#Ze("typed-data","signTypedData")}}class zc{#me;#He;#be;#Ee;#$e;#Ge;constructor(e){this.#me=e,this.#He=null,this.#be=this.#Ae.bind(this),this.#Ee=!1,this.#$e=null,this.#Ge=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#Ae(e){try{null==this.#He&&(this.#He=this._subscribe(this.#me));let e=null;try{e=await this.#He}catch(e){if(!y(e,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==e.operation)throw e}if(null==e)return this.#He=null,void this.#me._recoverSubscriber(this,this._recover(this.#me));const t=await this.#me.getNetwork();if(this.#$e||(this.#$e=t),this.#$e.chainId!==t.chainId)throw new Error("chaid changed");if(this.#Ge)return;const r=await this.#me.send("eth_getFilterChanges",[e]);await this._emitResults(this.#me,r)}catch(e){console.log("@TODO",e)}this.#me.once("block",this.#be)}#ze(){const e=this.#He;e&&(this.#He=null,e.then((e=>{this.#me.send("eth_uninstallFilter",[e])})))}start(){this.#Ee||(this.#Ee=!0,this.#Ae(-2))}stop(){this.#Ee&&(this.#Ee=!1,this.#Ge=!0,this.#ze(),this.#me.off("block",this.#be))}pause(e){e&&this.#ze(),this.#me.off("block",this.#be)}resume(){this.start()}}class Vc extends zc{#Ve;constructor(e,t){var r;super(e),this.#Ve=(r=t,JSON.parse(JSON.stringify(r)))}_recover(e){return new Sc(e,this.#Ve)}async _subscribe(e){return await e.send("eth_newFilter",[this.#Ve])}async _emitResults(e,t){for(const r of t)e.emit(this.#Ve,e._wrapLog(r,e._network))}}class Wc extends zc{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const r of t)e.emit("pending",r)}}const qc="bigint,boolean,function,number,string,symbol".split(/,/g);function Kc(e){if(null==e||qc.indexOf(typeof e)>=0)return e;if("function"==typeof e.getAddress)return e;if(Array.isArray(e))return e.map(Kc);if("object"==typeof e)return Object.keys(e).reduce(((t,r)=>(t[r]=e[r],t)),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function Jc(e){return new Promise((t=>{setTimeout(t,e)}))}function Yc(e){return e?e.toLowerCase():e}function Qc(e){return e&&"number"==typeof e.pollingInterval}const Xc={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class eu extends $c{address;constructor(e,t){super(e),p(this,{address:t=pt(t)})}connect(e){v(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const t=Kc(e),r=[];if(t.from){const n=t.from;r.push((async()=>{const r=await Dr(n,this.provider);w(null!=r&&r.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=r})())}else t.from=this.address;if(null==t.gasLimit&&r.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),null!=t.to){const e=t.to;r.push((async()=>{t.to=await Dr(e,this.provider)})())}r.length&&await Promise.all(r);const n=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[n])}async sendTransaction(e){const t=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(e);return await new Promise(((e,n)=>{const i=[1e3,100],o=async()=>{const n=await this.provider.getTransaction(r);null==n?this.provider._setTimeout((()=>{o()}),i.pop()||4e3):e(n.replaceableTransaction(t))};o()}))}async signTransaction(e){const t=Kc(e);if(t.from){const r=await Dr(t.from,this.provider);w(null!=r&&r.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=r}else t.from=this.address;const r=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[r])}async signMessage(e){const t="string"==typeof e?Ft(e):e;return await this.provider.send("personal_sign",[C(t),this.address.toLowerCase()])}async signTypedData(e,t,r){const n=Kc(r),i=await en.resolveNames(e,t,n,(async e=>{const t=await Dr(e);return w(null!=t,"TypedData does not support null address","value",e),t}));return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(en.getPayload(i.domain,t,i.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const t="string"==typeof e?Ft(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),C(t)])}}class tu extends Rc{#s;#We;#qe;#Ke;#Je;#$e;#Ye(){if(this.#Ke)return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");this.#Ke=setTimeout((()=>{this.#Ke=null;const e=this.#qe;for(this.#qe=[];e.length;){const t=[e.shift()];for(;e.length&&t.length!==this.#s.batchMaxCount;)if(t.push(e.shift()),JSON.stringify(t.map((e=>e.payload))).length>this.#s.batchMaxSize){e.unshift(t.pop());break}(async()=>{const e=1===t.length?t[0].payload:t.map((e=>e.payload));this.emit("debug",{action:"sendRpcPayload",payload:e});try{const r=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:r});for(const{resolve:e,reject:n,payload:i}of t){if(this.destroyed){n(b("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:i.method}));continue}const t=r.filter((e=>e.id===i.id))[0];if(null!=t)"error"in t?n(this.getRpcError(i,t)):e(t.result);else{const e=b("missing response for request","BAD_DATA",{value:r,info:{payload:i}});this.emit("error",e),n(e)}}}catch(e){this.emit("debug",{action:"receiveRpcError",error:e});for(const{reject:r}of t)r(e)}})()}}),e)}constructor(e,t){super(e,t),this.#We=1,this.#s=Object.assign({},Xc,t||{}),this.#qe=[],this.#Ke=null,this.#$e=null;{let e=null;const t=new Promise((t=>{e=t}));this.#Je={promise:t,resolve:e}}const r=this._getOption("staticNetwork");r&&(w(null==e||r.matches(e),"staticNetwork MUST match network object","options",t),this.#$e=r)}_getOption(e){return this.#s[e]}get _network(){return v(this.#$e,"network is not available yet","NETWORK_ERROR"),this.#$e}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let t=e.transaction;if(t&&null!=t.type&&H(t.type)&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=await this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},t,{type:void 0})}))}}const t=this.getRpcRequest(e);return null!=t?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e)return e;if(this.ready)return gc.from(H(await this.send("eth_chainId",[])));const t={id:this.#We++,method:"eth_chainId",params:[],jsonrpc:"2.0"};let r;this.emit("debug",{action:"sendRpcPayload",payload:t});try{r=(await this._send(t))[0]}catch(e){throw this.emit("debug",{action:"receiveRpcError",error:e}),e}if(this.emit("debug",{action:"receiveRpcResult",result:r}),"result"in r)return gc.from(H(r.result));throw this.getRpcError(t,r)}_start(){null!=this.#Je&&null!=this.#Je.resolve&&(this.#Je.resolve(),this.#Je=null,(async()=>{for(;null==this.#$e&&!this.destroyed;)try{this.#$e=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",b("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await Jc(1e3)}this.#Ye()})())}async _waitUntilReady(){if(null!=this.#Je)return await this.#Je.promise}_getSubscriber(e){return"pending"===e.type?new Wc(this):"event"===e.type?this._getOption("polling")?new Sc(this,e.filter):new Vc(this,e.filter):"orphan"===e.type&&"drop-log"===e.filter.orphan?new Ic("orphan"):super._getSubscriber(e)}get ready(){return null==this.#Je}getRpcTransaction(e){const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((r=>{if(null==e[r])return;let n=r;"gasLimit"===r&&(n="gas"),t[n]=K(H(e[r],`tx.${r}`))})),["from","to","data"].forEach((r=>{null!=e[r]&&(t[r]=C(e[r]))})),e.accessList&&(t.accessList=rn(e.accessList)),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Yc(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Yc(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[Yc(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Yc(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&null!=e.filter.address&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(Yc):e.filter.address=Yc(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){const{method:r}=e,{error:n}=t;if("eth_estimateGas"===r&&n.message){const t=n.message;if(!t.match(/revert/i)&&t.match(/insufficient funds/i))return b("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:n}})}if("eth_call"===r||"eth_estimateGas"===r){const t=nu(n),i=Fr.getBuiltinCallException("eth_call"===r?"call":"estimateGas",e.params[0],t?t.data:null);return i.info={error:n,payload:e},i}const i=JSON.stringify(function(e){const t=[];return iu(e,t),t}(n));if("string"==typeof n.message&&n.message.match(/user denied|ethers-user-denied/i))return b("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[r]||"unknown",reason:"rejected",info:{payload:e,error:n}});if("eth_sendRawTransaction"===r||"eth_sendTransaction"===r){const t=e.params[0];if(i.match(/insufficient funds|base fee exceeds gas limit/i))return b("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:t,info:{error:n}});if(i.match(/nonce/i)&&i.match(/too low/i))return b("nonce has already been used","NONCE_EXPIRED",{transaction:t,info:{error:n}});if(i.match(/replacement transaction/i)&&i.match(/underpriced/i))return b("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:t,info:{error:n}});if(i.match(/only replay-protected/i))return b("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:r,info:{transaction:t,info:{error:n}}})}let o=!!i.match(/the method .* does not exist/i);return o||n&&n.details&&n.details.startsWith("Unauthorized method:")&&(o=!0),o?b("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:n,payload:e}}):b("could not coalesce error","UNKNOWN_ERROR",{error:n,payload:e})}send(e,t){if(this.destroyed)return Promise.reject(b("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const r=this.#We++,n=new Promise(((n,i)=>{this.#qe.push({resolve:n,reject:i,payload:{method:e,params:t,id:r,jsonrpc:"2.0"}})}));return this.#Ye(),n}async getSigner(e){null==e&&(e=0);const t=this.send("eth_accounts",[]);if("number"==typeof e){const r=await t;if(e>=r.length)throw new Error("no such account");return new eu(this,r[e])}const{accounts:r}=await h({network:this.getNetwork(),accounts:t});e=pt(e);for(const t of r)if(pt(t)===e)return new eu(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map((e=>new eu(this,e)))}destroy(){this.#Ke&&(clearTimeout(this.#Ke),this.#Ke=null);for(const{payload:e,reject:t}of this.#qe)t(b("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#qe=[],super.destroy()}}class ru extends tu{#Qe;constructor(e,t){super(e,t),this.#Qe=4e3}_getSubscriber(e){const t=super._getSubscriber(e);return Qc(t)&&(t.pollingInterval=this.#Qe),t}get pollingInterval(){return this.#Qe}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#Qe=e,this._forEachSubscriber((e=>{Qc(e)&&(e.pollingInterval=this.#Qe)}))}}function nu(e){if(null==e)return null;if("string"==typeof e.message&&e.message.match(/revert/i)&&I(e.data))return{message:e.message,data:e.data};if("object"==typeof e){for(const t in e){const r=nu(e[t]);if(r)return r}return null}if("string"==typeof e)try{return nu(JSON.parse(e))}catch(e){}return null}function iu(e,t){if(null!=e){if("string"==typeof e.message&&t.push(e.message),"object"==typeof e)for(const r in e)iu(e[r],t);if("string"==typeof e)try{return iu(JSON.parse(e),t)}catch(e){}}}class ou extends ru{#ce;constructor(e,t){super(t,{batchMaxCount:1}),this.#ce=async(t,r)=>{const n={method:t,params:r};this.emit("debug",{action:"sendEip1193Request",payload:n});try{const t=await e.request(n);return this.emit("debug",{action:"receiveEip1193Result",result:t}),t}catch(e){const t=new Error(e.message);throw t.code=e.code,t.data=e.data,t.payload=n,this.emit("debug",{action:"receiveEip1193Error",error:t}),t}}}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){w(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const t=await this.#ce(e.method,e.params||[]);return[{id:e.id,result:t}]}catch(t){return[{id:e.id,error:{code:t.code,data:t.data,message:t.message}}]}}getRpcError(e,t){switch((t=JSON.parse(JSON.stringify(t))).error.code||-1){case 4001:t.error.message=`ethers-user-denied: ${t.error.message}`;break;case 4200:t.error.message=`ethers-unsupported: ${t.error.message}`}return super.getRpcError(e,t)}async hasSigner(e){null==e&&(e=0);const t=await this.send("eth_accounts",[]);return"number"==typeof e?t.length>e:(e=e.toLowerCase(),0!==t.filter((t=>t.toLowerCase()===e)).length)}async getSigner(e){if(null==e&&(e=0),!await this.hasSigner(e))try{await this.#ce("eth_requestAccounts",[])}catch(e){const t=e.payload;throw this.getRpcError(t,{id:t.id,error:e})}return await super.getSigner(e)}}var su=i(9640),au=i.n(su);const cu=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint256"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"},{name:"_extraData",type:"bytes"}],name:"approveAndCall",outputs:[{name:"success",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"remaining",type:"uint256"}],payable:!1,type:"function"},{inputs:[{name:"_initialAmount",type:"uint256"},{name:"_tokenName",type:"string"},{name:"_decimalUnits",type:"uint8"},{name:"_tokenSymbol",type:"string"}],type:"constructor"},{payable:!1,type:"fallback"}],uu=[{constant:!0,inputs:[{name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{name:"_name",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_tokenId",type:"uint256"}],name:"getApproved",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_approved",type:"address"},{name:"_tokenId",type:"uint256"}],name:"approve",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"transferFrom",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],payable:!0,stateMutability:"payable",type:"function"},{constant:!0,inputs:[{name:"_index",type:"uint256"}],name:"tokenByIndex",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_tokenId",type:"uint256"}],name:"ownerOf",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"_symbol",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_tokenId",type:"uint256"}],name:"tokenURI",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"}],lu=[{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"uint256",name:"_id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"_owners",type:"address[]"},{internalType:"uint256[]",name:"_ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"address",name:"_operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"isOperator",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_from",type:"address"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256",name:"_id",type:"uint256"},{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_operator",type:"address"},{internalType:"bool",name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"_interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"_id",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],fu=[{payable:!0,stateMutability:"payable",type:"fallback"},{constant:!0,inputs:[{name:"user",type:"address"},{name:"token",type:"address"}],name:"tokenBalance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"users",type:"address[]"},{name:"tokens",type:"address[]"}],name:"balances",outputs:[{name:"",type:"uint256[]"}],payable:!1,stateMutability:"view",type:"function"}];var du=i(4406);const hu="localhost",pu="eth",gu="erc20",yu="erc721",mu="erc1155",bu="0xd9b67a26",vu="0x80ac58cd",wu="0x5b5e139f",Au="0x780e9d63",Eu="0x1",_u="0x89",Su="0x38",xu="0xa86a",Tu="0x64",Pu="0xa4b1",Iu="0xa",ku="0xa4ec",Ou="0x5",Cu="0xaa36a7",Nu="0x13881",Ru="0x61",Bu="0xa869",Mu="0x66eeb",Lu="0x1a4",Fu={[Eu]:{blockExplorerUrl:"https://etherscan.io",chainId:Eu,displayName:"Main Ethereum Network",logo:"eth.svg",rpcTarget:`https://mainnet.infura.io/v3/${du.env.VITE_APP_INFURA_PROJECT_KEY}`,ticker:"ETH",tickerName:"Ethereum"},[_u]:{blockExplorerUrl:"https://polygonscan.com",chainId:_u,displayName:"Polygon Mainnet",logo:"matic-network-logo.svg",rpcTarget:`https://polygon-mainnet.infura.io/v3/${du.env.VITE_APP_INFURA_PROJECT_KEY}`,ticker:"MATIC",tickerName:"Matic Network Token"},[Su]:{blockExplorerUrl:"https://bscscan.com",chainId:Su,displayName:"Binance Smart Chain Mainnet",logo:"bnb.png",rpcTarget:"https://bsc-dataseed.binance.org",ticker:"BNB",tickerName:"Binance Coin"},[xu]:{blockExplorerUrl:"https://snowtrace.io",chainId:xu,displayName:"Avalanche Mainnet C-Chain",logo:"avax.svg",rpcTarget:"https://api.avax.network/ext/bc/C/rpc",ticker:"AVAX",tickerName:"Avalanche"},[Iu]:{blockExplorerUrl:"https://optimistic.etherscan.io",chainId:Iu,displayName:"Optimism",logo:"optimism.svg",rpcTarget:`https://optimism-mainnet.infura.io/v3/${du.env.VITE_APP_INFURA_PROJECT_KEY}`,ticker:"ETH",tickerName:"Ethereum"},[ku]:{blockExplorerUrl:"https://explorer.celo.org",chainId:ku,displayName:"Celo Mainnet",logo:"celo.svg",rpcTarget:`https://celo-mainnet.infura.io/v3/${du.env.VITE_APP_INFURA_PROJECT_KEY}`,ticker:"CELO",tickerName:"Celo"},[Pu]:{blockExplorerUrl:"https://arbiscan.io",chainId:Pu,displayName:"Arbitrum One",logo:"eth.svg",rpcTarget:`https://arbitrum-mainnet.infura.io/v3/${du.env.VITE_APP_INFURA_PROJECT_KEY}`,ticker:"ETH",tickerName:"Ethereum"},[Tu]:{blockExplorerUrl:"https://blockscout.com/poa/xdai",chainId:Tu,displayName:"xDai",logo:"xdai.svg",rpcTarget:"https://rpc.gnosischain.com",ticker:"DAI",tickerName:"xDai Network Token"},[Ou]:{blockExplorerUrl:"https://goerli.etherscan.io",chainId:Ou,displayName:"Goerli Test Network",logo:"eth.svg",rpcTarget:`https://goerli.infura.io/v3/${du.env.VITE_APP_INFURA_PROJECT_KEY}`,ticker:"ETH",tickerName:"Ethereum",isTestNet:!0},[Cu]:{blockExplorerUrl:"https://sepolia.etherscan.io",chainId:Cu,displayName:"Sepolia Test Network",logo:"eth.svg",rpcTarget:`https://sepolia.infura.io/v3/${du.env.VITE_APP_INFURA_PROJECT_KEY}`,ticker:"ETH",tickerName:"Ethereum",isTestNet:!0},[Nu]:{blockExplorerUrl:"https://mumbai.polygonscan.com",chainId:Nu,displayName:"Polygon Mumbai",logo:"matic-network-logo.svg",rpcTarget:`https://polygon-mumbai.infura.io/v3/${du.env.VITE_APP_INFURA_PROJECT_KEY}`,ticker:"MATIC",tickerName:"Matic Network Token",isTestNet:!0},[Ru]:{blockExplorerUrl:"https://testnet.bscscan.com",chainId:Ru,displayName:"Binance Smart Chain Testnet",logo:"bnb.png",rpcTarget:"https://data-seed-prebsc-1-s1.binance.org:8545",ticker:"BNB",tickerName:"Binance Coin",isTestNet:!0},[Bu]:{blockExplorerUrl:"https://testnet.snowtrace.io",chainId:Bu,displayName:"Avalanche Testnet C-Chain",logo:"avax.png",rpcTarget:"https://api.avax-test.network/ext/bc/C/rpc",ticker:"AVAX",tickerName:"Avalanche",isTestNet:!0},[Mu]:{blockExplorerUrl:"https://testnet.arbiscan.io",chainId:Mu,displayName:"Arbitrum Goerli",logo:"eth.svg",rpcTarget:`https://arbitrum-rinkeby.infura.io/v3/${du.env.VITE_APP_INFURA_PROJECT_KEY}`,ticker:"ETH",tickerName:"Ethereum",isTestNet:!0},[Lu]:{blockExplorerUrl:"https://goerli-optimism.etherscan.io",chainId:Lu,displayName:"Optimism Goerli",logo:"optimism.svg",rpcTarget:`https://optimism-goerli.infura.io/v3/${du.env.VITE_APP_INFURA_PROJECT_KEY}`,ticker:"ETH",tickerName:"Ethereum",isTestNet:!0}},ju={GET_ACCOUNTS:"eth_accounts",ETH_TRANSACTION:"eth_sendTransaction",ETH_REQUEST_ACCOUNTS:"eth_requestAccounts",ETH_SEND_RAW_TRANSACTION:"eth_sendRawTransaction",ETH_SIGN:"eth_sign",ETH_SIGN_TYPED_DATA:"eth_signTypedData",ETH_SIGN_TYPED_DATA_V3:"eth_signTypedData_v3",ETH_SIGN_TYPED_DATA_V4:"eth_signTypedData_v4",PERSONAL_SIGN:"personal_sign",ETH_GET_TRANSACTION_COUNT:"eth_getTransactionCount",ETH_GET_TRANSACTION_BY_HASH:"eth_getTransactionByHash",ETH_GET_ENCRYPTION_PUBLIC_KEY:"eth_getEncryptionPublicKey",ETH_DECRYPT:"eth_decrypt",ETH_GET_TRANSACTION_RECEIPT:"eth_getTransactionReceipt",WATCH_ASSET:"wallet_watchAsset",ETH_GET_BLOCK_BY_HASH:"eth_getBlockByHash",ETH_GET_CODE:"eth_getCode",ETH_GET_GAS_PRICE:"eth_gasPrice"},Uu={LEGACY:"0x0",ACCESS_LIST:"0x1",FEE_MARKET:"0x2"},Du={FEE_MARKET:"fee-market",LEGACY:"legacy",ETH_GASPRICE:"eth_gasPrice",NONE:"none"},Zu={[Iu]:1,[Lu]:1},Hu={"0x06012c8cf97bead5deae237070f9587f8e7a266d":{name:"Cryptokitties",logo:"dapp-cryptokitty.svg",erc20:!0,symbol:"CK",decimals:0}},$u=[Ou,Cu],Gu=[Eu,Ou,Cu,Su,Ru,Iu,Lu,xu,Bu,Pu,Mu,_u,Nu,ku],zu=[Eu,_u,Nu,Su,Ru,Pu,Mu,Iu,Lu,ku,xu,Bu,Ou],Vu=new Set(["btc","eth","ltc","bch","bnb","eos","xrp","xlm","link","dot","yfi","usd","aed","ars","aud","bdt","bhd","bmd","brl","cad","chf","clp","cny","czk","dkk","eur","gbp","hkd","huf","idr","ils","inr","jpy","krw","kwd","lkr","mmk","mxn","myr","ngn","nok","nzd","php","pkr","pln","rub","sar","sek","sgd","thb","try","twd","uah","vef","vnd","zar","xdr","xag","xau","bits","sats"]),Wu={[_u]:{platform:"polygon-pos",currency:"matic"},[Su]:{platform:"binance-smart-chain",currency:"bnb"},[Eu]:{platform:"ethereum",currency:"eth"},[Pu]:{platform:"arbitrum-one",currency:"eth"},[Iu]:{platform:"optimistic-ethereum",currency:"eth"},[ku]:{platform:"celo",currency:"celo"},[Tu]:{platform:"xdai",currency:"xDAI"},[xu]:{platform:"avalanche",currency:"avax"}},qu={UNAPPROVED:"unapproved",SIGNED:"signed",PENDING:"pending",APPROVED:"approved",REJECTED:"rejected",FAILED:"failed"},Ku={[Eu]:"0xb1f8e55c7f64d203c1400b9d8555d050f94adf39",[Ou]:"0x9788C4E93f9002a7ad8e72633b11E8d1ecd51f9b",[Su]:"0x2352c63A83f9Fd126af8676146721Fa00924d7e4",[Iu]:"0xB1c568e9C3E6bdaf755A60c7418C269eb11524FC",[_u]:"0x2352c63A83f9Fd126af8676146721Fa00924d7e4",[xu]:"0xD023D153a0DFa485130ECFdE2FAA7e612EF94818",[Pu]:"0x151E24A486D7258dd7C33Fb67E4bB01919B7B32c"};class Ju extends a.BaseController{constructor(e){let{config:t,state:r,provider:n,blockTracker:i,getIdentities:o,onPreferencesStateChange:a,getCurrentChainId:c}=e;super({config:t,state:r}),(0,s.Z)(this,"provider",void 0),(0,s.Z)(this,"blockTracker",void 0),(0,s.Z)(this,"mutex",new l),(0,s.Z)(this,"ethersProvider",void 0),(0,s.Z)(this,"getIdentities",void 0),(0,s.Z)(this,"getCurrentChainId",void 0),this.defaultState={accounts:{}},this.defaultConfig={_currentBlock:null},this.initialize(),this.provider=n,this.blockTracker=i,this.ethersProvider=new ou(this.provider,"any"),this.blockTracker.on("latest",(e=>{this.configure({_currentBlock:e}),this.refresh()})),this.getIdentities=o,this.getCurrentChainId=c,a((()=>{au().info("onPreferencesStateChange called"),this.syncAccounts()&&this.refresh()}))}syncAccounts(){const{accounts:e}=this.state,t=Object.keys(this.getIdentities()),r=Object.keys(e),i=t.filter((e=>-1===r.indexOf(e))),o=r.filter((e=>-1===t.indexOf(e)));let s=!1;return i.forEach((t=>{s=!0,e[t]={balance:"0x0"}})),o.forEach((t=>{s=!0,delete e[t]})),this.update({accounts:(0,n.Z)({},e)}),s}async refresh(){const e=await this.mutex.acquire();try{if(!this.config._currentBlock)return;this._updateAccounts()}catch(e){}finally{e()}}async _updateAccounts(){const{accounts:e}=this.state,t=Object.keys(e),r=this.getCurrentChainId();if("loading"!==r&&t.length>0){if(Ku[r])return void await this._updateAccountsViaBalanceChecker(t,Ku[r]);au().info("falling back to ethQuery.getBalance"),await Promise.all(t.map((e=>this._updateAccount(e))))}}async _updateAccount(e){const t=await this.provider.request({method:"eth_getBalance",params:[e,"latest"]}),{accounts:r}=this.state;r[e]&&(r[e]={balance:K(t)},this.update({accounts:r}))}async _updateAccountsViaBalanceChecker(e,t){const r=new Jn(t,fu,this.ethersProvider);try{const t=await r.balances(e,["0x0000000000000000000000000000000000000000"]),{accounts:n}=this.state;return e.forEach(((e,r)=>{const i=K(t[r]);n[e]&&(n[e]={balance:i})})),this.update({accounts:n})}catch(t){return au().warn("Torus - Account Tracker single call balance fetch failed",t),Promise.all(e.map((e=>this._updateAccount(e))))}}}const Yu=Ju;var Qu=i(6830),Xu=i(6065);class el extends Xu.kb{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,Xu.GL)(this.buffer)}update(e){Qu.ZP.exists(this);const{view:t,buffer:r,blockLen:n}=this,i=(e=(0,Xu.O0)(e)).length;for(let o=0;o<i;){const s=Math.min(n-this.pos,i-o);if(s!==n)r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=(0,Xu.GL)(e);for(;n<=i-o;o+=n)this.process(t,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Qu.ZP.exists(this),Qu.ZP.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:i}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=(0,Xu.GL)(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,u[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}const tl=(e,t,r)=>e&t^~e&r,rl=(e,t,r)=>e&t^e&r^t&r,nl=new Uint32Array([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]),il=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ol=new Uint32Array(64);class sl extends el{constructor(){super(64,32,8,!1),this.A=0|il[0],this.B=0|il[1],this.C=0|il[2],this.D=0|il[3],this.E=0|il[4],this.F=0|il[5],this.G=0|il[6],this.H=0|il[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)ol[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=ol[e-15],r=ol[e-2],n=(0,Xu.np)(t,7)^(0,Xu.np)(t,18)^t>>>3,i=(0,Xu.np)(r,17)^(0,Xu.np)(r,19)^r>>>10;ol[e]=i+ol[e-7]+n+ol[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+((0,Xu.np)(s,6)^(0,Xu.np)(s,11)^(0,Xu.np)(s,25))+tl(s,a,c)+nl[e]+ol[e]|0,l=((0,Xu.np)(r,2)^(0,Xu.np)(r,13)^(0,Xu.np)(r,22))+rl(r,n,i)|0;u=c,c=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){ol.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class al extends sl{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const cl=(0,Xu.hE)((()=>new sl)),ul=((0,Xu.hE)((()=>new al)),BigInt(0),BigInt(1)),ll=BigInt(2),fl=e=>e instanceof Uint8Array,dl=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function hl(e){if(!fl(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=dl[e[r]];return t}function pl(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function gl(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[t]=o}return r}function yl(e){return pl(hl(e))}function ml(e){if(!fl(e))throw new Error("Uint8Array expected");return pl(hl(Uint8Array.from(e).reverse()))}function bl(e,t){return gl(e.toString(16).padStart(2*t,"0"))}function vl(e,t){return bl(e,t).reverse()}function wl(e,t,r){let n;if("string"==typeof t)try{n=gl(t)}catch(r){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else{if(!fl(t))throw new Error(`${e} must be hex string or Uint8Array`);n=Uint8Array.from(t)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(`${e} expected ${r} bytes, got ${i}`);return n}function Al(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!fl(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t}const El=e=>(ll<<BigInt(e-1))-ul,_l=e=>new Uint8Array(e),Sl=e=>Uint8Array.from(e);function xl(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=_l(e),i=_l(e),o=0;const s=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),c=(e=_l())=>{i=a(Sl([0]),e),n=a(),0!==e.length&&(i=a(Sl([1]),e),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=a();const t=n.slice();r.push(t),e+=n.length}return Al(...r)};return(e,t)=>{let r;for(s(),c(e);!(r=t(u()));)c();return s(),r}}const Tl={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Pl(e,t,r={}){const n=(t,r,n)=>{const i=Tl[r];if("function"!=typeof i)throw new Error(`Invalid validator "${r}", expected function`);const o=e[t];if(!(n&&void 0===o||i(o,e)))throw new Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${r}`)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}const Il=BigInt(0),kl=BigInt(1),Ol=BigInt(2),Cl=BigInt(3),Nl=BigInt(4),Rl=BigInt(5),Bl=BigInt(8);function Ml(e,t){const r=e%t;return r>=Il?r:t+r}function Ll(e,t,r){if(r<=Il||t<Il)throw new Error("Expected power/modulo > 0");if(r===kl)return Il;let n=kl;for(;t>Il;)t&kl&&(n=n*e%r),e=e*e%r,t>>=kl;return n}function Fl(e,t,r){let n=e;for(;t-- >Il;)n*=n,n%=r;return n}function jl(e,t){if(e===Il||t<=Il)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Ml(e,t),n=t,i=Il,o=kl,s=kl,a=Il;for(;r!==Il;){const e=n/r,t=n%r,c=i-s*e,u=o-a*e;n=r,r=t,i=s,o=a,s=c,a=u}if(n!==kl)throw new Error("invert: does not exist");return Ml(i,t)}BigInt(9),BigInt(16);const Ul=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Dl(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}const Zl=BigInt(0),Hl=BigInt(1);function $l(e){return Pl(e.Fp,Ul.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),Pl(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Dl(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{bytesToNumberBE:Gl,hexToBytes:zl}=e,Vl={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=Vl;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const r=e[1],n=e.subarray(2,r+2);if(!r||n.length!==r)throw new t("Invalid signature integer: wrong length");if(128&n[0])throw new t("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Gl(n),l:e.subarray(r+2)}},toSig(e){const{Err:t}=Vl,r="string"==typeof e?zl(e):e;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==n-2)throw new t("Invalid signature: incorrect length");const{d:i,l:o}=Vl._parseInt(r.subarray(2)),{d:s,l:a}=Vl._parseInt(o);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),o=n.length/2,s=i.length/2,a=r(o),c=r(s);return`30${r(s+o+4)}02${c}${i}02${a}${n}`}},Wl=BigInt(0),ql=BigInt(1),Kl=(BigInt(2),BigInt(3));function Jl(e){const t=function(e){const t=$l(e);return Pl(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n}=t,i=r.BYTES+1,o=2*r.BYTES+1;function s(e){return Ml(e,n)}function a(e){return jl(e,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:f}=function(e){const t=function(e){const t=$l(e);Pl(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,n=t.toBytes||((e,t,n)=>{const i=t.toAffine();return Al(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),i=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function o(e){const{a:n,b:i}=t,o=r.sqr(e),s=r.mul(o,e);return r.add(r.add(s,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function s(e){return"bigint"==typeof e&&Wl<e&&e<t.n}function a(e){if(!s(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(e){const{allowedPrivateKeyLengths:r,nByteLength:n,wrapPrivateKey:i,n:o}=t;if(r&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=hl(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*n,"0")}let s;try{s="bigint"==typeof e?e:yl(wl("private key",e,n))}catch(t){throw new Error(`private key must be ${n} bytes, hex or bigint, not ${typeof e}`)}return i&&(s=Ml(s,o)),a(s),s}const u=new Map;function l(e){if(!(e instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required")}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof f)throw new Error("projective point not allowed");const i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?f.ZERO:new f(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(f.fromAffine)}static fromHex(e){const t=f.fromAffine(i(wl("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return f.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw new Error("bad point: x or y not FE");const i=r.sqr(n),s=o(e);if(!r.eql(i,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){l(e);const{px:t,py:n,pz:i}=this,{px:o,py:s,pz:a}=e,c=r.eql(r.mul(t,a),r.mul(o,i)),u=r.eql(r.mul(n,a),r.mul(s,i));return c&&u}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,i=r.mul(n,Kl),{px:o,py:s,pz:a}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,d=r.mul(o,o),h=r.mul(s,s),p=r.mul(a,a),g=r.mul(o,s);return g=r.add(g,g),l=r.mul(o,a),l=r.add(l,l),c=r.mul(e,l),u=r.mul(i,p),u=r.add(c,u),c=r.sub(h,u),u=r.add(h,u),u=r.mul(c,u),c=r.mul(g,c),l=r.mul(i,l),p=r.mul(e,p),g=r.sub(d,p),g=r.mul(e,g),g=r.add(g,l),l=r.add(d,d),d=r.add(l,d),d=r.add(d,p),d=r.mul(d,g),u=r.add(u,d),p=r.mul(s,a),p=r.add(p,p),d=r.mul(p,g),c=r.sub(c,d),l=r.mul(p,h),l=r.add(l,l),l=r.add(l,l),new f(c,u,l)}add(e){l(e);const{px:n,py:i,pz:o}=this,{px:s,py:a,pz:c}=e;let u=r.ZERO,d=r.ZERO,h=r.ZERO;const p=t.a,g=r.mul(t.b,Kl);let y=r.mul(n,s),m=r.mul(i,a),b=r.mul(o,c),v=r.add(n,i),w=r.add(s,a);v=r.mul(v,w),w=r.add(y,m),v=r.sub(v,w),w=r.add(n,o);let A=r.add(s,c);return w=r.mul(w,A),A=r.add(y,b),w=r.sub(w,A),A=r.add(i,o),u=r.add(a,c),A=r.mul(A,u),u=r.add(m,b),A=r.sub(A,u),h=r.mul(p,w),u=r.mul(g,b),h=r.add(u,h),u=r.sub(m,h),h=r.add(m,h),d=r.mul(u,h),m=r.add(y,y),m=r.add(m,y),b=r.mul(p,b),w=r.mul(g,w),m=r.add(m,b),b=r.sub(y,b),b=r.mul(p,b),w=r.add(w,b),y=r.mul(m,w),d=r.add(d,y),y=r.mul(A,w),u=r.mul(v,u),u=r.sub(u,y),y=r.mul(v,m),h=r.mul(A,h),h=r.add(h,y),new f(u,d,h)}subtract(e){return this.add(e.negate())}is0(){return this.equals(f.ZERO)}wNAF(e){return h.wNAFCached(this,u,e,(e=>{const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(f.fromAffine)}))}multiplyUnsafe(e){const n=f.ZERO;if(e===Wl)return n;if(a(e),e===ql)return this;const{endo:i}=t;if(!i)return h.unsafeLadder(this,e);let{k1neg:o,k1:s,k2neg:c,k2:u}=i.splitScalar(e),l=n,d=n,p=this;for(;s>Wl||u>Wl;)s&ql&&(l=l.add(p)),u&ql&&(d=d.add(p)),p=p.double(),s>>=ql,u>>=ql;return o&&(l=l.negate()),c&&(d=d.negate()),d=new f(r.mul(d.px,i.beta),d.py,d.pz),l.add(d)}multiply(e){a(e);let n,i,o=e;const{endo:s}=t;if(s){const{k1neg:e,k1:t,k2neg:a,k2:c}=s.splitScalar(o);let{p:u,f:l}=this.wNAF(t),{p:d,f:p}=this.wNAF(c);u=h.constTimeNegate(e,u),d=h.constTimeNegate(a,d),d=new f(r.mul(d.px,s.beta),d.py,d.pz),n=u.add(d),i=l.add(p)}else{const{p:e,f:t}=this.wNAF(o);n=e,i=t}return f.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){const n=f.BASE,i=(e,t)=>t!==Wl&&t!==ql&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,r));return o.is0()?void 0:o}toAffine(e){const{px:t,py:n,pz:i}=this,o=this.is0();null==e&&(e=o?r.ONE:r.inv(i));const s=r.mul(t,e),a=r.mul(n,e),c=r.mul(i,e);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw new Error("invZ was invalid");return{x:s,y:a}}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===ql)return!0;if(r)return r(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===ql?this:r?r(f,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),n(f,this,e)}toHex(e=!0){return hl(this.toRawBytes(e))}}f.BASE=new f(t.Gx,t.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);const d=t.nBitLength,h=function(e,t){const r=(e,t)=>{const r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>Zl;)r&Hl&&(n=n.add(i)),i=i.double(),r>>=Hl;return n},precomputeWindow(e,t){const{windows:r,windowSize:i}=n(t),o=[];let s=e,a=s;for(let e=0;e<r;e++){a=s,o.push(a);for(let e=1;e<i;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(t,i,o){const{windows:s,windowSize:a}=n(t);let c=e.ZERO,u=e.BASE;const l=BigInt(2**t-1),f=2**t,d=BigInt(t);for(let e=0;e<s;e++){const t=e*a;let n=Number(o&l);o>>=d,n>a&&(n-=f,o+=Hl);const s=t,h=t+Math.abs(n)-1,p=e%2!=0,g=n<0;0===n?u=u.add(r(p,i[s])):c=c.add(r(g,i[h]))}return{p:c,f:u}},wNAFCached(e,t,r,n){const i=e._WINDOW_SIZE||1;let o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,n(o))),this.wNAF(i,o,r)}}}(f,t.endo?Math.ceil(d/2):d);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:s}}({...t,toBytes(e,t,n){const i=t.toAffine(),o=r.toBytes(i.x),s=Al;return n?s(Uint8Array.from([t.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,r.toBytes(i.y))},fromBytes(e){const t=e.length,n=e[0],s=e.subarray(1);if(t!==i||2!==n&&3!==n){if(t===o&&4===n)return{x:r.fromBytes(s.subarray(0,r.BYTES)),y:r.fromBytes(s.subarray(r.BYTES,2*r.BYTES))};throw new Error(`Point of length ${t} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}{const e=yl(s);if(!(Wl<(a=e)&&a<r.ORDER))throw new Error("Point is not on curve");const t=l(e);let i=r.sqrt(t);return 1==(1&n)!=((i&ql)===ql)&&(i=r.neg(i)),{x:e,y:i}}var a}}),d=e=>hl(bl(e,t.nByteLength));function h(e){return e>n>>ql}const p=(e,t,r)=>yl(e.slice(t,r));class g{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const r=t.nByteLength;return e=wl("compactSignature",e,2*r),new g(p(e,0,r),p(e,r,2*r))}static fromDER(e){const{r:t,s:r}=Vl.toSig(wl("DER",e));return new g(t,r)}assertValidity(){if(!f(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!f(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new g(this.r,this.s,e)}recoverPublicKey(e){const{r:n,s:i,recovery:o}=this,u=v(wl("msgHash",e));if(null==o||![0,1,2,3].includes(o))throw new Error("recovery id invalid");const l=2===o||3===o?n+t.n:n;if(l>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const f=0==(1&o)?"02":"03",h=c.fromHex(f+d(l)),p=a(l),g=s(-u*p),y=s(i*p),m=c.BASE.multiplyAndAddUnsafe(h,g,y);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return gl(this.toDERHex())}toDERHex(){return Vl.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return gl(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}const y={isValidPrivateKey(e){try{return u(e),!0}catch(e){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>bl(function(e,t,r=!1){const n=(e=wl("privateHash",e)).length,i=Dl(t).nByteLength+8;if(i<24||n<i||n>1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);return Ml(r?ml(e):yl(e),t-kl)+kl}(t.randomBytes(r.BYTES+8),n),t.nByteLength),precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function m(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===i||n===o:r?n===2*i||n===2*o:e instanceof c}const b=t.bits2int||function(e){const r=yl(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},v=t.bits2int_modN||function(e){return s(b(e))},w=El(t.nBitLength);function A(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(Wl<=e&&e<w))throw new Error(`bigint expected < 2^${t.nBitLength}`);return bl(e,t.nByteLength)}const E={lowS:t.lowS,prehash:!1},_={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(m(e))throw new Error("first arg must be private key");if(!m(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(u(e)).toRawBytes(r)},sign:function(e,n,i=E){const{seed:o,k2sig:l}=function(e,n,i=E){if(["recovered","canonical"].some((e=>e in i)))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:l}=t;let{lowS:d,prehash:p,extraEntropy:y}=i;null==d&&(d=!0),e=wl("msgHash",e),p&&(e=wl("prehashed msgHash",o(e)));const m=v(e),w=u(n),_=[A(w),A(m)];if(null!=y){const e=!0===y?l(r.BYTES):y;_.push(wl("extraEntropy",e,r.BYTES))}const S=Al(..._),x=m;return{seed:S,k2sig:function(e){const t=b(e);if(!f(t))return;const r=a(t),n=c.BASE.multiply(t).toAffine(),i=s(n.x);if(i===Wl)return;const o=s(r*s(x+i*w));if(o===Wl)return;let u=(n.x===i?0:2)|Number(n.y&ql),l=o;return d&&h(o)&&(l=function(e){return h(e)?s(-e):e}(o),u^=1),new g(i,l,u)}}}(e,n,i),d=t;return xl(d.hash.outputLen,d.nByteLength,d.hmac)(o,l)},verify:function(e,r,n,i=_){const o=e;if(r=wl("msgHash",r),n=wl("publicKey",n),"strict"in i)throw new Error("options.strict was renamed to lowS");const{lowS:u,prehash:l}=i;let f,d;try{if("string"==typeof o||o instanceof Uint8Array)try{f=g.fromDER(o)}catch(e){if(!(e instanceof Vl.Err))throw e;f=g.fromCompact(o)}else{if("object"!=typeof o||"bigint"!=typeof o.r||"bigint"!=typeof o.s)throw new Error("PARSE");{const{r:e,s:t}=o;f=new g(e,t)}}d=c.fromHex(n)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&f.hasHighS())return!1;l&&(r=t.hash(r));const{r:h,s:p}=f,y=v(r),m=a(p),b=s(y*m),w=s(h*m),A=c.BASE.multiplyAndAddUnsafe(d,b,w)?.toAffine();return!!A&&s(A.x)===h},ProjectivePoint:c,Signature:g,utils:y}}BigInt(4);class Yl extends Xu.kb{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Qu.ZP.hash(e);const r=(0,Xu.O0)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return Qu.ZP.exists(this),this.iHash.update(e),this}digestInto(e){Qu.ZP.exists(this),Qu.ZP.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Ql=(e,t,r)=>new Yl(e,t).update(r).digest();function Xl(e){return{hash:e,hmac:(t,...r)=>Ql(e,t,(0,Xu.eV)(...r)),randomBytes:Xu.O6}}Ql.create=(e,t)=>new Yl(e,t);const ef=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),tf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),rf=BigInt(1),nf=BigInt(2),of=(e,t)=>(e+t/nf)/t;const sf=function(e,t,r=!1,n={}){if(e<=Il)throw new Error(`Expected Fp ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:o}=Dl(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=function(e){if(e%Nl===Cl){const t=(e+kl)/Nl;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%Bl===Rl){const t=(e-Rl)/Bl;return function(e,r){const n=e.mul(r,Ol),i=e.pow(n,t),o=e.mul(r,i),s=e.mul(e.mul(o,Ol),i),a=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),r))throw new Error("Cannot find square root");return a}}return function(e){const t=(e-kl)/Ol;let r,n,i;for(r=e-kl,n=0;r%Ol===Il;r/=Ol,n++);for(i=Ol;i<e&&Ll(i,t,e)!==e-kl;i++);if(1===n){const t=(e+kl)/Nl;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const o=(r+kl)/Ol;return function(e,s){if(e.pow(s,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let a=n,c=e.pow(e.mul(e.ONE,i),r),u=e.pow(s,o),l=e.pow(s,r);for(;!e.eql(l,e.ONE);){if(e.eql(l,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(l);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,kl<<BigInt(a-t-1));c=e.sqr(r),u=e.mul(u,r),l=e.mul(l,c),a=t}return u}}(e)}(e),a=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:El(i),ZERO:Il,ONE:kl,create:t=>Ml(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return Il<=t&&t<e},is0:e=>e===Il,isOdd:e=>(e&kl)===kl,neg:t=>Ml(-t,e),eql:(e,t)=>e===t,sqr:t=>Ml(t*t,e),add:(t,r)=>Ml(t+r,e),sub:(t,r)=>Ml(t-r,e),mul:(t,r)=>Ml(t*r,e),pow:(e,t)=>function(e,t,r){if(r<Il)throw new Error("Expected power > 0");if(r===Il)return e.ONE;if(r===kl)return t;let n=e.ONE,i=t;for(;r>Il;)r&kl&&(n=e.mul(n,i)),i=e.sqr(i),r>>=kl;return n}(a,e,t),div:(t,r)=>Ml(t*jl(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>jl(t,e),sqrt:n.sqrt||(e=>s(a,e)),invertBatch:e=>function(e,t){const r=new Array(t.length),n=t.reduce(((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n))),e.ONE),i=e.inv(n);return t.reduceRight(((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n))),i),r}(a,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?vl(e,o):bl(e,o),fromBytes:e=>{if(e.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${e.length}`);return r?ml(e):yl(e)}});return Object.freeze(a)}(ef,void 0,void 0,{sqrt:function(e){const t=ef,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,f=Fl(l,r,t)*l%t,d=Fl(f,r,t)*l%t,h=Fl(d,nf,t)*u%t,p=Fl(h,i,t)*h%t,g=Fl(p,o,t)*p%t,y=Fl(g,a,t)*g%t,m=Fl(y,c,t)*y%t,b=Fl(m,a,t)*g%t,v=Fl(b,r,t)*l%t,w=Fl(v,s,t)*p%t,A=Fl(w,n,t)*u%t,E=Fl(A,nf,t);if(!sf.eql(sf.sqr(E),e))throw new Error("Cannot find square root");return E}}),af=function(e,t){const r=t=>Jl({...e,...Xl(t)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:sf,n:tf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=tf,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-rf*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),a=of(o*e,t),c=of(-n*e,t);let u=Ml(e-a*r-c*i,t),l=Ml(-a*n-c*o,t);const f=u>s,d=l>s;if(f&&(u=t-u),d&&(l=t-l),u>s||l>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:d,k2:l}}}},cl);BigInt(0),af.ProjectivePoint;var cf=i(2791);function uf(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]}const lf=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return uf(e)?e.slice(2):e};function ff(e){let t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received "+typeof t);return t.length%2&&(t=`0${t}`),t}function df(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||void 0!==t&&t>0&&e.length!==2+2*t)}const hf=function(e){if(!(e instanceof Uint8Array))throw new Error(`This method only supports Uint8Array but input was: ${e}`)},pf=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0"))),gf=e=>{let t="0x";if(void 0===e||0===e.length)return t;for(const r of e)t+=pf[r];return t},yf=e=>{const t=gf(e);return"0x"===t?BigInt(0):BigInt(t)},mf=e=>{if("string"!=typeof e)throw new Error(`hex argument type ${typeof e} must be of type string`);if(!e.startsWith("0x"))throw new Error(`prefixed hex input should start with 0x, got ${e.substring(0,2)}`);(e=e.slice(2)).length%2!=0&&(e=ff(e));const t=e.length/2,r=new Uint8Array(t);for(let n=0;n<t;n++){const t=parseInt(e.slice(2*n,2*(n+1)),16);r[n]=t}return r},bf=e=>{if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`},vf=e=>{const t=bf(e);return mf(t)},wf=e=>Sf("0x"+ff(e.toString(16))),Af=e=>new Uint8Array(e),Ef=(e,t)=>(hf(e),((e,t,r)=>r?e.length<t?new Uint8Array([...e,...Af(t-e.length)]):e.subarray(0,t):e.length<t?new Uint8Array([...Af(t-e.length),...e]):e.subarray(-t))(e,t,!1)),_f=e=>(hf(e),(e=>{let t=e[0];for(;e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e})(e)),Sf=e=>{if(null==e)return new Uint8Array;if(Array.isArray(e)||e instanceof Uint8Array)return Uint8Array.from(e);if("string"==typeof e){if(!df(e))throw new Error(`Cannot convert string to Uint8Array. toBytes only supports 0x-prefixed hex strings and this string was given: ${e}`);return mf(e)}if("number"==typeof e)return vf(e);if("bigint"==typeof e){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to Uint8Array. Given: ${e}`);let t=e.toString(16);return t.length%2&&(t="0"+t),(e=>{if("0x"===e.slice(0,2))throw new Error("hex string is prefixed with 0x, should be unprefixed");return(0,cf.nr)(ff(e))})(t)}if(void 0!==e.toBytes)return e.toBytes();throw new Error("invalid type")},xf=e=>"string"!=typeof e||uf(e)?e:"0x"+e,Tf=e=>{for(const[t,r]of Object.entries(e))if(void 0!==r&&r.length>0&&0===r[0])throw new Error(`${t} cannot have leading zeroes, received: ${gf(r)}`)},Pf=e=>"0x"+e.toString(16),If=e=>_f(wf(e)),kf=(...e)=>{if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r},Of=BigInt("0xffffffffffffffff"),Cf=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Nf=(BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),af.CURVE.n,af.CURVE.n/BigInt(2));function Rf(e,t){if(e<56)return Uint8Array.from([e+t]);const r=Ff(e),n=Ff(t+55+r.length/2);return Uint8Array.from(Mf(n+r))}BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),mf("0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"),mf("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"),mf("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"),Uint8Array.from([128]),BigInt(1e9);Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Bf(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function Mf(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r;t[r]=Bf(e.slice(n,n+2))}return t}function Lf(...e){if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}function Ff(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function jf(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function Uf(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return jf(e)?Mf((r="string"!=typeof(n=e)?n:jf(n)?n.slice(2):n).length%2?`0${r}`:r):(t=e,(new TextEncoder).encode(t));var t,r,n;if("number"==typeof e||"bigint"==typeof e)return e?Mf(Ff(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}const Df=function e(t){if(Array.isArray(t)){const r=[];let n=0;for(let i=0;i<t.length;i++){const o=e(t[i]);r.push(o),n+=o.length}return Lf(Rf(n,192),...r)}const r=Uf(t);return 1===r.length&&r[0]<128?r:Lf(Rf(r.length,128),r)};var Zf=i(6169);BigInt(0);const Hf=function(e){try{!function(e){if("string"!=typeof e)throw new Error(`This method only supports strings but input was: ${e}`)}(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)},$f=function(e,t){!function(e){if(!df(e))throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${e}`)}(e);const r=lf(e).toLowerCase();let n="";void 0!==t&&(n=yf(Sf(t)).toString()+"0x");const i=(0,cf.iY)(n+r),o=gf((0,Zf.wn)(i)).slice(2);let s="0x";for(let e=0;e<r.length;e++)parseInt(o[e],16)>=8?s+=r[e].toUpperCase():s+=r[e];return s},Gf=function(e,t=!1){if(hf(e),t&&64!==e.length&&(e=af.ProjectivePoint.fromHex(e).toRawBytes(!1).slice(1)),64!==e.length)throw new Error("Expected pubKey to be of length 64");return(0,Zf.wn)(e).subarray(-20)},zf=Gf;new Uint8Array(0);class Vf{constructor(e){if(20!==e.length)throw new Error("Invalid address length");this.bytes=e}static zero(){return new Vf(Af(20))}static fromString(e){if(!Hf(e))throw new Error("Invalid address");return new Vf(Sf(e))}static fromPublicKey(e){if(!(e instanceof Uint8Array))throw new Error("Public key should be Uint8Array");const t=Gf(e);return new Vf(t)}static fromPrivateKey(e){if(!(e instanceof Uint8Array))throw new Error("Private key should be Uint8Array");const t=function(e){return zf(function(e){return hf(e),af.ProjectivePoint.fromPrivateKey(e).toRawBytes(!1).slice(1)}(e))}(e);return new Vf(t)}static generate(e,t){if("bigint"!=typeof t)throw new Error("Expected nonce to be a bigint");return new Vf(function(e,t){return hf(e),hf(t),yf(t)===BigInt(0)?(0,Zf.wn)(Df([e,Uint8Array.from([])])).subarray(-20):(0,Zf.wn)(Df([e,t])).subarray(-20)}(e.bytes,wf(t)))}static generate2(e,t,r){if(!(t instanceof Uint8Array))throw new Error("Expected salt to be a Uint8Array");if(!(r instanceof Uint8Array))throw new Error("Expected initCode to be a Uint8Array");return new Vf(function(e,t,r){if(hf(e),hf(t),hf(r),20!==e.length)throw new Error("Expected from to be of length 20");if(32!==t.length)throw new Error("Expected salt to be of length 32");return(0,Zf.wn)(kf(mf("0xff"),e,t,(0,Zf.wn)(r))).subarray(-20)}(e.bytes,t,r))}equals(e){return(0,cf.hD)(this.bytes,e.bytes)}isZero(){return this.equals(Vf.zero())}isPrecompileOrSystemAddress(){const e=yf(this.bytes),t=BigInt(0),r=BigInt("0xffff");return e>=t&&e<=r}toString(){return gf(this.bytes)}toBytes(){return new Uint8Array(this.bytes)}}var Wf,qf,Kf,Jf;function Yf(e,t){if(null===e)return null;if(void 0===e)return;if("string"==typeof e&&!df(e))throw new Error(`A string must be provided with a 0x-prefix, given: ${e}`);if("number"==typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const r=Sf(e);switch(t){case Kf.Uint8Array:return r;case Kf.BigInt:return yf(r);case Kf.Number:{const e=yf(r);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(e)}case Kf.PrefixedHexString:return gf(r);default:throw new Error("unknown outputType")}}function Qf(e,t,r){const n=af.sign(e,t),i=n.toCompactRawBytes();return{r:i.slice(0,32),s:i.slice(32,64),v:void 0===r?BigInt(n.recovery+27):BigInt(n.recovery+35)+BigInt(r)*BigInt(2)}}!function(e){e.String="string",e.Bytes="view",e.Number="number"}(Wf||(Wf={})),function(e){e.String="string",e.Bytes="view",e.JSON="json"}(qf||(qf={})),(Jf=Kf||(Kf={}))[Jf.Number=0]="Number",Jf[Jf.BigInt=1]="BigInt",Jf[Jf.Uint8Array=2]="Uint8Array",Jf[Jf.PrefixedHexString=3]="PrefixedHexString";const Xf=function(e,t,r,n,i){const o=kf(Ef(r,32),Ef(n,32)),s=function(e,t){return e===BigInt(0)||e===BigInt(1)?e:void 0===t?e-BigInt(27):e-(t*BigInt(2)+BigInt(35))}(t,i);if(!function(e){return e===BigInt(0)||e===BigInt(1)}(s))throw new Error("Invalid signature v value");return af.Signature.fromCompact(o).addRecoveryBit(Number(s)).recoverPublicKey(e).toRawBytes(!1).slice(1)};var ed=i(2699);const td=(0,cf.gn)(cl);function rd(){throw Error("kzg library not loaded")}let nd={loadTrustedSetup:rd,blobToKzgCommitment:rd,computeBlobKzgProof:rd,verifyKzgProof:rd,verifyBlobKzgProofBatch:rd};const id=131072;function od(e){const t=new Uint8Array(131072);for(let r=0;r<4096;r++){const n=new Uint8Array(32);n.set(e.subarray(31*r,31*(r+1)),0),t.set(n,32*r)}return t}const sd=(e,t)=>{const r=new Uint8Array(32);return r.set([t],0),r.set(td(e).subarray(1),1),r};var ad=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,cd=Math.ceil,ud=Math.floor,ld="[BigNumber Error] ",fd=ld+"Number primitive has more than 15 significant digits: ",dd=1e14,hd=14,pd=9007199254740991,gd=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],yd=1e7,md=1e9;function bd(e){var t=0|e;return e>0||e===t?t:t-1}function vd(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=hd-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function wd(e,t){var r,n,i=e.c,o=t.c,s=e.s,a=t.s,c=e.e,u=t.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=c==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>u^r?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return c==u?0:c>u^r?1:-1}function Ad(e,t,r,n){if(e<t||e>r||e!==ud(e))throw Error(ld+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Ed(e){var t=e.c.length-1;return bd(e.e/hd)==t&&e.c[t]%2!=0}function _d(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Sd(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var xd=function e(t){var r,n,i,o,s,a,c,u,l,f,d=T.prototype={constructor:T,toString:null,valueOf:null},h=new T(1),p=20,g=4,y=-7,m=21,b=-1e7,v=1e7,w=!1,A=1,E=0,_={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",x=!0;function T(e,t){var r,o,s,a,c,u,l,f,d=this;if(!(d instanceof T))return new T(e,t);if(null==t){if(e&&!0===e._isBigNumber)return d.s=e.s,void(!e.c||e.e>v?d.c=d.e=null:e.e<b?d.c=[d.e=0]:(d.e=e.e,d.c=e.c.slice()));if((u="number"==typeof e)&&0*e==0){if(d.s=1/e<0?(e=-e,-1):1,e===~~e){for(a=0,c=e;c>=10;c/=10,a++);return void(a>v?d.c=d.e=null:(d.e=a,d.c=[e]))}f=String(e)}else{if(!ad.test(f=String(e)))return i(d,f,u);d.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(a=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(a<0&&(a=c),a+=+f.slice(c+1),f=f.substring(0,c)):a<0&&(a=f.length)}else{if(Ad(t,2,S.length,"Base"),10==t&&x)return O(d=new T(e),p+d.e+1,g);if(f=String(e),u="number"==typeof e){if(0*e!=0)return i(d,f,u,t);if(d.s=1/e<0?(f=f.slice(1),-1):1,T.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(fd+e)}else d.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=S.slice(0,t),a=c=0,l=f.length;c<l;c++)if(r.indexOf(o=f.charAt(c))<0){if("."==o){if(c>a){a=l;continue}}else if(!s&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){s=!0,c=-1,a=0;continue}return i(d,String(e),u,t)}u=!1,(a=(f=n(f,t,10,d.s)).indexOf("."))>-1?f=f.replace(".",""):a=f.length}for(c=0;48===f.charCodeAt(c);c++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(c,++l)){if(l-=c,u&&T.DEBUG&&l>15&&(e>pd||e!==ud(e)))throw Error(fd+d.s*e);if((a=a-c-1)>v)d.c=d.e=null;else if(a<b)d.c=[d.e=0];else{if(d.e=a,d.c=[],c=(a+1)%hd,a<0&&(c+=hd),c<l){for(c&&d.c.push(+f.slice(0,c)),l-=hd;c<l;)d.c.push(+f.slice(c,c+=hd));c=hd-(f=f.slice(c)).length}else c-=l;for(;c--;f+="0");d.c.push(+f)}}else d.c=[d.e=0]}function P(e,t,r,n){var i,o,s,a,c;if(null==r?r=g:Ad(r,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)c=vd(e.c),c=1==n||2==n&&(s<=y||s>=m)?_d(c,s):Sd(c,s,"0");else if(o=(e=O(new T(e),t,r)).e,a=(c=vd(e.c)).length,1==n||2==n&&(t<=o||o<=y)){for(;a<t;c+="0",a++);c=_d(c,o)}else if(t-=s,c=Sd(c,o,"0"),o+1>a){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-a)>0)for(o+1==a&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function I(e,t){for(var r,n,i=1,o=new T(e[0]);i<e.length;i++)(!(n=new T(e[i])).s||(r=wd(o,n))===t||0===r&&o.s===t)&&(o=n);return o}function k(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*hd-1)>v?e.c=e.e=null:r<b?e.c=[e.e=0]:(e.e=r,e.c=t),e}function O(e,t,r,n){var i,o,s,a,c,u,l,f=e.c,d=gd;if(f){e:{for(i=1,a=f[0];a>=10;a/=10,i++);if((o=t-i)<0)o+=hd,s=t,c=f[u=0],l=ud(c/d[i-s-1]%10);else if((u=cd((o+1)/hd))>=f.length){if(!n)break e;for(;f.length<=u;f.push(0));c=l=0,i=1,s=(o%=hd)-hd+1}else{for(c=a=f[u],i=1;a>=10;a/=10,i++);l=(s=(o%=hd)-hd+i)<0?0:ud(c/d[i-s-1]%10)}if(n=n||t<0||null!=f[u+1]||(s<0?c:c%d[i-s-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(o>0?s>0?c/d[i-s]:0:f[u-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=d[(hd-t%hd)%hd],e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=u,a=1,u--):(f.length=u+1,a=d[hd-o],f[u]=s>0?ud(c/d[i-s]%d[s])*a:0),n)for(;;){if(0==u){for(o=1,s=f[0];s>=10;s/=10,o++);for(s=f[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(e.e++,f[0]==dd&&(f[0]=1));break}if(f[u]+=a,f[u]!=dd)break;f[u--]=0,a=1}for(o=f.length;0===f[--o];f.pop());}e.e>v?e.c=e.e=null:e.e<b&&(e.c=[e.e=0])}return e}function C(e){var t,r=e.e;return null===r?e.toString():(t=vd(e.c),t=r<=y||r>=m?_d(t,r):Sd(t,r,"0"),e.s<0?"-"+t:t)}return T.clone=e,T.ROUND_UP=0,T.ROUND_DOWN=1,T.ROUND_CEIL=2,T.ROUND_FLOOR=3,T.ROUND_HALF_UP=4,T.ROUND_HALF_DOWN=5,T.ROUND_HALF_EVEN=6,T.ROUND_HALF_CEIL=7,T.ROUND_HALF_FLOOR=8,T.EUCLID=9,T.config=T.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(ld+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(Ad(r=e[t],0,md,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(Ad(r=e[t],0,8,t),g=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(Ad(r[0],-md,0,t),Ad(r[1],0,md,t),y=r[0],m=r[1]):(Ad(r,-md,md,t),y=-(m=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)Ad(r[0],-md,-1,t),Ad(r[1],1,md,t),b=r[0],v=r[1];else{if(Ad(r,-md,md,t),!r)throw Error(ld+t+" cannot be zero: "+r);b=-(v=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(ld+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!r,Error(ld+"crypto unavailable");w=r}else w=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(Ad(r=e[t],0,9,t),A=r),e.hasOwnProperty(t="POW_PRECISION")&&(Ad(r=e[t],0,md,t),E=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(ld+t+" not an object: "+r);_=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(ld+t+" invalid: "+r);x="0123456789"==r.slice(0,10),S=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:g,EXPONENTIAL_AT:[y,m],RANGE:[b,v],CRYPTO:w,MODULO_MODE:A,POW_PRECISION:E,FORMAT:_,ALPHABET:S}},T.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!T.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-md&&i<=md&&i===ud(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%hd)<1&&(t+=hd),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=dd||r!==ud(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(ld+"Invalid BigNumber: "+e)},T.maximum=T.max=function(){return I(arguments,-1)},T.minimum=T.min=function(){return I(arguments,1)},T.random=(o=9007199254740992,s=Math.random()*o&2097151?function(){return ud(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,a=0,c=[],u=new T(h);if(null==e?e=p:Ad(e,0,md),i=cd(e/hd),w)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));a<i;)(o=131072*t[a]+(t[a+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[a]=r[0],t[a+1]=r[1]):(c.push(o%1e14),a+=2);a=i/2}else{if(!crypto.randomBytes)throw w=!1,Error(ld+"crypto unavailable");for(t=crypto.randomBytes(i*=7);a<i;)(o=281474976710656*(31&t[a])+1099511627776*t[a+1]+4294967296*t[a+2]+16777216*t[a+3]+(t[a+4]<<16)+(t[a+5]<<8)+t[a+6])>=9e15?crypto.randomBytes(7).copy(t,a):(c.push(o%1e14),a+=7);a=i/7}if(!w)for(;a<i;)(o=s())<9e15&&(c[a++]=o%1e14);for(i=c[--a],e%=hd,i&&e&&(o=gd[hd-e],c[a]=ud(i/o)*o);0===c[a];c.pop(),a--);if(a<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=hd);for(a=1,o=c[0];o>=10;o/=10,a++);a<hd&&(n-=hd-a)}return u.e=n,u.c=c,u}),T.sum=function(){for(var e=1,t=arguments,r=new T(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,s=[0],a=0,c=e.length;a<c;){for(o=s.length;o--;s[o]*=t);for(s[0]+=n.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var c,u,l,f,d,h,y,m,b=n.indexOf("."),v=p,w=g;for(b>=0&&(f=E,E=0,n=n.replace(".",""),h=(m=new T(i)).pow(n.length-b),E=f,m.c=t(Sd(vd(h.c),h.e,"0"),10,o,e),m.e=m.c.length),l=f=(y=t(n,i,o,a?(c=S,e):(c=e,S))).length;0==y[--f];y.pop());if(!y[0])return c.charAt(0);if(b<0?--l:(h.c=y,h.e=l,h.s=s,y=(h=r(h,m,v,w,o)).c,d=h.r,l=h.e),b=y[u=l+v+1],f=o/2,d=d||u<0||null!=y[u+1],d=w<4?(null!=b||d)&&(0==w||w==(h.s<0?3:2)):b>f||b==f&&(4==w||d||6==w&&1&y[u-1]||w==(h.s<0?8:7)),u<1||!y[0])n=d?Sd(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(y.length=u,d)for(--o;++y[--u]>o;)y[u]=0,u||(++l,y=[1].concat(y));for(f=y.length;!y[--f];);for(b=0,n="";b<=f;n+=c.charAt(y[b++]));n=Sd(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,c=e.length,u=t%yd,l=t/yd|0;for(e=e.slice();c--;)a=((i=u*(o=e[c]%yd)+(n=l*o+(s=e[c]/yd|0)*u)%yd*yd+a)/r|0)+(n/yd|0)+l*s,e[c]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,s,a){var c,u,l,f,d,h,p,g,y,m,b,v,w,A,E,_,S,x=n.s==i.s?1:-1,P=n.c,I=i.c;if(!(P&&P[0]&&I&&I[0]))return new T(n.s&&i.s&&(P?!I||P[0]!=I[0]:I)?P&&0==P[0]||!I?0*x:x/0:NaN);for(y=(g=new T(x)).c=[],x=o+(u=n.e-i.e)+1,a||(a=dd,u=bd(n.e/hd)-bd(i.e/hd),x=x/hd|0),l=0;I[l]==(P[l]||0);l++);if(I[l]>(P[l]||0)&&u--,x<0)y.push(1),f=!0;else{for(A=P.length,_=I.length,l=0,x+=2,(d=ud(a/(I[0]+1)))>1&&(I=e(I,d,a),P=e(P,d,a),_=I.length,A=P.length),w=_,b=(m=P.slice(0,_)).length;b<_;m[b++]=0);S=I.slice(),S=[0].concat(S),E=I[0],I[1]>=a/2&&E++;do{if(d=0,(c=t(I,m,_,b))<0){if(v=m[0],_!=b&&(v=v*a+(m[1]||0)),(d=ud(v/E))>1)for(d>=a&&(d=a-1),p=(h=e(I,d,a)).length,b=m.length;1==t(h,m,p,b);)d--,r(h,_<p?S:I,p,a),p=h.length,c=1;else 0==d&&(c=d=1),p=(h=I.slice()).length;if(p<b&&(h=[0].concat(h)),r(m,h,b,a),b=m.length,-1==c)for(;t(I,m,_,b)<1;)d++,r(m,_<b?S:I,b,a),b=m.length}else 0===c&&(d++,m=[0]);y[l++]=d,m[0]?m[b++]=P[w]||0:(m=[P[w]],b=1)}while((w++<A||null!=m[0])&&x--);f=null!=m[0],y[0]||y.splice(0,1)}if(a==dd){for(l=1,x=y[0];x>=10;x/=10,l++);O(g,o+(g.e=l+u*hd-1)+1,s,f)}else g.e=u,g.r=+f;return g}}(),a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,u=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(f,"");if(l.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(a,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(c,"$1").replace(u,"0.$1")),t!=o))return new T(o,i);if(T.DEBUG)throw Error(ld+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},d.absoluteValue=d.abs=function(){var e=new T(this);return e.s<0&&(e.s=1),e},d.comparedTo=function(e,t){return wd(this,new T(e,t))},d.decimalPlaces=d.dp=function(e,t){var r,n,i,o=this;if(null!=e)return Ad(e,0,md),null==t?t=g:Ad(t,0,8),O(new T(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-bd(this.e/hd))*hd,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},d.dividedBy=d.div=function(e,t){return r(this,new T(e,t),p,g)},d.dividedToIntegerBy=d.idiv=function(e,t){return r(this,new T(e,t),0,1)},d.exponentiatedBy=d.pow=function(e,t){var r,n,i,o,s,a,c,u,l=this;if((e=new T(e)).c&&!e.isInteger())throw Error(ld+"Exponent not an integer: "+C(e));if(null!=t&&(t=new T(t)),s=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return u=new T(Math.pow(+C(l),s?e.s*(2-Ed(e)):+C(e))),t?u.mod(t):u;if(a=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new T(NaN);(n=!a&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||s&&l.c[1]>=24e7:l.c[0]<8e13||s&&l.c[0]<=9999975e7)))return o=l.s<0&&Ed(e)?-0:0,l.e>-1&&(o=1/o),new T(a?1/o:o);E&&(o=cd(E/hd+2))}for(s?(r=new T(.5),a&&(e.s=1),c=Ed(e)):c=(i=Math.abs(+C(e)))%2,u=new T(h);;){if(c){if(!(u=u.times(l)).c)break;o?u.c.length>o&&(u.c.length=o):n&&(u=u.mod(t))}if(i){if(0===(i=ud(i/2)))break;c=i%2}else if(O(e=e.times(r),e.e+1,1),e.e>14)c=Ed(e);else{if(0==(i=+C(e)))break;c=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):n&&(l=l.mod(t))}return n?u:(a&&(u=h.div(u)),t?u.mod(t):o?O(u,E,g,void 0):u)},d.integerValue=function(e){var t=new T(this);return null==e?e=g:Ad(e,0,8),O(t,t.e+1,e)},d.isEqualTo=d.eq=function(e,t){return 0===wd(this,new T(e,t))},d.isFinite=function(){return!!this.c},d.isGreaterThan=d.gt=function(e,t){return wd(this,new T(e,t))>0},d.isGreaterThanOrEqualTo=d.gte=function(e,t){return 1===(t=wd(this,new T(e,t)))||0===t},d.isInteger=function(){return!!this.c&&bd(this.e/hd)>this.c.length-2},d.isLessThan=d.lt=function(e,t){return wd(this,new T(e,t))<0},d.isLessThanOrEqualTo=d.lte=function(e,t){return-1===(t=wd(this,new T(e,t)))||0===t},d.isNaN=function(){return!this.s},d.isNegative=function(){return this.s<0},d.isPositive=function(){return this.s>0},d.isZero=function(){return!!this.c&&0==this.c[0]},d.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new T(e,t)).s,!a||!t)return new T(NaN);if(a!=t)return e.s=-t,s.plus(e);var c=s.e/hd,u=e.e/hd,l=s.c,f=e.c;if(!c||!u){if(!l||!f)return l?(e.s=-t,e):new T(f?s:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new T(l[0]?s:3==g?-0:0)}if(c=bd(c),u=bd(u),l=l.slice(),a=c-u){for((o=a<0)?(a=-a,i=l):(u=c,i=f),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=l.length)<(t=f.length))?a:t,a=t=0;t<n;t++)if(l[t]!=f[t]){o=l[t]<f[t];break}if(o&&(i=l,l=f,f=i,e.s=-e.s),(t=(n=f.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=dd-1;n>a;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=t);--l[r],l[n]+=dd}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--u);return l[0]?k(e,l,u):(e.s=3==g?-1:1,e.c=[e.e=0],e)},d.modulo=d.mod=function(e,t){var n,i,o=this;return e=new T(e,t),!o.c||!e.s||e.c&&!e.c[0]?new T(NaN):!e.c||o.c&&!o.c[0]?new T(o):(9==A?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,A),(e=o.minus(n.times(e))).c[0]||1!=A||(e.s=o.s),e)},d.multipliedBy=d.times=function(e,t){var r,n,i,o,s,a,c,u,l,f,d,h,p,g,y,m=this,b=m.c,v=(e=new T(e,t)).c;if(!(b&&v&&b[0]&&v[0]))return!m.s||!e.s||b&&!b[0]&&!v||v&&!v[0]&&!b?e.c=e.e=e.s=null:(e.s*=m.s,b&&v?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bd(m.e/hd)+bd(e.e/hd),e.s*=m.s,(c=b.length)<(f=v.length)&&(p=b,b=v,v=p,i=c,c=f,f=i),i=c+f,p=[];i--;p.push(0));for(g=dd,y=yd,i=f;--i>=0;){for(r=0,d=v[i]%y,h=v[i]/y|0,o=i+(s=c);o>i;)r=((u=d*(u=b[--s]%y)+(a=h*u+(l=b[s]/y|0)*d)%y*y+p[o]+r)/g|0)+(a/y|0)+h*l,p[o--]=u%g;p[o]=r}return r?++n:p.splice(0,1),k(e,p,n)},d.negated=function(){var e=new T(this);return e.s=-e.s||null,e},d.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new T(e,t)).s,!i||!t)return new T(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/hd,s=e.e/hd,a=n.c,c=e.c;if(!o||!s){if(!a||!c)return new T(i/0);if(!a[0]||!c[0])return c[0]?e:new T(a[0]?n:0*i)}if(o=bd(o),s=bd(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=c):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=c.length)<0&&(r=c,c=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+c[t]+i)/dd|0,a[t]=dd===a[t]?0:a[t]%dd;return i&&(a=[i].concat(a),++s),k(e,a,s)},d.precision=d.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return Ad(e,1,md),null==t?t=g:Ad(t,0,8),O(new T(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*hd+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},d.shiftedBy=function(e){return Ad(e,-9007199254740991,pd),this.times("1e"+e)},d.squareRoot=d.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,c=s.s,u=s.e,l=p+4,f=new T("0.5");if(1!==c||!a||!a[0])return new T(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+C(s)))||c==1/0?(((t=vd(a)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=bd((u+1)/2)-(u<0||u%2),n=new T(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new T(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(o=n,n=f.times(o.plus(r(s,o,l,1))),vd(o.c).slice(0,c)===(t=vd(n.c)).slice(0,c)){if(n.e<u&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(O(n,n.e+p+2,1),e=!n.times(n).eq(s));break}if(!i&&(O(o,o.e+p+2,0),o.times(o).eq(s))){n=o;break}l+=4,c+=4,i=1}return O(n,n.e+p+1,g,e)},d.toExponential=function(e,t){return null!=e&&(Ad(e,0,md),e++),P(this,e,t,1)},d.toFixed=function(e,t){return null!=e&&(Ad(e,0,md),e=e+this.e+1),P(this,e,t)},d.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=_;else if("object"!=typeof r)throw Error(ld+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,s=n.split("."),a=+r.groupSize,c=+r.secondaryGroupSize,u=r.groupSeparator||"",l=s[0],f=s[1],d=i.s<0,h=d?l.slice(1):l,p=h.length;if(c&&(o=a,a=c,c=o,p-=o),a>0&&p>0){for(o=p%a||a,l=h.substr(0,o);o<p;o+=a)l+=u+h.substr(o,a);c>0&&(l+=u+h.slice(o)),d&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},d.toFraction=function(e){var t,n,i,o,s,a,c,u,l,f,d,p,y=this,m=y.c;if(null!=e&&(!(c=new T(e)).isInteger()&&(c.c||1!==c.s)||c.lt(h)))throw Error(ld+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+C(c));if(!m)return new T(y);for(t=new T(h),l=n=new T(h),i=u=new T(h),p=vd(m),s=t.e=p.length-y.e-1,t.c[0]=gd[(a=s%hd)<0?hd+a:a],e=!e||c.comparedTo(t)>0?s>0?t:l:c,a=v,v=1/0,c=new T(p),u.c[0]=0;f=r(c,t,0,1),1!=(o=n.plus(f.times(i))).comparedTo(e);)n=i,i=o,l=u.plus(f.times(o=l)),u=o,t=c.minus(f.times(o=t)),c=o;return o=r(e.minus(n),i,0,1),u=u.plus(o.times(l)),n=n.plus(o.times(i)),u.s=l.s=y.s,d=r(l,i,s*=2,g).minus(y).abs().comparedTo(r(u,n,s,g).minus(y).abs())<1?[l,i]:[u,n],v=a,d},d.toNumber=function(){return+C(this)},d.toPrecision=function(e,t){return null!=e&&Ad(e,1,md),P(this,e,t,2)},d.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=y||o>=m?_d(vd(r.c),o):Sd(vd(r.c),o,"0"):10===e&&x?t=Sd(vd((r=O(new T(r),p+o+1,g)).c),r.e,"0"):(Ad(e,2,S.length,"Base"),t=n(Sd(vd(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},d.valueOf=d.toJSON=function(){return C(this)},d._isBigNumber=!0,d[Symbol.toStringTag]="BigNumber",d[Symbol.for("nodejs.util.inspect.custom")]=d.valueOf,null!=t&&T.set(t),T}();const Td=xd;function Pd(e,t){return Fu[t]?`${Fu[t].blockExplorerUrl}/tx/${e}`:""}const Id=(e,t)=>{var r;let n="";n=e.type===yu||e.type===mu?e.symbol:e.type===gu?(0,a.formatSmallNumbers)(Number.parseFloat(e.total_amount),e.symbol,!0):(0,a.formatSmallNumbers)(Number.parseFloat(e.total_amount),e.type_name,!0);const i=e.type===yu||e.type===mu?"":(0,a.formatSmallNumbers)(Number.parseFloat(e.currency_amount),e.selected_currency,!0);return{id:e.created_at.toString(),date:new Date(e.created_at).toString(),from:e.from,from_aa_address:e.from_aa_address,slicedFrom:"string"==typeof e.from?(0,a.addressSlicer)(e.from):"",to:e.to,slicedTo:"string"==typeof e.to?(0,a.addressSlicer)(e.to):"",action:t===(null===(r=e.to)||void 0===r?void 0:r.toLowerCase())?a.ACTIVITY_ACTION_RECEIVE:a.ACTIVITY_ACTION_SEND,totalAmount:e.total_amount,totalAmountString:n,currencyAmount:e.currency_amount,currencyAmountString:i,amount:`${n} / ${i}`,status:e.status,etherscanLink:Pd(e.transaction_hash,e.network||Eu),networkType:e.network,ethRate:Number.parseFloat(null==e?void 0:e.total_amount)&&Number.parseFloat(null==e?void 0:e.currency_amount)?`1 ${e.symbol} = ${(0,a.significantDigits)(Number.parseFloat(e.currency_amount)/Number.parseFloat(e.total_amount))}`:"",currencyUsed:e.selected_currency,type:e.type,type_name:e.type_name,type_image_link:e.type_image_link,transaction_hash:e.transaction_hash,transaction_category:e.transaction_category,contract_address:e.contract_address||"",nonce:e.nonce||"",is_cancel:!!e.is_cancel||!1,gas:e.gas||"",gasPrice:e.gasPrice||""}},kd=async(e,t)=>{try{const r=await t.request({method:ju.ETH_GET_TRANSACTION_RECEIPT,params:[e]});return null===r?a.TransactionStatus.submitted:r&&"0x1"===r.status?a.TransactionStatus.confirmed:r&&"0x0"===r.status?a.TransactionStatus.rejected:void 0}catch(e){return void au().warn("unable to fetch transaction status",e)}};function Od(e){const t=new Date(e);return`${t.getDate()} ${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()]} ${t.getFullYear()}`}function Cd(e){return new Date(e).toTimeString().slice(0,8)}const Nd=(e=>{let t=!1,r=null;const n=()=>{r&&window.clearTimeout(r),t=!1,r=window.setTimeout((()=>{t=!0}),18e4)};return window.addEventListener("load",n),document.addEventListener("mousemove",n),document.addEventListener("keydown",n),{checkIfIdle:function(){return t}}})();function Rd(e,t){return Hf(e)}function Bd(e,t){return Rd(e)?$f(e):e}const Md={SIMPLE:xf(21e3.toString(16)),BASE_TOKEN_ESTIMATE:xf(1e5.toString(16))};function Ld(e,t){return null==e||null==t?null:new Td(e,10).lt(t,10)}const Fd=e=>`https://infura-ipfs.io/${e}`;function jd(e){let t=e;if(null!=e&&e.startsWith("ipfs")){const r=e.split("ipfs://")[1];t=Fd(r)}return t}function Ud(e){return e===Eu?"mainnet":$u.includes(e)?"testnet":"custom"}class Dd extends a.BaseBlockTracker{constructor(e){let{config:t,state:r={}}=e;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super({config:t,state:r});const n=t.pollingInterval||20,i=t.retryTimeout||2;this.defaultConfig={provider:t.provider,pollingInterval:1e3*n,retryTimeout:1e3*i,setSkipCacheFlag:t.setSkipCacheFlag||!1},this.initialize()}async checkForLatestBlock(){return await this._updateLatestBlock(),this.getLatestBlock()}_start(){this._synchronize().catch((e=>this.emit("error",e)))}async _synchronize(){for(;this.state._isRunning;){if(Nd.checkIfIdle())return;try{await this._updateLatestBlock(),await(0,a.timeout)(this.config.pollingInterval)}catch(e){const t=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${e.stack}`);try{this.emit("error",t)}catch(e){au().error(t)}await(0,a.timeout)(this.config.retryTimeout)}}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){try{const e=await this.config.provider.request({method:"eth_getBlockByNumber",params:["latest",!1]});return{blockHash:e.hash,idempotencyKey:e.number,timestamp:e.timestamp,baseFeePerGas:e.baseFeePerGas,gasLimit:e.gasLimit}}catch(e){throw au().error("Polling Block Tracker: ",e),new Error(`PollingBlockTracker - encountered error fetching block:\n${e.message}`)}}}const Zd=Dd;var Hd=i(3460);class $d extends a.BaseCurrencyController{constructor(e){let{config:t,state:r,onNetworkChanged:i}=e;super({config:t,state:r}),(0,s.Z)(this,"conversionInterval",void 0),this.defaultState=(0,n.Z)((0,n.Z)({},this.defaultState),{},{commonDenomination:"USD",commonDenominatorPrice:0}),this.initialize(),i((e=>{e.providerConfig.ticker.toUpperCase()!==this.state.nativeCurrency.toUpperCase()&&(this.setNativeCurrency(e.providerConfig.ticker),this.updateConversionRate())}))}setCommonDenomination(e){this.update({commonDenomination:e})}getCommonDenomination(){return this.state.commonDenomination}setCommonDenominatorPrice(e){this.update({commonDenominatorPrice:e})}getCommonDenominatorPrice(){return this.state.commonDenominatorPrice}scheduleConversionInterval(){this.conversionInterval&&window.clearInterval(this.conversionInterval),this.conversionInterval=window.setInterval((()=>{Nd.checkIfIdle()||this.updateConversionRate()}),this.config.pollInterval)}async updateConversionRate(){const e=this.getCurrentCurrency(),t=this.getNativeCurrency(),r=this.getCommonDenomination(),n=await this.retrieveConversionRate(t,e,r),i=Number.parseFloat(n[e.toUpperCase()]),o=Number.parseFloat(n[r.toUpperCase()]);i||o?(this.setConversionRate(i),this.setConversionDate(Math.floor(Date.now()/1e3).toString()),e.toUpperCase()===r.toUpperCase()?this.setCommonDenominatorPrice(i):this.setCommonDenominatorPrice(o)):(this.setConversionRate(0),this.setConversionDate("N/A"))}async retrieveConversionRate(e,t,r){try{let n=`${this.config.api}/currency?fsym=${e.toUpperCase()}&tsyms=${t.toUpperCase()}`;return r&&r.toUpperCase()!==t.toUpperCase()&&(n+=`,${r.toUpperCase()}`),await(0,Hd.get)(n)}catch(r){au().error(r,`CurrencyController - updateCommonDenominatorPrice: Failed to query rate for currency: ${e}/ ${t}`)}return{[t.toUpperCase()]:"0",[r.toUpperCase()]:"0"}}}var Gd=i(7921),zd=i(2197),Vd=i.n(zd);const Wd=new Td("1000000000000000000"),qd=new Td("1000000000"),Kd=new Td("1"),Jd={hex:e=>new Td(lf(e),16),dec:e=>new Td(String(e),10),BN:e=>new Td(e.toString(16),16)},Yd={WEI:e=>e.div(Wd),GWEI:e=>e.div(qd),ETH:e=>e.div(Kd)},Qd={WEI:e=>e.times(Wd).dp(0,Td.ROUND_HALF_UP),GWEI:e=>e.times(qd).dp(9,Td.ROUND_HALF_UP),ETH:e=>e.times(Kd).dp(9,Td.ROUND_HALF_UP)},Xd={hex:e=>e.toString(16),dec:e=>new Td(e).toString(10),BN:e=>new(Vd())(e.toString(16))},eh=(e,t)=>{let{fromCurrency:r=null,toCurrency:n=r,fromNumericBase:i,toNumericBase:o,fromDenomination:s,toDenomination:a,numberOfDecimals:c,conversionRate:u,invertConversionRate:l}=t;return r===n||u?(e=>{let{value:t,fromNumericBase:r,fromDenomination:n,fromCurrency:i,toNumericBase:o,toDenomination:s,toCurrency:a,numberOfDecimals:c,conversionRate:u,invertConversionRate:l,roundDown:f}=e,d=r?Jd[r](t):t;if(n&&(d=Yd[n](d)),i!==a){if(null==u)throw new Error(`Converting from ${i} to ${a} requires a conversionRate, but one was not provided`);let e=Jd.dec(u);l&&(e=new Td(1).div(u)),d=d.times(e)}return s&&(d=Qd[s](d)),c&&(d=d.dp(c,Td.ROUND_HALF_DOWN)),f&&(d=d.dp(f,Td.ROUND_DOWN)),o&&(d=Xd[o](d)),d})({fromCurrency:r,toCurrency:n,fromNumericBase:i,toNumericBase:o,fromDenomination:s,toDenomination:a,numberOfDecimals:c,conversionRate:u,invertConversionRate:l,value:e}):0},th=e=>eh(e,{fromNumericBase:"dec",toNumericBase:"hex",fromDenomination:"GWEI",toDenomination:"WEI"}),rh=e=>eh(e,{fromNumericBase:"hex",toNumericBase:"dec",fromDenomination:"WEI",toDenomination:"GWEI"});function nh(e){const t=th(new Td(e));return rh(t)}async function ih(e){const t=await(0,Hd.get)(e);return{estimatedBaseFee:nh(t.estimatedBaseFee).toString(10),low:(0,n.Z)((0,n.Z)({},t.low),{},{suggestedMaxPriorityFeePerGas:nh(t.low.suggestedMaxPriorityFeePerGas).toString(10),suggestedMaxFeePerGas:nh(t.low.suggestedMaxFeePerGas).toString(10)}),medium:(0,n.Z)((0,n.Z)({},t.medium),{},{suggestedMaxPriorityFeePerGas:nh(t.medium.suggestedMaxPriorityFeePerGas).toString(10),suggestedMaxFeePerGas:nh(t.medium.suggestedMaxFeePerGas).toString(10)}),high:(0,n.Z)((0,n.Z)({},t.high),{},{suggestedMaxPriorityFeePerGas:nh(t.high.suggestedMaxPriorityFeePerGas).toString(10),suggestedMaxFeePerGas:nh(t.high.suggestedMaxFeePerGas).toString(10)})}}async function oh(e){const t=await e.request({method:"eth_feeHistory",params:[10,"latest",[10,50,95]]}),r=t.baseFeePerGas[t.baseFeePerGas.length-1],n=t.reward.reduce(((e,t)=>({slow:e.slow.plus(new Td(t[0],16)),average:e.average.plus(new Td(t[1],16)),fast:e.fast.plus(new Td(t[2],16))})),{slow:new Td(0),average:new Td(0),fast:new Td(0)});return{estimatedBaseFee:rh(r).toString(10),high:{maxWaitTimeEstimate:3e4,minWaitTimeEstimate:15e3,suggestedMaxFeePerGas:rh(n.fast.plus(r).toString(16)).toString(),suggestedMaxPriorityFeePerGas:rh(n.fast.toString(16)).toString()},medium:{maxWaitTimeEstimate:45e3,minWaitTimeEstimate:15e3,suggestedMaxFeePerGas:rh(n.average.plus(r).toString(16)).toString(),suggestedMaxPriorityFeePerGas:rh(n.average.toString(16)).toString()},low:{maxWaitTimeEstimate:6e4,minWaitTimeEstimate:15e3,suggestedMaxFeePerGas:rh(n.slow.plus(r).toString(16)).toString(),suggestedMaxPriorityFeePerGas:rh(n.slow.toString(16)).toString()}}}async function sh(e){const t=await(0,Hd.get)(e,{referrer:e,referrerPolicy:"no-referrer-when-downgrade",method:"GET"});return{low:t.SafeGasPrice,medium:t.ProposeGasPrice,high:t.FastGasPrice}}async function ah(e){const t=await e.request({method:ju.ETH_GET_GAS_PRICE});return{gasPrice:rh(t).toString()}}class ch extends a.BaseController{constructor(e){let{config:t,state:r,getNetworkIdentifier:n,getProvider:i,fetchGasEstimates:o=ih,fetchEthGasPriceEstimate:a=ah,fetchLegacyGasPriceEstimates:c=sh,fetchGasEstimatesViaEthFeeHistory:u=oh,getCurrentNetworkLegacyGasAPICompatibility:l,getCurrentNetworkEIP1559Compatibility:f,getCurrentAccountEIP1559Compatibility:d,onNetworkStateChange:h}=e;super({config:t,state:r}),(0,s.Z)(this,"name","GasFeeController"),(0,s.Z)(this,"intervalId",void 0),(0,s.Z)(this,"provider",void 0),(0,s.Z)(this,"currentChainId",void 0),(0,s.Z)(this,"getNetworkIdentifier",void 0),(0,s.Z)(this,"getProvider",void 0),(0,s.Z)(this,"fetchGasEstimates",void 0),(0,s.Z)(this,"fetchGasEstimatesViaEthFeeHistory",void 0),(0,s.Z)(this,"fetchEthGasPriceEstimate",void 0),(0,s.Z)(this,"fetchLegacyGasPriceEstimates",void 0),(0,s.Z)(this,"getCurrentNetworkEIP1559Compatibility",void 0),(0,s.Z)(this,"getCurrentAccountEIP1559Compatibility",void 0),(0,s.Z)(this,"getCurrentNetworkLegacyGasAPICompatibility",void 0),this.getNetworkIdentifier=n,this.getProvider=i,this.fetchGasEstimates=o,this.fetchEthGasPriceEstimate=a,this.fetchLegacyGasPriceEstimates=c,this.getCurrentNetworkEIP1559Compatibility=f,this.getCurrentNetworkLegacyGasAPICompatibility=l,this.getCurrentAccountEIP1559Compatibility=d,this.fetchGasEstimatesViaEthFeeHistory=u,this.defaultConfig={interval:3e4,legacyAPIEndpoint:"https://api.metaswap.codefi.network/gasPrices",EIP1559APIEndpoint:"https://mock-gas-server.herokuapp.com/"},this.defaultState={gasFeeEstimates:{},estimatedGasFeeTimeBounds:{},gasEstimateType:Du.NONE},this.currentChainId=this.getNetworkIdentifier(),this.provider=this.getProvider(),this.initialize(),h((()=>{this.onNetworkStateChange()}))}async onNetworkStateChange(){this.provider=this.getProvider();const e=this.getNetworkIdentifier();this.currentChainId!==e&&(this.currentChainId=e,await this.resetPolling())}async resetPolling(){this.stopPolling(),await this.getGasFeeEstimatesAndStartPolling()}async fetchGasFeeEstimates(){return this._fetchGasFeeEstimateData()}async getGasFeeEstimatesAndStartPolling(){await this._fetchGasFeeEstimateData(),this._startPolling()}disconnectPoller(){this.stopPolling()}destroy(){this.stopPolling()}stopPolling(){this.intervalId&&clearInterval(this.intervalId),this.resetState()}async _fetchGasFeeEstimateData(){let e;const t=this.getCurrentNetworkLegacyGasAPICompatibility(),r=this.getNetworkIdentifier();if("loading"===r)return;let n;"string"==typeof r&&df(xf(r))&&(n=Number.parseInt(r,16));try{e=await this.getEIP1559Compatibility(),au().info("eip1559 compatible",e)}catch(t){au().warn(t),e=!1}let i=(0,Gd.Z)(this.defaultState);try{if(e){let e;try{e=await this.fetchGasEstimates(this.config.EIP1559APIEndpoint.replace("<chain_id>",`${n}`))}catch(t){e=await this.fetchGasEstimatesViaEthFeeHistory(this.provider)}const{suggestedMaxPriorityFeePerGas:t,suggestedMaxFeePerGas:r}=e.medium;i={gasFeeEstimates:e,estimatedGasFeeTimeBounds:this.getTimeEstimate(t,r),gasEstimateType:Du.FEE_MARKET}}else{if(!t)throw new Error("Main gas fee/price estimation failed. Use fallback");i={gasFeeEstimates:await this.fetchLegacyGasPriceEstimates(this.config.legacyAPIEndpoint.replace("<chain_id>",`${n}`)),estimatedGasFeeTimeBounds:{},gasEstimateType:Du.LEGACY}}}catch{try{i={gasFeeEstimates:await this.fetchEthGasPriceEstimate(this.provider),estimatedGasFeeTimeBounds:{},gasEstimateType:Du.ETH_GASPRICE}}catch(e){throw new Error(`Gas fee/price estimation failed. Message: ${e.message}`)}}return this.update(i),i}async _startPolling(){this._poll()}async _poll(){this.intervalId&&window.clearInterval(this.intervalId),this.intervalId=window.setInterval((async()=>{Nd.checkIfIdle()||await this._fetchGasFeeEstimateData()}),this.config.interval)}resetState(){this.update((0,Gd.Z)(this.defaultState))}async getEIP1559Compatibility(){var e,t;const r=await this.getCurrentNetworkEIP1559Compatibility(),n=null===(e=null===(t=this.getCurrentAccountEIP1559Compatibility)||void 0===t?void 0:t.call(this))||void 0===e||e;return r&&n}getTimeEstimate(e,t){return this.state.gasFeeEstimates&&this.state.gasEstimateType===Du.FEE_MARKET?function(e,t,r){const{low:n,medium:i,high:o,estimatedBaseFee:s}=r,a=new Td(th(new Td(e)),16),c=new Td(th(new Td(t)),16),u=new Td(th(new Td(s)),16),l=Td.min(a,c.minus(u)),f=new Td(th(new Td(n.suggestedMaxPriorityFeePerGas)),16),d=new Td(th(new Td(i.suggestedMaxPriorityFeePerGas)),16),h=new Td(th(new Td(o.suggestedMaxPriorityFeePerGas)),16);let p,g;return l.lt(f)?(p=null,g="unknown"):l.gte(f)&&l.lt(d)?(p=n.minWaitTimeEstimate,g=n.maxWaitTimeEstimate):l.gte(d)&&l.lt(h)?(p=i.minWaitTimeEstimate,g=i.maxWaitTimeEstimate):l.eq(h)?(p=o.minWaitTimeEstimate,g=o.maxWaitTimeEstimate):(p=0,g=o.maxWaitTimeEstimate),{lowerTimeBound:p,upperTimeBound:g}}(e,t,this.state.gasFeeEstimates):{}}}var uh=i(539);class lh extends $c{address;#Xe;constructor(e,t){super(t),w(e&&"function"==typeof e.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#Xe=e,p(this,{address:fa(this.signingKey.publicKey)})}get signingKey(){return this.#Xe}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new lh(this.#Xe,e)}async signTransaction(e){const{to:t,from:r}=await h({to:e.to?Dr(e.to,this.provider):void 0,from:e.from?Dr(e.from,this.provider):void 0});null!=t&&(e.to=t),null!=r&&(e.from=r),null!=e.from&&(w(pt(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const n=Ia.from(e);return n.signature=this.signingKey.sign(n.unsignedHash),n.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign(function(e){return"string"==typeof e&&(e=Ft(e)),at(N([Ft("Ethereum Signed Message:\n"),Ft(String(e.length)),e]))}(e)).serialized}async signTypedData(e,t,r){const n=await en.resolveNames(e,t,r,(async e=>{v(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:e}});const t=await this.provider.resolveName(e);return v(null!=t,"unconfigured ENS name","UNCONFIGURED_NAME",{value:e}),t}));return this.signingKey.sign(en.hash(n.domain,t,n.value)).serialized}}const fh=function(e){return Js("sha256").update(e).digest()},dh=function(e){return Js("sha512").update(e).digest()};let hh=fh,ph=dh,gh=!1,yh=!1;function mh(e){const t=T(e,"data");return C(hh(t))}function bh(e){const t=T(e,"data");return C(ph(t))}mh._=fh,mh.lock=function(){gh=!0},mh.register=function(e){if(gh)throw new Error("sha256 is locked");hh=e},Object.freeze(mh),bh._=dh,bh.lock=function(){yh=!0},bh.register=function(e){if(yh)throw new Error("sha512 is locked");ph=e},Object.freeze(mh);const vh=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),wh=Uint8Array.from({length:16},((e,t)=>t)),Ah=wh.map((e=>(9*e+5)%16));let Eh=[wh],_h=[Ah];for(let e=0;e<4;e++)for(let t of[Eh,_h])t.push(t[e].map((e=>vh[e])));const Sh=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((e=>new Uint8Array(e))),xh=Eh.map(((e,t)=>e.map((e=>Sh[t][e])))),Th=_h.map(((e,t)=>e.map((e=>Sh[t][e])))),Ph=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Ih=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),kh=(e,t)=>e<<t|e>>>32-t;function Oh(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const Ch=new Uint32Array(16);class Nh extends Ns{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)Ch[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,o=i,s=0|this.h2,a=s,c=0|this.h3,u=c,l=0|this.h4,f=l;for(let e=0;e<5;e++){const t=4-e,d=Ph[e],h=Ih[e],p=Eh[e],g=_h[e],y=xh[e],m=Th[e];for(let t=0;t<16;t++){const n=kh(r+Oh(e,i,s,c)+Ch[p[t]]+d,y[t])+l|0;r=l,l=c,c=0|kh(s,10),s=i,i=n}for(let e=0;e<16;e++){const r=kh(n+Oh(t,o,a,u)+Ch[g[e]]+h,m[e])+f|0;n=f,f=u,u=0|kh(a,10),a=o,o=r}}this.set(this.h1+s+u|0,this.h2+c+f|0,this.h3+l+n|0,this.h4+r+o|0,this.h0+i+a|0)}roundClean(){Ch.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const Rh=De((()=>new Nh));let Bh=!1;const Mh=function(e){return Rh(e)};let Lh=Mh;function Fh(e){const t=T(e,"data");return C(Lh(t))}Fh._=Mh,Fh.lock=function(){Bh=!0},Fh.register=function(e){if(Bh)throw new TypeError("ripemd160 is locked");Lh=e},Object.freeze(Fh);let jh=!1;const Uh=function(e){return new Uint8Array(function(e){v(null!=Ks,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),w(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const t=new Uint8Array(e);return Ks.getRandomValues(t),t}(e))};let Dh=Uh;function Zh(e){return Dh(e)}Zh._=Uh,Zh.lock=function(){jh=!0},Zh.register=function(e){if(jh)throw new Error("randomBytes is locked");Dh=e},Object.freeze(Zh);const Hh=" !#$%&'()*+,-./<=>?@[]^_`{|}~",$h=/^[a-z]*$/i;function Gh(e,t){let r=97;return e.reduce(((e,n)=>(n===t?r++:n.match($h)?e.push(String.fromCharCode(r)+n):(r=97,e.push(n)),e)),[])}class zh{locale;constructor(e){p(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}class Vh extends zh{#t;#et;constructor(e,t,r){super(e),this.#t=t,this.#et=r,this.#tt=null}get _data(){return this.#t}_decodeWords(){return w("0"===(e=this.#t)[0],"unsupported auwl data","data",e),function(e,t){for(let r=28;r>=0;r--)e=e.split(Hh[r]).join(t.substring(2*r,2*r+2));const r=[],n=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,((e,t,n,i)=>{if(n)for(let e=parseInt(n);e>=0;e--)r.push(";");else r.push(t.toLowerCase());return""}));if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return Gh(Gh(r,";"),":")}(e.substring(59),e.substring(1,59));var e}#tt;#rt(){if(null==this.#tt){const e=this._decodeWords();if(Zt(e.join("\n")+"\n")!==this.#et)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#tt=e}return this.#tt}getWord(e){const t=this.#rt();return w(e>=0&&e<t.length,`invalid word index: ${e}`,"index",e),t[e]}getWordIndex(e){return this.#rt().indexOf(e)}}let Wh=null;class qh extends Vh{constructor(){super("en","0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==Wh&&(Wh=new qh),Wh}}let Kh=!1;const Jh=function(e,t,r,n,i){return function(e,t,r,n,i){const o={sha256:Us,sha512:Ws}[i];return w(null!=o,"invalid pbkdf2 algorithm","algorithm",i),Cs(o,e,t,{c:r,dkLen:n})}(e,t,r,n,i)};let Yh=Jh;function Qh(e,t,r,n,i){const o=T(e,"password"),s=T(t,"salt");return C(Yh(o,s,r,n,i))}function Xh(e){return(1<<e)-1<<8-e&255}function ep(e,t){_("NFKD"),null==t&&(t=qh.wordlist());const r=t.split(e);w(r.length%3==0&&r.length>=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*r.length/8));let i=0;for(let e=0;e<r.length;e++){let o=t.getWordIndex(r[e].normalize("NFKD"));w(o>=0,`invalid mnemonic word at index ${e}`,"mnemonic","[ REDACTED ]");for(let e=0;e<11;e++)o&1<<10-e&&(n[i>>3]|=1<<7-i%8),i++}const o=32*r.length/3,s=Xh(r.length/3);return w((T(mh(n.slice(0,o/8)))[0]&s)==(n[n.length-1]&s),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),C(n.slice(0,o/8))}function tp(e,t){w(e.length%4==0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==t&&(t=qh.wordlist());const r=[0];let n=11;for(let t=0;t<e.length;t++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1&255),n+=3);const i=e.length/4,o=parseInt(mh(e).substring(2,4),16)&Xh(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}Qh._=Jh,Qh.lock=function(){Kh=!0},Qh.register=function(e){if(Kh)throw new Error("pbkdf2 is locked");Yh=e},Object.freeze(Qh);const rp={};class np{phrase;password;wordlist;entropy;constructor(e,t,r,n,i){null==n&&(n=""),null==i&&(i=qh.wordlist()),S(e,rp,"Mnemonic"),p(this,{phrase:r,password:n,wordlist:i,entropy:t})}computeSeed(){const e=Ft("mnemonic"+this.password,"NFKD");return Qh(Ft(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,r){const n=ep(e,r);return e=tp(T(n),r),new np(rp,n,e,t,r)}static fromEntropy(e,t,r){const n=T(e,"entropy"),i=tp(n,r);return new np(rp,C(n),i,t,r)}static entropyToPhrase(e,t){return tp(T(e,"entropy"),t)}static phraseToEntropy(e,t){return ep(e,t)}static isValidMnemonic(e,t){try{return ep(e,t),!0}catch(e){}return!1}}var ip,op,sp,ap=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},cp=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};const up={16:10,24:12,32:14},lp=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],fp=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],dp=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],hp=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],pp=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],gp=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],yp=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],mp=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],bp=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],vp=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],wp=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Ap=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Ep=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],_p=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Sp=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function xp(e){const t=[];for(let r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}class Tp{get key(){return ap(this,ip,"f").slice()}constructor(e){if(ip.set(this,void 0),op.set(this,void 0),sp.set(this,void 0),!(this instanceof Tp))throw Error("AES must be instanitated with `new`");cp(this,ip,new Uint8Array(e),"f");const t=up[this.key.length];if(null==t)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");cp(this,sp,[],"f"),cp(this,op,[],"f");for(let e=0;e<=t;e++)ap(this,sp,"f").push([0,0,0,0]),ap(this,op,"f").push([0,0,0,0]);const r=4*(t+1),n=this.key.length/4,i=xp(this.key);let o;for(let e=0;e<n;e++)o=e>>2,ap(this,sp,"f")[o][e%4]=i[e],ap(this,op,"f")[t-o][e%4]=i[e];let s,a=0,c=n;for(;c<r;){if(s=i[n-1],i[0]^=fp[s>>16&255]<<24^fp[s>>8&255]<<16^fp[255&s]<<8^fp[s>>24&255]^lp[a]<<24,a+=1,8!=n)for(let e=1;e<n;e++)i[e]^=i[e-1];else{for(let e=1;e<n/2;e++)i[e]^=i[e-1];s=i[n/2-1],i[n/2]^=fp[255&s]^fp[s>>8&255]<<8^fp[s>>16&255]<<16^fp[s>>24&255]<<24;for(let e=n/2+1;e<n;e++)i[e]^=i[e-1]}let e,o,u=0;for(;u<n&&c<r;)e=c>>2,o=c%4,ap(this,sp,"f")[e][o]=i[u],ap(this,op,"f")[t-e][o]=i[u++],c++}for(let e=1;e<t;e++)for(let t=0;t<4;t++)s=ap(this,op,"f")[e][t],ap(this,op,"f")[e][t]=Ap[s>>24&255]^Ep[s>>16&255]^_p[s>>8&255]^Sp[255&s]}encrypt(e){if(16!=e.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const t=ap(this,sp,"f").length-1,r=[0,0,0,0];let n=xp(e);for(let e=0;e<4;e++)n[e]^=ap(this,sp,"f")[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)r[t]=hp[n[t]>>24&255]^pp[n[(t+1)%4]>>16&255]^gp[n[(t+2)%4]>>8&255]^yp[255&n[(t+3)%4]]^ap(this,sp,"f")[e][t];n=r.slice()}const i=new Uint8Array(16);let o=0;for(let e=0;e<4;e++)o=ap(this,sp,"f")[t][e],i[4*e]=255&(fp[n[e]>>24&255]^o>>24),i[4*e+1]=255&(fp[n[(e+1)%4]>>16&255]^o>>16),i[4*e+2]=255&(fp[n[(e+2)%4]>>8&255]^o>>8),i[4*e+3]=255&(fp[255&n[(e+3)%4]]^o);return i}decrypt(e){if(16!=e.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const t=ap(this,op,"f").length-1,r=[0,0,0,0];let n=xp(e);for(let e=0;e<4;e++)n[e]^=ap(this,op,"f")[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)r[t]=mp[n[t]>>24&255]^bp[n[(t+3)%4]>>16&255]^vp[n[(t+2)%4]>>8&255]^wp[255&n[(t+1)%4]]^ap(this,op,"f")[e][t];n=r.slice()}const i=new Uint8Array(16);let o=0;for(let e=0;e<4;e++)o=ap(this,op,"f")[t][e],i[4*e]=255&(dp[n[e]>>24&255]^o>>24),i[4*e+1]=255&(dp[n[(e+3)%4]>>16&255]^o>>16),i[4*e+2]=255&(dp[n[(e+2)%4]>>8&255]^o>>8),i[4*e+3]=255&(dp[255&n[(e+1)%4]]^o);return i}}ip=new WeakMap,op=new WeakMap,sp=new WeakMap;class Pp{constructor(e,t,r){if(r&&!(this instanceof r))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new Tp(t)},name:{enumerable:!0,value:e}})}}var Ip,kp,Op=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},Cp=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Np extends Pp{constructor(e,t){if(super("ECC",e,Np),Ip.set(this,void 0),kp.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Op(this,Ip,new Uint8Array(t),"f")}else Op(this,Ip,new Uint8Array(16),"f");Op(this,kp,this.iv,"f")}get iv(){return new Uint8Array(Cp(this,Ip,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=16){for(let t=0;t<16;t++)Cp(this,kp,"f")[t]^=e[r+t];Op(this,kp,this.aes.encrypt(Cp(this,kp,"f")),"f"),t.set(Cp(this,kp,"f"),r)}return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=16){const n=this.aes.decrypt(e.subarray(r,r+16));for(let i=0;i<16;i++)t[r+i]=n[i]^Cp(this,kp,"f")[i],Cp(this,kp,"f")[i]=e[r+i]}return t}}Ip=new WeakMap,kp=new WeakMap;new WeakMap,new WeakMap,new WeakSet;var Rp,Bp,Mp,Lp=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},Fp=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class jp extends Pp{constructor(e,t){super("CTR",e,jp),Rp.set(this,void 0),Bp.set(this,void 0),Mp.set(this,void 0),Lp(this,Mp,new Uint8Array(16),"f"),Fp(this,Mp,"f").fill(0),Lp(this,Rp,Fp(this,Mp,"f"),"f"),Lp(this,Bp,16,"f"),null==t&&(t=1),"number"==typeof t?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(Fp(this,Mp,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)Fp(this,Mp,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(16!==e.length)throw new TypeError("invalid counter initial Uint8Array value length");Fp(this,Mp,"f").set(e)}increment(){for(let e=15;e>=0;e--){if(255!==Fp(this,Mp,"f")[e]){Fp(this,Mp,"f")[e]++;break}Fp(this,Mp,"f")[e]=0}}encrypt(e){var t,r;const n=new Uint8Array(e);for(let e=0;e<n.length;e++)16===Fp(this,Bp,"f")&&(Lp(this,Rp,this.aes.encrypt(Fp(this,Mp,"f")),"f"),Lp(this,Bp,0,"f"),this.increment()),n[e]^=Fp(this,Rp,"f")[(Lp(this,Bp,(r=Fp(this,Bp,"f"),t=r++,r),"f"),t)];return n}decrypt(e){return this.encrypt(e)}}Rp=new WeakMap,Bp=new WeakMap,Mp=new WeakMap,new WeakMap,new WeakMap,new WeakMap;const Up=(e,t)=>e<<t|e>>>32-t;function Dp(e,t,r,n,i,o){let s=e[t++]^r[n++],a=e[t++]^r[n++],c=e[t++]^r[n++],u=e[t++]^r[n++],l=e[t++]^r[n++],f=e[t++]^r[n++],d=e[t++]^r[n++],h=e[t++]^r[n++],p=e[t++]^r[n++],g=e[t++]^r[n++],y=e[t++]^r[n++],m=e[t++]^r[n++],b=e[t++]^r[n++],v=e[t++]^r[n++],w=e[t++]^r[n++],A=e[t++]^r[n++],E=s,_=a,S=c,x=u,T=l,P=f,I=d,k=h,O=p,C=g,N=y,R=m,B=b,M=v,L=w,F=A;for(let e=0;e<8;e+=2)T^=Up(E+B|0,7),O^=Up(T+E|0,9),B^=Up(O+T|0,13),E^=Up(B+O|0,18),C^=Up(P+_|0,7),M^=Up(C+P|0,9),_^=Up(M+C|0,13),P^=Up(_+M|0,18),L^=Up(N+I|0,7),S^=Up(L+N|0,9),I^=Up(S+L|0,13),N^=Up(I+S|0,18),x^=Up(F+R|0,7),k^=Up(x+F|0,9),R^=Up(k+x|0,13),F^=Up(R+k|0,18),_^=Up(E+x|0,7),S^=Up(_+E|0,9),x^=Up(S+_|0,13),E^=Up(x+S|0,18),I^=Up(P+T|0,7),k^=Up(I+P|0,9),T^=Up(k+I|0,13),P^=Up(T+k|0,18),R^=Up(N+C|0,7),O^=Up(R+N|0,9),C^=Up(O+R|0,13),N^=Up(C+O|0,18),B^=Up(F+L|0,7),M^=Up(B+F|0,9),L^=Up(M+B|0,13),F^=Up(L+M|0,18);i[o++]=s+E|0,i[o++]=a+_|0,i[o++]=c+S|0,i[o++]=u+x|0,i[o++]=l+T|0,i[o++]=f+P|0,i[o++]=d+I|0,i[o++]=h+k|0,i[o++]=p+O|0,i[o++]=g+C|0,i[o++]=y+N|0,i[o++]=m+R|0,i[o++]=b+B|0,i[o++]=v+M|0,i[o++]=w+L|0,i[o++]=A+F|0}function Zp(e,t,r,n,i){let o=n+0,s=n+16*i;for(let n=0;n<16;n++)r[s+n]=e[t+16*(2*i-1)+n];for(let n=0;n<i;n++,o+=16,t+=16)Dp(r,s,e,t,r,o),n>0&&(s+=16),Dp(r,o,e,t+=16,r,s)}function Hp(e,t,r){const n=Ue({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:o,p:s,dkLen:a,asyncTick:c,maxmem:u,onProgress:l}=n;if(ue.number(i),ue.number(o),ue.number(s),ue.number(a),ue.number(c),ue.number(u),void 0!==l&&"function"!=typeof l)throw new Error("progressCb should be function");const f=128*o,d=f/4;if(i<=1||0!=(i&i-1)||i>=2**(f/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(s<0||s>137438953440/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const h=f*(i+s);if(h>u)throw new Error(`Scrypt: parameters too large, ${h} (128 * r * (N + p)) > ${u} (maxmem)`);const p=Cs(Us,e,t,{c:1,dkLen:f*s}),g=Ce(p),y=Ce(new Uint8Array(f*i)),m=Ce(new Uint8Array(f));let b=()=>{};if(l){const e=2*i*s,t=Math.max(Math.floor(e/1e4),1);let r=0;b=()=>{r++,!l||r%t&&r!==e||l(r/e)}}return{N:i,r:o,p:s,dkLen:a,blockSize32:d,V:y,B32:g,B:p,tmp:m,blockMixCb:b,asyncTick:c}}function $p(e,t,r,n,i){const o=Cs(Us,e,r,{c:1,dkLen:t});return r.fill(0),n.fill(0),i.fill(0),o}let Gp=!1,zp=!1;const Vp=async function(e,t,r,n,i,o,s){return await async function(e,t,r){const{N:n,r:i,p:o,dkLen:s,blockSize32:a,V:c,B32:u,B:l,tmp:f,blockMixCb:d,asyncTick:h}=Hp(e,t,r);for(let e=0;e<o;e++){const t=a*e;for(let e=0;e<a;e++)c[e]=u[t+e];let r=0;await Me(n-1,h,(e=>{Zp(c,r,c,r+=a,i),d()})),Zp(c,(n-1)*a,u,t,i),d(),await Me(n,h,(e=>{const r=u[t+a-16]%n;for(let e=0;e<a;e++)f[e]=u[t+e]^c[r*a+e];Zp(f,0,u,t,i),d()}))}return $p(e,s,l,c,f)}(e,t,{N:r,r:n,p:i,dkLen:o,onProgress:s})},Wp=function(e,t,r,n,i,o){return function(e,t,r){const{N:n,r:i,p:o,dkLen:s,blockSize32:a,V:c,B32:u,B:l,tmp:f,blockMixCb:d}=Hp(e,t,r);for(let e=0;e<o;e++){const t=a*e;for(let e=0;e<a;e++)c[e]=u[t+e];for(let e=0,t=0;e<n-1;e++)Zp(c,t,c,t+=a,i),d();Zp(c,(n-1)*a,u,t,i),d();for(let e=0;e<n;e++){const e=u[t+a-16]%n;for(let r=0;r<a;r++)f[r]=u[t+r]^c[e*a+r];Zp(f,0,u,t,i),d()}}return $p(e,s,l,c,f)}(e,t,{N:r,r:n,p:i,dkLen:o})};let qp=Vp,Kp=Wp;async function Jp(e,t,r,n,i,o,s){const a=T(e,"passwd"),c=T(t,"salt");return C(await qp(a,c,r,n,i,o,s))}function Yp(e,t,r,n,i,o){const s=T(e,"passwd"),a=T(t,"salt");return C(Kp(s,a,r,n,i,o))}function Qp(e){const t=T(e,"randomBytes");t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=C(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}function Xp(e){return"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),P(e)}function eg(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function tg(e){return"string"==typeof e?Ft(e,"NFKC"):P(e)}function rg(e,t){const r=t.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);w(null!=r,"invalid path","path",t);const n=r[1],i=r[3],o="!"===r[4];let s=e;for(const e of n.toLowerCase().split(".")){if(Array.isArray(s)){if(!e.match(/^[0-9]+$/))break;s=s[parseInt(e)]}else if("object"==typeof s){let t=null;for(const r in s)if(r.toLowerCase()===e){t=s[r];break}s=t}else s=null;if(null==s)break}if(w(!o||null!=s,"missing required value","path",n),i&&null!=s){if("int"===i){if("string"==typeof s&&s.match(/^-?[0-9]+$/))return parseInt(s);if(Number.isSafeInteger(s))return s}if("number"===i&&"string"==typeof s&&s.match(/^-?[0-9.]*$/))return parseFloat(s);if("data"===i&&"string"==typeof s)return Xp(s);if("array"===i&&Array.isArray(s))return s;if(i===typeof s)return s;w(!1,`wrong type found for ${i} `,"path",n)}return s}Jp._=Vp,Jp.lock=function(){zp=!0},Jp.register=function(e){if(zp)throw new Error("scrypt is locked");qp=e},Object.freeze(Jp),Yp._=Wp,Yp.lock=function(){Gp=!0},Yp.register=function(e){if(Gp)throw new Error("scryptSync is locked");Kp=e},Object.freeze(Yp);const ng="m/44'/60'/0'/0/0";function ig(e){try{const t=JSON.parse(e);if(3===(null!=t.version?parseInt(t.version):0))return!0}catch(e){}return!1}function og(e,t){const r=T(t),n=rg(e,"crypto.ciphertext:data!");w(C(at(N([r.slice(16,32),n]))).substring(2)===rg(e,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const i=function(e,t,r){if("aes-128-ctr"===rg(e,"crypto.cipher:string")){const n=rg(e,"crypto.cipherparams.iv:data!");return C(new jp(t,n).decrypt(r))}v(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}(e,r.slice(0,16),n),o=fa(i);if(e.address){let t=e.address.toLowerCase();t.startsWith("0x")||(t="0x"+t),w(pt(t)===o,"keystore address/privateKey mismatch","address",e.address)}const s={address:o,privateKey:i};if("0.1"===rg(e,"x-ethers.version:string")){const t=r.slice(32,64),n=rg(e,"x-ethers.mnemonicCiphertext:data!"),i=rg(e,"x-ethers.mnemonicCounter:data!"),o=new jp(t,i);s.mnemonic={path:rg(e,"x-ethers.path:string")||ng,locale:rg(e,"x-ethers.locale:string")||"en",entropy:C(T(o.decrypt(n)))}}return s}function sg(e){const t=rg(e,"crypto.kdf:string");if(t&&"string"==typeof t){if("scrypt"===t.toLowerCase()){const r=rg(e,"crypto.kdfparams.salt:data!"),n=rg(e,"crypto.kdfparams.n:int!"),i=rg(e,"crypto.kdfparams.r:int!"),o=rg(e,"crypto.kdfparams.p:int!");w(n>0&&0==(n&n-1),"invalid kdf.N","kdf.N",n),w(i>0&&o>0,"invalid kdf","kdf",t);const s=rg(e,"crypto.kdfparams.dklen:int!");return w(32===s,"invalid kdf.dklen","kdf.dflen",s),{name:"scrypt",salt:r,N:n,r:i,p:o,dkLen:64}}if("pbkdf2"===t.toLowerCase()){const t=rg(e,"crypto.kdfparams.salt:data!"),r=rg(e,"crypto.kdfparams.prf:string!"),n=r.split("-").pop();w("sha256"===n||"sha512"===n,"invalid kdf.pdf","kdf.pdf",r);const i=rg(e,"crypto.kdfparams.c:int!"),o=rg(e,"crypto.kdfparams.dklen:int!");return w(32===o,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:t,count:i,dkLen:o,algorithm:n}}}w(!1,"unsupported key-derivation function","kdf",t)}function ag(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}function cg(e){const t=null!=e.salt?T(e.salt,"options.salt"):Zh(32);let r=1<<17,n=8,i=1;return e.scrypt&&(e.scrypt.N&&(r=e.scrypt.N),e.scrypt.r&&(n=e.scrypt.r),e.scrypt.p&&(i=e.scrypt.p)),w("number"==typeof r&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),w("number"==typeof n&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),w("number"==typeof i&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:t,N:r,r:n,p:i}}function ug(e,t,r,n){const i=T(r.privateKey,"privateKey"),o=null!=n.iv?T(n.iv,"options.iv"):Zh(16);w(16===o.length,"invalid options.iv length","options.iv",n.iv);const s=null!=n.uuid?T(n.uuid,"options.uuid"):Zh(16);w(16===s.length,"invalid options.uuid length","options.uuid",n.iv);const a=e.slice(0,16),c=e.slice(16,32),u=T(new jp(a,o).encrypt(i)),l=at(N([c,u])),d={address:r.address.substring(2).toLowerCase(),id:Qp(s),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:C(o).substring(2)},ciphertext:C(u).substring(2),kdf:"scrypt",kdfparams:{salt:C(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:l.substring(2)}};if(r.mnemonic){const t=null!=n.client?n.client:`ethers/${f}`,i=r.mnemonic.path||ng,o=r.mnemonic.locale||"en",s=e.slice(32,64),a=T(r.mnemonic.entropy,"account.mnemonic.entropy"),c=Zh(16),u=T(new jp(s,c).encrypt(a)),l=new Date,h="UTC--"+l.getUTCFullYear()+"-"+eg(l.getUTCMonth()+1,2)+"-"+eg(l.getUTCDate(),2)+"T"+eg(l.getUTCHours(),2)+"-"+eg(l.getUTCMinutes(),2)+"-"+eg(l.getUTCSeconds(),2)+".0Z--"+d.address;d["x-ethers"]={client:t,gethFilename:h,path:i,locale:o,mnemonicCounter:C(c).substring(2),mnemonicCiphertext:C(u).substring(2),version:"0.1"}}return JSON.stringify(d)}function lg(e,t,r){null==r&&(r={});const n=tg(t),i=cg(r);return ug(T(Yp(n,i.salt,i.N,i.r,i.p,64)),i,e,r)}async function fg(e,t,r){null==r&&(r={});const n=tg(t),i=cg(r);return ug(T(await Jp(n,i.salt,i.N,i.r,i.p,64,r.progressCallback)),i,e,r)}const dg="m/44'/60'/0'/0/0",hg=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),pg=2147483648,gg=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function yg(e,t){let r="";for(;e;)r="0123456789abcdef"[e%16]+r,e=Math.trunc(e/16);for(;r.length<2*t;)r="0"+r;return"0x"+r}function mg(e){const t=T(e);return Wa(N([t,B(mh(mh(t)),0,4)]))}const bg={};function vg(e,t,r,n){const i=new Uint8Array(37);e&pg?(v(null!=n,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),i.set(T(n),1)):i.set(T(r));for(let t=24;t>=0;t-=8)i[33+(t>>3)]=e>>24-t&255;const o=T(ea("sha512",t,i));return{IL:o.slice(0,32),IR:o.slice(32)}}function wg(e,t){const r=t.split("/");w(r.length>0&&("m"===r[0]||e.depth>0),"invalid path","path",t),"m"===r[0]&&r.shift();let n=e;for(let e=0;e<r.length;e++){const t=r[e];if(t.match(/^[0-9]+'$/)){const r=parseInt(t.substring(0,t.length-1));w(r<pg,"invalid path index",`path[${e}]`,t),n=n.deriveChild(pg+r)}else if(t.match(/^[0-9]+$/)){const r=parseInt(t);w(r<pg,"invalid path index",`path[${e}]`,t),n=n.deriveChild(r)}else w(!1,"invalid path component",`path[${e}]`,t)}return n}class Ag extends lh{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,r,n,i,o,s,a,c){super(t,c),S(e,bg,"HDNodeWallet"),p(this,{publicKey:t.compressedPublicKey}),p(this,{parentFingerprint:r,fingerprint:B(Fh(mh(this.publicKey)),0,4),chainCode:n,path:i,index:o,depth:s}),p(this,{mnemonic:a})}connect(e){return new Ag(bg,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,e)}#nt(){const e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&"en"===t.wordlist.locale&&""===t.password&&(e.mnemonic={path:this.path,locale:"en",entropy:t.entropy}),e}async encrypt(e,t){return await fg(this.#nt(),e,{progressCallback:t})}encryptSync(e){return lg(this.#nt(),e)}get extendedKey(){return v(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),mg(N(["0x0488ADE4",yg(this.depth,1),this.parentFingerprint,yg(this.index,4),this.chainCode,N(["0x00",this.privateKey])]))}hasPath(){return null!=this.path}neuter(){return new Eg(bg,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(e){const t=V(e,"index");w(t<=4294967295,"invalid index","index",t);let r=this.path;r&&(r+="/"+(2147483647&t),t&pg&&(r+="'"));const{IR:n,IL:i}=vg(t,this.chainCode,this.publicKey,this.privateKey),o=new ta(W((z(i)+BigInt(this.privateKey))%gg,32));return new Ag(bg,o,this.fingerprint,C(n),r,t,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return wg(this,e)}static#it(e,t){w(k(e),"invalid seed","seed","[REDACTED]");const r=T(e,"seed");w(r.length>=16&&r.length<=64,"invalid seed","seed","[REDACTED]");const n=T(ea("sha512",hg,r)),i=new ta(C(n.slice(0,32)));return new Ag(bg,i,"0x00000000",C(n.slice(32)),"m",0,0,t,null)}static fromExtendedKey(e){const t=q(function(e){let t=za;for(let r=0;r<e.length;r++)t*=Va,t+=Ga(e[r]);return t}(e));w(82===t.length||mg(t.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const r=t[4],n=C(t.slice(5,9)),i=parseInt(C(t.slice(9,13)).substring(2),16),o=C(t.slice(13,45)),s=t.slice(45,78);switch(C(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const e=C(s);return new Eg(bg,fa(e),e,n,o,null,i,r,null)}case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new Ag(bg,new ta(s.slice(1)),n,o,null,i,r,null,null)}w(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,t,r){null==e&&(e=""),null==t&&(t=dg),null==r&&(r=qh.wordlist());const n=np.fromEntropy(Zh(16),e,r);return Ag.#it(n.computeSeed(),n).derivePath(t)}static fromMnemonic(e,t){return t||(t=dg),Ag.#it(e.computeSeed(),e).derivePath(t)}static fromPhrase(e,t,r,n){null==t&&(t=""),null==r&&(r=dg),null==n&&(n=qh.wordlist());const i=np.fromPhrase(e,t,n);return Ag.#it(i.computeSeed(),i).derivePath(r)}static fromSeed(e){return Ag.#it(e,null)}}class Eg extends Gc{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,r,n,i,o,s,a,c){super(t,c),S(e,bg,"HDNodeVoidWallet"),p(this,{publicKey:r}),p(this,{publicKey:r,fingerprint:B(Fh(mh(r)),0,4),parentFingerprint:n,chainCode:i,path:o,index:s,depth:a})}connect(e){return new Eg(bg,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return v(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),mg(N(["0x0488B21E",yg(this.depth,1),this.parentFingerprint,yg(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(e){const t=V(e,"index");w(t<=4294967295,"invalid index","index",t);let r=this.path;r&&(r+="/"+(2147483647&t),t&pg&&(r+="'"));const{IR:n,IL:i}=vg(t,this.chainCode,this.publicKey,null),o=ta.addPoints(i,this.publicKey,!0),s=fa(o);return new Eg(bg,s,o,this.fingerprint,C(n),r,t,this.depth+1,this.provider)}derivePath(e){return wg(this,e)}}function _g(e){try{if(JSON.parse(e).encseed)return!0}catch(e){}return!1}function Sg(e,t){const r=JSON.parse(e),n=tg(t),i=pt(rg(r,"ethaddr:string!")),o=Xp(rg(r,"encseed:string!"));w(o&&o.length%16==0,"invalid encseed","json",e);const s=T(Qh(n,n,2e3,32,"sha256")).slice(0,16),a=o.slice(0,16),c=o.slice(16),u=function(e){if(e.length<16)throw new TypeError("PKCS#7 invalid length");const t=e[e.length-1];if(t>16)throw new TypeError("PKCS#7 padding byte out of range");const r=e.length-t;for(let n=0;n<t;n++)if(e[r+n]!==t)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(e.subarray(0,r))}(T(new Np(s,a).decrypt(c)));let l="";for(let e=0;e<u.length;e++)l+=String.fromCharCode(u[e]);return{address:i,privateKey:Zt(l)}}function xg(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}class Tg extends lh{constructor(e,t){"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),super("string"==typeof e?new ta(e):e,t)}connect(e){return new Tg(this.signingKey,e)}async encrypt(e,t){const r={address:this.address,privateKey:this.privateKey};return await fg(r,e,{progressCallback:t})}encryptSync(e){return lg({address:this.address,privateKey:this.privateKey},e)}static#ot(e){if(w(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&"en"===e.mnemonic.locale){const t=np.fromEntropy(e.mnemonic.entropy),r=Ag.fromMnemonic(t,e.mnemonic.path);if(r.address===e.address&&r.privateKey===e.privateKey)return r;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const t=new Tg(e.privateKey);return w(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t}static async fromEncryptedJson(e,t,r){let n=null;return ig(e)?n=await async function(e,t,r){const n=JSON.parse(e),i=tg(t),o=sg(n);if("pbkdf2"===o.name){r&&(r(0),await ag(0));const{salt:e,count:t,dkLen:s,algorithm:a}=o,c=Qh(i,e,t,s,a);return r&&(r(1),await ag(0)),og(n,c)}v("scrypt"===o.name,"cannot be reached","UNKNOWN_ERROR",{params:o});const{salt:s,N:a,r:c,p:u,dkLen:l}=o;return og(n,await Jp(i,s,a,c,u,l,r))}(e,t,r):_g(e)&&(r&&(r(0),await xg(0)),n=Sg(e,t),r&&(r(1),await xg(0))),Tg.#ot(n)}static fromEncryptedJsonSync(e,t){let r=null;return ig(e)?r=function(e,t){const r=JSON.parse(e),n=tg(t),i=sg(r);if("pbkdf2"===i.name){const{salt:e,count:t,dkLen:o,algorithm:s}=i;return og(r,Qh(n,e,t,o,s))}v("scrypt"===i.name,"cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:o,N:s,r:a,p:c,dkLen:u}=i;return og(r,Yp(n,o,s,a,c,u))}(e,t):_g(e)?r=Sg(e,t):w(!1,"invalid JSON wallet","json","[ REDACTED ]"),Tg.#ot(r)}static createRandom(e){const t=Ag.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){const r=Ag.fromPhrase(e);return t?r.connect(t):r}}var Pg=i(8834).Buffer;class Ig extends a.BaseKeyringController{constructor(e){let{config:t,state:r}=e;super({config:t,state:r}),this.defaultState={wallets:[]},this.initialize()}async signTransaction(e,t){const r=e,n=this._getWalletForAccount(t),i=this.getBufferPrivateKey(n.privateKey),o=r.sign(i);return void 0===o?e:o}getAccounts(){return this.state.wallets.map((e=>e.publicKey))}importAccount(e){const t=xf(e),r=new ta(t),n=new Tg(r.privateKey),{address:i}=n,o=this.state.wallets.find((e=>e.address===i));return o?o.address:(this.update({wallets:[...this.state.wallets,{publicKey:r.publicKey,privateKey:e,address:i}]}),i)}removeAccount(e){const t=[...this.state.wallets],r=t.findIndex((t=>t.address===e));-1!==r&&(t.splice(r,1),this.update({wallets:t}))}getBufferPrivateKey(e){const t=lf(e);return Pg.from(t,"hex")}signMessage(e,t){const r=this._getWalletForAccount(t),n=this.getBufferPrivateKey(r.privateKey),i=Qf(Pg.from(lf(e),"hex"),n);return(0,uh.concatSig)(Pg.from(wf(i.v)),Pg.from(i.r),Pg.from(i.s))}async signPersonalMessage(e,t){const r=this._getWalletForAccount(t),n=this.getBufferPrivateKey(r.privateKey);return(0,uh.personalSign)({privateKey:n,data:e})}async signTypedData(e,t,r){const n=this._getWalletForAccount(t),i=this.getBufferPrivateKey(n.privateKey);return(0,uh.signTypedData)({privateKey:i,data:e,version:r})}signEncryptionPublicKey(e){const t=this._getWalletForAccount(e);return(0,uh.getEncryptionPublicKey)(lf(t.privateKey))}decryptMessage(e,t){const r=this._getWalletForAccount(t);return(0,uh.decrypt)({encryptedData:e,privateKey:lf(r.privateKey)})}_getWalletForAccount(e){const t=e.toLowerCase(),r=this.state.wallets.find((e=>e.address.toLowerCase()===t));if(!r)throw new Error("Torus Keyring - Unable to find matching address.");return r}}var kg=i(774);class Og extends a.BaseController{constructor(e){let{config:t,state:r,getNetworkIdentifier:n}=e;super({config:t,state:r}),(0,s.Z)(this,"messages",void 0),(0,s.Z)(this,"getNetworkIdentifier",void 0),this.defaultState={unapprovedMessages:{},unapprovedMessagesCount:0},this.messages=[],this.defaultConfig={},this.getNetworkIdentifier=n,super.initialize()}getMessage(e){return this.messages.find((t=>t.id===e))}getAllMessages(){return this.messages}setMetadata(e,t){const r=this.getMessage(e);if(!r)throw new Error(`${this.name}: Message not found for id: ${e}.`);r.metadata=t,this.updateMessage(r)}getUnapprovedMessages(){return this.messages.filter((e=>e.status===qu.UNAPPROVED)).reduce(((e,t)=>(e[t.id]=t,e)),{})}async addMessage(e){this.messages.push(e),this.saveMessageList()}approveMessage(e){return this.setMessageStatus(e.id,qu.APPROVED),this.prepMessageForSigning(e)}setMessageStatus(e,t){const r=this.getMessage(e);if(!r)throw new Error(`${this.name}: Message not found for id: ${e}.`);r.status=t,this.updateMessage(r),this.emit(`${e}:${t}`,r),t!==qu.REJECTED&&t!==qu.SIGNED&&t!==qu.FAILED||this.emit(`${e}:finished`,r)}async waitForFinishStatus(e,t){return new Promise(((r,n)=>{this.once(`${e.id}:finished`,(i=>i.status===qu.REJECTED?n(kg.providerErrors.userRejectedRequest(`${t} Signature: User denied message signature`)):i.status===qu.FAILED?n(kg.rpcErrors.internal(`${t} Signature: failed to sign message ${i.error}`)):i.status===qu.SIGNED?r(i.rawSig):n(kg.rpcErrors.internal(`${t} Signature: Unknown problem: ${JSON.stringify(e)}`))))}))}updateMessage(e){const t=this.messages.findIndex((t=>e.id===t.id));-1!==t&&(this.messages[t]=e),this.saveMessageList()}saveMessageList(){const e=this.getUnapprovedMessages(),t=Object.keys(e).length;this.update({unapprovedMessages:e,unapprovedMessagesCount:t})}}var Cg=i(663),Ng=i(8834).Buffer;const Rg=/^[0-9A-Fa-f]+$/gu;function Bg(e,t){if(!e||"string"!=typeof e||!Hf(e))throw new Error(`Invalid "${t}" address: ${e} must be a valid string.`)}function Mg(e){const{from:t,data:r}=e;if(Bg(t,"from"),!r||"string"!=typeof r)throw new Error(`Invalid message "data": ${r} must be a valid string.`)}function Lg(e){try{const t=lf(e);if(t.match(Rg))return xf(t)}catch(e){}return gf(Ng.from(e,"utf8"))}function Fg(e){if(Bg(e.from,"from"),!e.data||!Array.isArray(e.data))throw new Error(`Invalid message "data": ${e.data} must be a valid array.`);try{(0,uh.typedSignatureHash)(e.data)}catch(e){throw new Error("Expected EIP712 typed data.")}}function jg(e,t){if(Bg(e.from,"from"),!e.data||Array.isArray(e.data)||"object"!=typeof e.data&&"string"!=typeof e.data)throw new Error('Invalid message "data": Must be a valid string or object.');let r;if("object"==typeof e.data)r=e.data;else try{r=JSON.parse(e.data)}catch(e){throw new Error("Data must be passed as a valid JSON string.")}if((0,Cg.G)(r,uh.TYPED_MESSAGE_SCHEMA).errors.length>0)throw new Error("Data must conform to EIP-712 schema. See https://git.io/fNtcx.");if(!t)throw new Error("Current chainId cannot be null or undefined.");let{chainId:n}=r.domain;if(n){"string"==typeof n&&(n=parseInt(n,n.startsWith("0x")?16:10));const e=parseInt(t,16);if(Number.isNaN(e))throw new Error(`Cannot sign messages for chainId "${n}", because MetaMask is switching networks.`);if(n!==e)throw new Error(`Provided chainId "${n}" must match the active chainId "${e}"`)}}function Ug(e){const{from:t}=e;Bg(t,"from")}function Dg(e){const{from:t}=e;Bg(t,"from")}function Zg(e){const t=lf(e),r=Ng.from(t,"hex");return JSON.parse(r.toString("utf8"))}class Hg extends Og{constructor(e){let{config:t,state:r,decryptMessage:n,getNetworkIdentifier:i}=e;super({config:t,state:r,getNetworkIdentifier:i}),(0,s.Z)(this,"name","DecryptMessageController"),(0,s.Z)(this,"decryptMessage",void 0),this.decryptMessage=n,this.initialize()}async processDecryptMessage(e){try{const t=this.getMessage(e),r=await this.approveMessage(t.messageParams),i=Zg(r.data),o=this.decryptMessage(i,r.from);return this.updateMessage((0,n.Z)((0,n.Z)({},t),{},{rawSig:o})),this.setMessageStatus(e,qu.SIGNED),o}catch(t){au().error(t),this.setMessageStatus(e,qu.FAILED)}}async addNewUnapprovedMessage(e,t){return await this.addUnapprovedMessage(e,t),this.waitForFinishStatus(e,this.name)}async addUnapprovedMessage(e,t){Dg(e),t&&(e.origin=t.origin),e.data=Lg(e.data);const r=(0,a.randomId)(),i={id:r,messageParams:e,status:qu.UNAPPROVED,time:Date.now(),type:ju.ETH_DECRYPT};return await this.addMessage(i),this.emit("unapprovedMessage",(0,n.Z)({},e)),r}prepMessageForSigning(e){return Promise.resolve((0,n.Z)({},e))}}class $g extends Og{constructor(e){let{config:t,state:r,signEncryptionPublicKey:n,getNetworkIdentifier:i}=e;super({config:t,state:r,getNetworkIdentifier:i}),(0,s.Z)(this,"name","EncryptionPublicKeyController"),(0,s.Z)(this,"signEncryptionPublicKey",void 0),this.signEncryptionPublicKey=n,this.initialize()}async processGetEncryptionPublicKey(e){try{const t=this.getMessage(e),r=await this.approveMessage(t.messageParams),i=this.signEncryptionPublicKey(r.from);return this.updateMessage((0,n.Z)((0,n.Z)({},t),{},{rawSig:i})),this.setMessageStatus(e,qu.SIGNED),i}catch(t){au().error(t),this.setMessageStatus(e,qu.FAILED)}}async addNewUnapprovedMessage(e,t){return await this.addUnapprovedMessage(e,t),this.waitForFinishStatus(e,this.name)}async addUnapprovedMessage(e,t){Ug(e),t&&(e.origin=t.origin);const r=(0,a.randomId)(),i={id:r,messageParams:e,status:qu.UNAPPROVED,time:Date.now(),type:ju.ETH_GET_ENCRYPTION_PUBLIC_KEY};return await this.addMessage(i),this.emit("unapprovedMessage",(0,n.Z)({},e)),r}prepMessageForSigning(e){return Promise.resolve((0,n.Z)((0,n.Z)({},e),{},{from:e.data}))}}class Gg extends Og{constructor(e){let{config:t,state:r,signMessage:n,getNetworkIdentifier:i}=e;super({config:t,state:r,getNetworkIdentifier:i}),(0,s.Z)(this,"name","MessageController"),(0,s.Z)(this,"signMessage",void 0),this.signMessage=n,this.initialize()}async processSignMessage(e){try{const t=this.getMessage(e),r=await this.approveMessage(t.messageParams),i=this.signMessage(r.data,r.from);return this.updateMessage((0,n.Z)((0,n.Z)({},t),{},{rawSig:i})),this.setMessageStatus(e,qu.SIGNED),i}catch(t){au().error(t),this.setMessageStatus(e,qu.FAILED)}}async addNewUnapprovedMessage(e,t){return await this.addUnapprovedMessage(e,t),this.waitForFinishStatus(e,this.name)}async addUnapprovedMessage(e,t){Mg(e),t&&(e.origin=t.origin),e.data=Lg(e.data);const r=(0,a.randomId)(),n={id:r,messageParams:e,status:qu.UNAPPROVED,time:Date.now(),type:ju.ETH_SIGN};return await this.addMessage(n),this.emit("unapprovedMessage",e),r}prepMessageForSigning(e){return Promise.resolve(e)}}class zg extends Og{constructor(e){let{config:t,state:r,signPersonalMessage:n,getNetworkIdentifier:i}=e;super({config:t,state:r,getNetworkIdentifier:i}),(0,s.Z)(this,"name","PersonalMessageController"),(0,s.Z)(this,"signPersonalMessage",void 0),this.signPersonalMessage=n,this.initialize()}async processPersonalSignMessage(e){try{const t=this.getMessage(e),r=await this.approveMessage(t.messageParams),i=await this.signPersonalMessage(r.data,r.from);return this.updateMessage((0,n.Z)((0,n.Z)({},t),{},{rawSig:i})),this.setMessageStatus(e,qu.SIGNED),i}catch(t){au().error(t),this.setMessageStatus(e,qu.FAILED)}}async addNewUnapprovedMessage(e,t){return await this.addUnapprovedMessage(e,t),this.waitForFinishStatus(e,this.name)}async addUnapprovedMessage(e,t){Mg(e),t&&(e.origin=t.origin),e.data=Lg(e.data);const r=(0,a.randomId)(),n={id:r,messageParams:e,status:qu.UNAPPROVED,time:Date.now(),type:ju.PERSONAL_SIGN};return await this.addMessage(n),this.emit("unapprovedMessage",e),r}prepMessageForSigning(e){return Promise.resolve(e)}}function Vg(e){switch(e){case uh.SignTypedDataVersion.V1:return ju.ETH_SIGN_TYPED_DATA;case uh.SignTypedDataVersion.V3:return ju.ETH_SIGN_TYPED_DATA_V3;case uh.SignTypedDataVersion.V4:return ju.ETH_SIGN_TYPED_DATA_V4;default:return ju.ETH_SIGN_TYPED_DATA}}class Wg extends Og{constructor(e){let{config:t,state:r,signTypedData:n,getNetworkIdentifier:i}=e;super({config:t,state:r,getNetworkIdentifier:i}),(0,s.Z)(this,"name","TypedMessageController"),(0,s.Z)(this,"signTypedData",void 0),this.signTypedData=n,this.initialize()}async processPersonalSignMessage(e){try{const t=this.getMessage(e),r=await this.approveMessage(t.messageParams),i=await this.signTypedData(r.data,r.from,r.version);return this.updateMessage((0,n.Z)((0,n.Z)({},t),{},{rawSig:i})),this.setMessageStatus(e,qu.SIGNED),i}catch(t){au().error(t),this.setMessageStatus(e,qu.FAILED)}}async addNewUnapprovedMessage(e,t,r){return await this.addUnapprovedMessage(e,t,r),this.waitForFinishStatus(e,this.name)}async addUnapprovedMessage(e,t,r){r===uh.SignTypedDataVersion.V1&&Fg(e),(r===uh.SignTypedDataVersion.V3||r===uh.SignTypedDataVersion.V4)&&jg(e,this.getNetworkIdentifier()),"string"==typeof e.data||r!==uh.SignTypedDataVersion.V3&&r!==uh.SignTypedDataVersion.V4||(e.data=JSON.stringify(e.data)),t&&(e.origin=t.origin),e.version=r;const n=(0,a.randomId)(),i={id:n,messageParams:e,status:qu.UNAPPROVED,time:Date.now(),type:Vg(r)};return await this.addMessage(i),this.emit("unapprovedMessage",e),n}prepMessageForSigning(e){return Promise.resolve(e)}}var qg=i(7391);function Kg(e){let{getAccounts:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{method:i}=e;if(i!==ju.GET_ACCOUNTS)return n();if(!t)throw new Error("WalletMiddleware - opts.getAccounts not provided");const o=await t(e);r.result=o}))}function Jg(e){let{processTransaction:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{method:i}=e;if(i!==ju.ETH_TRANSACTION)return n();if(!t)throw new Error("WalletMiddleware - opts.processTransaction not provided");r.result=await t(e.params,e)}))}function Yg(e){let{processEthSignMessage:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{method:i}=e;if(i!==ju.ETH_SIGN)return n();if(!t)throw new Error("WalletMiddleware - opts.processEthSignMessage not provided");r.result=await t(e.params,e)}))}function Qg(e){let{processTypedMessage:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{method:i}=e;if(i!==ju.ETH_SIGN_TYPED_DATA)return n();if(!t)throw new Error("WalletMiddleware - opts.processTypedMessage not provided");r.result=await t(e.params,e)}))}function Xg(e){let{processTypedMessageV3:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{method:i}=e;if(i!==ju.ETH_SIGN_TYPED_DATA_V3)return n();if(!t)throw new Error("WalletMiddleware - opts.processTypedMessageV3 is not provided");r.result=await t(e.params,e)}))}function ey(e){let{processTypedMessageV4:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{method:i}=e;if(i!==ju.ETH_SIGN_TYPED_DATA_V4)return n();if(!t)throw new Error("WalletMiddleware - opts.processTypedMessageV4 is not provided");r.result=await t(e.params,e)}))}function ty(e){let{processPersonalMessage:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{method:i}=e;if(i!==ju.PERSONAL_SIGN)return n();if(!t)throw new Error("WalletMiddleware - opts.processPersonalMessage is not provided");r.result=await t(e.params,e)}))}function ry(e){let{getPendingNonce:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{params:i,method:o}=e;if(o!==ju.ETH_GET_TRANSACTION_COUNT)return n();const{blockReference:s}=i;if("pending"!==s)return n();r.result=await t(i,e)}))}function ny(e){const{r:t,s:r,v:n,txReceipt:i,transaction:o,transactionHash:s,accessList:a}=e,{to:c,data:u,nonce:l,gas:f,from:d,value:h,gasPrice:p,maxFeePerGas:g,maxPriorityFeePerGas:y}=o,m={v:n,r:t,s:r,to:c,gas:f,from:d,hash:s,nonce:l,input:u||"0x",value:h||"0x0",accessList:a||null,blockHash:(null==i?void 0:i.blockHash)||null,blockNumber:(null==i?void 0:i.blockNumber)||null,transactionIndex:(null==i?void 0:i.transactionIndex)||null,type:null};return g&&y?(m.maxFeePerGas=g,m.maxPriorityFeePerGas=y,m.type=Uu.FEE_MARKET):(m.gasPrice=p,m.type=Uu.LEGACY),m}function iy(e){let{getPendingTransactionByHash:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{params:i,method:o}=e;if(o!==ju.ETH_GET_TRANSACTION_BY_HASH)return n();if(!t)throw new Error("WalletMiddleware - opts.getPendingTransactionByHash not provided");const s=await t(i,e);if(!s)return n();r.result=ny(s)}))}function oy(e){let{processEncryptionPublicKey:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{params:i,method:o}=e;if(o!==ju.ETH_GET_ENCRYPTION_PUBLIC_KEY)return n();if(!t)throw new Error("WalletMiddleware - opts.processEncryptionPublicKey not provided");r.result=await t(i,e)}))}function sy(e){let{processDecryptMessage:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{params:i,method:o}=e;if(o!==ju.ETH_DECRYPT)return n();if(!t)throw new Error("WalletMiddleware - opts.processDecryptMessage not provided");r.result=await t(i,e)}))}function ay(e){let{requestAccounts:t}=e;return(0,qg.createAsyncMiddleware)((async(e,r,n)=>{const{method:i}=e;if("eth_requestAccounts"!==i)return n();if(!t)throw new Error("WalletMiddleware - opts.requestAccounts not provided");const o=await t(e);r.result=o}))}function cy(e){const{requestAccounts:t,getAccounts:r,processTransaction:n,processEthSignMessage:i,processTypedMessage:o,processTypedMessageV3:s,processTypedMessageV4:c,processPersonalMessage:u,getPendingNonce:l,getPendingTransactionByHash:f,processEncryptionPublicKey:d,processDecryptMessage:h,getProviderState:p,version:g}=e;return(0,qg.mergeMiddleware)([(0,qg.createScaffoldMiddleware)({version:g,[a.PROVIDER_JRPC_METHODS.GET_PROVIDER_STATE]:p}),ay({requestAccounts:t}),Kg({getAccounts:r}),Jg({processTransaction:n}),Yg({processEthSignMessage:i}),Qg({processTypedMessage:o}),Xg({processTypedMessageV3:s}),ey({processTypedMessageV4:c}),ty({processPersonalMessage:u}),ry({getPendingNonce:l}),iy({getPendingTransactionByHash:f}),oy({processEncryptionPublicKey:d}),sy({processDecryptMessage:h})])}function uy(e){return(t,r,n,i)=>"eth_chainId"===t.method?(r.result=e,i()):"net_version"===t.method?(r.result=Number.parseInt(e,16).toString(10),i()):n()}function ly(e){return(t,r,n,i)=>"eth_provider_config"===t.method?(r.result=e,i()):n()}function fy(e){const{chainId:t,rpcTarget:r}=e,n=(0,a.createFetchMiddleware)({rpcTarget:r}),i=(0,qg.providerFromMiddleware)(n),o=new Zd({config:{provider:i},state:{}});return{networkMiddleware:(0,qg.mergeMiddleware)([uy(t),ly(e),n]),blockTracker:o}}const dy=["chainId","rpcTarget"];class hy extends a.BaseController{constructor(e){let{config:t,state:r}=e;super({config:t,state:r}),(0,s.Z)(this,"name","NetworkController"),(0,s.Z)(this,"providerProxy",void 0),(0,s.Z)(this,"blockTrackerProxy",void 0),(0,s.Z)(this,"mutex",new l),(0,s.Z)(this,"provider",null),(0,s.Z)(this,"blockTracker",null),(0,s.Z)(this,"baseProviderHandlers",void 0),this.defaultState={chainId:"loading",properties:{EIPS_1559:void 0},providerConfig:Fu.mainnet},this.initialize()}getNetworkIdentifier(){return this.state.chainId}getNetworkRPCUrl(){return this.state.providerConfig.rpcTarget}initializeProvider(e){return this.baseProviderHandlers=e,this.configureProvider(),this.lookupNetwork(),this.providerProxy}getProvider(){return this.providerProxy}getBlockTracker(){return this.blockTrackerProxy}getProviderConfig(){return this.state.providerConfig}setProviderConfig(e){this.update({providerConfig:(0,n.Z)({},e)}),this.refreshNetwork()}async getEIP1559Compatibility(){const{EIPS_1559:e}=this.state.properties;if(void 0!==e)return e;const t=await this.blockTracker.getLatestBlock(),r=t&&void 0!==t.baseFeePerGas;return this.update({properties:{EIPS_1559:r}}),r}async lookupNetwork(){const{chainId:e,rpcTarget:t}=this.getProviderConfig();if(!e||!t||!this.provider)return void this.update({chainId:"loading",properties:{}});const r=await this.mutex.acquire();try{const[e]=await Promise.all([this.provider.request({method:"eth_chainId"}),this.getEIP1559Compatibility()]);au().info("network fetched chain id",e),this.update({chainId:e}),this.emit("networkDidChange")}catch{this.update({chainId:"loading"})}finally{r()}}configureProvider(){const e=this.getProviderConfig(),{chainId:t,rpcTarget:r}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,dy);if(!t||!r)throw new Error("chainId and rpcTarget must be provider in providerConfig");this.configureStandardProvider((0,n.Z)({chainId:t,rpcTarget:r},i))}setNetworkClient(e){let{networkMiddleware:t,blockTracker:r}=e;const n=cy(this.baseProviderHandlers),i=new qg.JRPCEngine;i.push(n),i.push(t);const o=(0,qg.providerFromEngine)(i);this.setProvider({provider:o,blockTracker:r})}setProvider(e){let{provider:t,blockTracker:r}=e;this.providerProxy?this.providerProxy.setTarget(t):this.providerProxy=(0,a.createSwappableProxy)(t),this.blockTrackerProxy?this.blockTrackerProxy.setTarget(r):this.blockTrackerProxy=(0,a.createEventEmitterProxy)(r,{eventFilter:"skipInternal"}),this.provider=t,t.setMaxListeners(10),this.blockTracker=r}configureStandardProvider(e){const t=fy(e);au().info("networkClient",t),this.setNetworkClient(t)}refreshNetwork(){this.update({chainId:"loading",properties:{}}),this.configureProvider(),this.lookupNetwork()}}class py{constructor(e){let{chainId:t,contractAddress:r,contractImage:n,contractName:i,contractSymbol:o,nftStandard:a,provider:c,contractDescription:u,contractFallbackLogo:l,contractSupply:f}=e;(0,s.Z)(this,"contractAddress",void 0),(0,s.Z)(this,"contractName",void 0),(0,s.Z)(this,"contractSymbol",void 0),(0,s.Z)(this,"contractImage",void 0),(0,s.Z)(this,"contractSupply",void 0),(0,s.Z)(this,"contractFallbackLogo",void 0),(0,s.Z)(this,"nftStandard",void 0),(0,s.Z)(this,"contractDescription",void 0),(0,s.Z)(this,"chainId",void 0),(0,s.Z)(this,"provider",void 0),(0,s.Z)(this,"isSpecial",void 0),this.chainId=t,this.contractAddress=r,this.contractImage=n,this.contractName=i,this.contractSymbol=o,this.nftStandard=a,this.provider=c,this.contractDescription=u,this.contractFallbackLogo=l,this.contractSupply=f}async getNftMetadata(e,t){const r=(0,n.Z)({description:"",image:"",name:"",tokenBalance:"",tokenId:"",decimals:"1"},t),[i,o]=await Promise.all([this.getCollectibleTokenURI(r.tokenId,this.nftStandard),r.tokenBalance?Promise.resolve("0"):this.fetchNftBalance(e,r.tokenId)]);r.tokenBalance=r.tokenBalance||o;try{const e=JSON.parse(i);r.image=r.image||jd(e.image),r.name=r.name||e.name,r.description=r.description||e.description,r.decimals=r.decimals||e.decimals}catch(e){au().warn("Token uri is not a valid json object",e)}const s=jd(i);try{if(!r.description||!r.image||!r.name){const e=await(0,Hd.get)(s);r.image=r.image||jd(e.image),r.name=r.name||e.name,r.description=r.description||e.description,r.decimals=r.decimals||e.decimals}}catch(e){au().error("Failed to fetch nft metadata",e)}return r}async getContractMetadata(){const e={chainId:this.chainId,contractAddress:this.contractAddress,contractName:this.contractName,contractSymbol:this.contractSymbol,nftStandard:this.nftStandard,contractImage:this.contractImage,contractDescription:this.contractDescription,contractFallbackLogo:this.contractFallbackLogo,contractSupply:this.contractSupply};if(!this.nftStandard){const{standard:t,isSpecial:r}=await this.checkNftStandard();e.nftStandard=t,this.nftStandard=t,this.isSpecial=r}if(!this.contractName||!this.contractSymbol||!this.contractDescription){const t=this.nftStandard===yu?uu:lu,r=new Jn(this.contractAddress,t,this.provider),[n,i]=await Promise.all([r.name(),r.symbol()]);e.contractName=n,e.contractSymbol=i,this.contractName||(this.contractName=n),this.contractSymbol||(this.contractSymbol=i)}return e}async fetchNftBalance(e,t){const{standard:r}=await this.checkNftStandard(),n=r===yu?uu:lu,i=new Jn(this.contractAddress,n,this.provider);if(r===mu)return await i.balanceOf(e,t);let o="";try{o=await i.ownerOf(t)}catch{throw new Error("Token id doesn't exists")}return o.toLowerCase()===e.toLowerCase()?"1":"0"}async checkNftStandard(){if(!this.nftStandard||void 0===this.isSpecial){if(Object.prototype.hasOwnProperty.call(Hu,this.contractAddress.toLowerCase()))return this.nftStandard=yu,this.isSpecial=!0,{standard:yu,isSpecial:!0};if(await this.contractSupportsInterface(yu,vu))return this.nftStandard=yu,this.isSpecial=!1,{standard:yu,isSpecial:!1};if(await this.contractSupportsInterface(mu,bu))return this.nftStandard=mu,this.isSpecial=!1,{standard:mu,isSpecial:!1};throw new Error("Unsupported nft standard")}}async contractSupportsInterface(e,t){const r=e===yu?uu:lu;return new Jn(this.contractAddress,r,this.provider).supportsInterface(t)}async getCollectibleTokenURI(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yu;const r=t===yu?"tokenURI":"uri",n=t===yu?uu:lu;return new Jn(this.contractAddress,n,this.provider)[r](e)}}var gy=i(9106);const yy=18e4;class my extends a.BaseController{constructor(e){let{config:t,state:r,provider:n,getNetworkIdentifier:i,getCustomNfts:o,getSimpleHashNfts:a,onPreferencesStateChange:c,onNetworkStateChange:u}=e;super({config:t,state:r}),(0,s.Z)(this,"name","NftsController"),(0,s.Z)(this,"provider",void 0),(0,s.Z)(this,"ethersProvider",void 0),(0,s.Z)(this,"_timer",void 0),(0,s.Z)(this,"getNetworkIdentifier",void 0),(0,s.Z)(this,"getCustomNfts",void 0),(0,s.Z)(this,"getSimpleHashNfts",void 0),this.provider=n,this.ethersProvider=new ou(this.provider,"any"),this.getNetworkIdentifier=i,this.getCustomNfts=o,this.getSimpleHashNfts=a,this.defaultConfig={interval:yy,selectedAddress:"",chainId:""},this.defaultState={nfts:{}},this.initialize(),c((e=>{e.selectedAddress!==this.config.selectedAddress&&(this.configure({selectedAddress:e.selectedAddress}),this.restartNftDetection())})),u((e=>{const{chainId:t}=e.providerConfig;t!==this.config.chainId&&(this.configure({chainId:t}),this.restartNftDetection())}))}get userSelectedAddress(){return this.config.selectedAddress}get userNfts(){var e;return this.userSelectedAddress&&null!==(e=this.state.nfts[this.userSelectedAddress])&&void 0!==e?e:[]}get interval(){return this.config.interval}set interval(e){this._timer&&window.clearInterval(this._timer),e&&(this._timer=window.setInterval((()=>{Nd.checkIfIdle()||(this.detectNewNfts(),this.refreshNftBalances())}),e))}startNftDetection(e){this.configure({selectedAddress:e}),this.restartNftDetection()}restartNftDetection(){this.userSelectedAddress&&(this.detectNewNfts(),this.refreshNftBalances(),this.config.interval=yy)}detectNewNfts(){const e=this.userSelectedAddress;if(!e)return;const t=this.getNetworkIdentifier(),r=[];if(t){if(this.getCustomNfts){const n=this.getCustomNfts(e).reduce(((e,r)=>{if(r.network===t){const t={description:"",image:"",name:"",tokenBalance:"",tokenId:r.nft_id,customNftId:r.id.toString()};if(e[r.nft_address])e[r.nft_address].assets.push(t);else{const n={assets:[t],chainId:r.network,contractAddress:r.nft_address,contractName:"",contractSymbol:"",contractImage:"",nftStandard:r.nft_contract_standard,contractDescription:""};e[r.nft_address]=n}}return e}),{});r.push(...Object.values(n))}this.update({nfts:{[e]:[...r]}})}else this.update({nfts:{[e]:[...r]}})}async refreshNftBalances(){const e=this.userSelectedAddress;if(""===e)return;const t=[...this.userNfts],r=[];try{const n=this.getNetworkIdentifier();if(zu.includes(n)){const t=await this.getSimpleHashNfts(e,n);r.push(...t),this.update({nfts:{[e]:r}})}t.length>0&&this.getNftBalancesUsingHandler(t)}catch(e){au().error(e,"unable to fetch nft balances")}}async getNftBalancesUsingHandler(e){if(!this.userSelectedAddress)return;const t=this.userSelectedAddress,r=e,i=(await Promise.allSettled(r.map((async e=>{try{const r=new py((0,n.Z)((0,n.Z)({},e),{},{provider:this.ethersProvider})),i=await r.getContractMetadata(),o=await Promise.allSettled(e.assets.map((e=>r.getNftMetadata(t,e))));return(0,n.Z)((0,n.Z)({},i),{},{assets:o.filter((e=>"fulfilled"===e.status)).map((e=>e.value))})}catch(e){return void au().warn("Invalid contract address while fetching",e)}})))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));this.update({nfts:{[t]:(0,gy.Z)(this.userNfts,i)}})}}class by extends a.BasePreferencesController{constructor(e){let{config:t,state:r,provider:n,blockTracker:i,signAuthMessage:o,getProviderConfig:a}=e;super({config:t,state:r,defaultPreferences:{formattedPastTransactions:[],fetchedPastTx:[],paymentTx:[]},signAuthMessage:o}),(0,s.Z)(this,"_handle",void 0),(0,s.Z)(this,"_mutex",new l),(0,s.Z)(this,"getProviderConfig",void 0),(0,s.Z)(this,"provider",void 0),(0,s.Z)(this,"blockTracker",void 0),this.provider=n,this.getProviderConfig=a,this.blockTracker=i,au().info(this.blockTracker)}async poll(e){var t;const r=await this._mutex.acquire();e&&this.configure({pollInterval:e}),this._handle&&window.clearTimeout(this._handle);const n=this.state.selectedAddress;n&&null!==(t=this.getAddressState(n))&&void 0!==t&&t.jwtToken&&(await this.sync(n),r(),this._handle=window.setTimeout((()=>{this.poll(this.config.pollInterval)}),this.config.pollInterval))}async initPreferences(e){const{address:t,jwtToken:r,calledFromEmbed:n,userInfo:i,rehydrate:o,locale:s="en-US"}=e;await super.init(t,i,r);const{aggregateVerifier:a,verifier:c,verifierId:u}=i||{};if(!await this.sync(t)){const e=this.getAddressState(t);await this.createUser({selectedCurrency:e.selectedCurrency,theme:e.theme,verifier:a||c,verifierId:u,locale:s,address:t})}o||await this.storeUserLogin({verifier:a||c,verifierId:u,options:{calledFromEmbed:n,rehydrate:o},address:t})}getSelectedAddress(){return this.state.selectedAddress}async sync(e){try{const t=await this.getUser(e);if(t){const{default_currency:r,contacts:n,theme:i,locale:o,public_address:s,default_public_address:a,customNetworks:c,customTokens:u,customNfts:l}=t||{};return this.updateState({contacts:n,theme:i,selectedCurrency:r,locale:o,defaultPublicAddress:a||s,customTokens:u,customNfts:l,customNetworks:c},e),!0}return!1}catch(e){return au().error(e),!1}finally{Promise.all([this.getWalletOrders(e).catch((e=>{au().error("unable to fetch wallet orders",e)})),this.getTopUpOrders(e).catch((e=>{au().error("unable to fetch top up orders",e)}))]).then((t=>{const[r,n]=t;n&&this.calculatePaymentTx(n,e),r&&r.length>0&&(this.updateState({fetchedPastTx:[...r]},e),this.calculatePastTx(r,e))})).catch((e=>au().error(e)))}}async patchNewTx(e,t){var r;const n=Id(e),i=null===(r=this.getAddressState(t))||void 0===r?void 0:r.formattedPastTransactions,o=i.findIndex((t=>t.transaction_hash===e.transaction_hash&&t.networkType===e.network));if(e.status===a.TransactionStatus.submitted||e.status===a.TransactionStatus.confirmed)if(-1===o){const r=this.cancelTxCalculate([...i,n]);e.is_cancel=n.is_cancel,e.to=e.to.toLowerCase(),e.from=e.from.toLowerCase(),this.updateState({formattedPastTransactions:r},t),this.postPastTx(e,t)}else n.is_cancel=i[o].is_cancel,i[o]=n,this.updateState({formattedPastTransactions:this.cancelTxCalculate([...i])},t)}recalculatePastTx(e){const t=e||this.state.selectedAddress,r=this.getAddressState(t);null!=r&&r.fetchedPastTx&&this.calculatePastTx(r.fetchedPastTx,t)}async refetchEtherscanTx(e){var t;const r=e||this.state.selectedAddress;null!==(t=this.getAddressState(r))&&void 0!==t&&t.jwtToken}async getEtherScanTokens(e,t){const r=e,n=new URL(this.config.api);return n.pathname="/tokens",n.searchParams.append("chainId",t),n.searchParams.append("address",r),(await(0,Hd.get)(n.href,this.headers(this.state.selectedAddress))).data}async getSimpleHashNfts(e,t){const r=e,n=new URL(this.config.api);return n.pathname="/nfts",n.searchParams.append("chainId",t),n.searchParams.append("address",r),(await(0,Hd.get)(n.href,this.headers(this.state.selectedAddress))).data}getCustomTokens(e){var t,r;return null!==(t=null===(r=this.getAddressState(e))||void 0===r?void 0:r.customTokens)&&void 0!==t?t:[]}getCustomNfts(e){var t,r;return null!==(t=null===(r=this.getAddressState(e))||void 0===r?void 0:r.customNfts)&&void 0!==t?t:[]}async addCustomNetwork(e){let{type:t,network:r}=e;try{const e=new URL(this.config.api);e.pathname=`/customnetwork/${t}`;const{selectedAddress:n}=this.state,i={network_name:r.displayName,rpc_url:r.rpcTarget,chain_id:r.chainId,symbol:r.ticker,block_explorer_url:r.blockExplorerUrl||void 0,is_test_net:r.isTestNet||!1},o=await(0,Hd.post)(e.href,i,this.headers(n),{useAPIKey:!0});return await this.sync(n),o.data.id}catch{return au().error("error adding custom network"),null}}async deleteCustomNetwork(e){try{const{selectedAddress:t}=this.state,r=new URL(this.config.api);return r.pathname=`/customnetwork/${e}`,await(0,Hd.remove)(r.href,{},this.headers(t),{useAPIKey:!0}),await this.sync(t),!0}catch{return au().error("error deleting custom network"),!1}}async editCustomNetwork(e){let{network:t,id:r}=e;try{const{selectedAddress:e}=this.state,n=new URL(this.config.api);n.pathname=`/customnetwork/${r}`;const i={network_name:t.displayName,rpc_url:t.rpcTarget,chain_id:t.chainId,symbol:t.ticker||void 0,block_explorer_url:t.blockExplorerUrl||void 0,is_test_net:t.isTestNet||!1};return await(0,Hd.patch)(n.href,i,this.headers(e),{useAPIKey:!0}),await this.sync(e),!0}catch{return au().error("error editing custom network"),!1}}calculatePaymentTx(e,t){const r=[];for(const t of e){let e="";const n=t.action.toLowerCase();a.ACTIVITY_ACTION_TOPUP.includes(n)?e=a.ACTIVITY_ACTION_TOPUP:a.ACTIVITY_ACTION_SEND.includes(n)?e=a.ACTIVITY_ACTION_SEND:a.ACTIVITY_ACTION_RECEIVE.includes(n)&&(e=a.ACTIVITY_ACTION_RECEIVE),r.push({id:t.id,date:new Date(t.date).toDateString(),from:t.from,slicedFrom:t.slicedFrom,action:e,to:t.to,slicedTo:t.slicedTo,totalAmount:t.totalAmount,totalAmountString:t.totalAmountString,currencyAmount:t.currencyAmount,currencyAmountString:t.currencyAmountString,amount:t.amount,ethRate:t.ethRate,status:t.status.toLowerCase(),etherscanLink:t.etherscanLink||"",blockExplorerLink:"",currencyUsed:t.currencyUsed})}this.updateState({paymentTx:r},t)}async calculatePastTx(e,t){const r=[],n=[],i=t.toLowerCase();for(const t of e)if(t.network===Fu[this.getProviderConfig().chainId].chainId&&t.to&&t.from&&(i===t.from.toLowerCase()||i===t.to.toLowerCase()))if("confirmed"!==t.status)n.push(t);else{const e=Id(t,i);r.push(e)}const o=n.map((e=>kd(e.transaction_hash,this.provider).catch((e=>au().error(e))))),s=await Promise.all(o);for(const[e,o]of n.entries()){const n=Id(o,i);n.status=s[e]||a.TransactionStatus.submitted,r.push(n),i===o.from.toLowerCase()&&n.status&&n.status!==o.status&&this.patchPastTx({id:o.id,status:n.status,updated_at:(new Date).toISOString()},t)}const c=this.cancelTxCalculate(r);this.updateState({formattedPastTransactions:[...c]},t)}cancelTxCalculate(e){const t={};for(const r of e)t[r.nonce]?t[r.nonce].push(r):t[r.nonce]=[r];for(const[,e]of Object.entries(t))if(e.length>1){const t=e.sort(((e,t)=>{const r=new Date(e.date).getTime();return new Date(t.date).getTime()-r})),r=t[0];r.is_cancel=!0,t.slice(1).forEach((e=>{e.hasCancel=!0,e.status="confirmed"===r.status?a.TransactionStatus.cancelled:a.TransactionStatus.cancelling,e.cancelDateInitiated=`${Cd(new Date(r.date).getTime())} - ${Od(r.date)}`,e.etherscanLink=r.etherscanLink,e.cancelGas=r.gas,e.cancelGasPrice=r.gasPrice}))}return e}}class vy{constructor(e){let{address:t,symbol:r,decimals:n,name:i,provider:o}=e;(0,s.Z)(this,"address",void 0),(0,s.Z)(this,"symbol",void 0),(0,s.Z)(this,"decimals",void 0),(0,s.Z)(this,"name",void 0),(0,s.Z)(this,"contract",void 0),this.address=t,this.contract=new Jn(t,cu,o),this.symbol=r,this.decimals=n,this.name=i}async getSymbol(){return this.symbol&&"ERC20"!==this.symbol||(this.symbol=await this.contract.symbol()),this.symbol}async getDecimals(){try{return this.decimals||(this.decimals=await this.contract.decimals()),this.decimals}catch(e){return au().warn(`Could not get decimals for token ${this.address}`,e),0}}async getName(){return this.name||(this.name=await this.contract.name()),this.name}async getUserBalance(e){this.decimals||await this.getDecimals();const t=await this.contract.balanceOf(e);return new Td(t).toString(16)}}const wy="eth";class Ay extends a.BaseController{constructor(e){let{config:t,state:r,onPreferencesStateChange:i,onNetworkStateChange:o,onTokensStateChange:a}=e;super({config:t,state:r}),(0,s.Z)(this,"conversionInterval",void 0),this.defaultState=(0,n.Z)((0,n.Z)({},this.defaultState),{},{contractExchangeRates:{}}),this.initialize(),i((e=>{const{selectedAddress:t}=e;this.configure({selectedAddress:t})})),o((e=>{const{chainId:t,ticker:r}=e.providerConfig;this.configure({chainId:t,nativeCurrency:r})})),a((e=>{const{tokens:t}=e,r=t[this.config.selectedAddress];(null==r?void 0:r.length)>0&&this.config.tokens!==t[this.config.selectedAddress]&&(this.configure({tokens:t[this.config.selectedAddress]}),this.updateExchangeRates())}))}scheduleConversionInterval(){this.conversionInterval&&window.clearInterval(this.conversionInterval),this.conversionInterval=window.setInterval((()=>{Nd.checkIfIdle()||this.updateExchangeRates()}),this.config.pollInterval)}async updateExchangeRates(){const e=Wu[this.config.chainId];let t={};e?t=await this.fetchExchangeRates(this.config.nativeCurrency,e):(au().info(`ChainId ${this.config.chainId} not supported by coingecko`),this.config.tokens.forEach((e=>{t[e.tokenAddress]=void 0}))),this.update({contractExchangeRates:t})}async fetchExchangeRates(e,t){const r=this.config.tokens.map((e=>e.tokenAddress));if(Vu.has(e.toLowerCase())){const n=await(0,Hd.get)(`${this.config.api}/simple/token_price/${t.platform}?contract_addresses=${r.join(",")}&vs_currencies=${e.toLowerCase()}&include_market_cap=false&include_24hr_vol=false&include_24hr_change=false&include_last_updated_at=false`),i={};return Object.keys(n).forEach((t=>{i[t]=n[t][e.toLowerCase()]||0})),i}const[n,i]=await Promise.all([(0,Hd.get)(`${this.config.api}/simple/token_price/${t.platform}?contract_addresses=${r.join(",")}&vs_currencies=${wy}&include_market_cap=false&include_24hr_vol=false&include_24hr_change=false&include_last_updated_at=false`),(0,Hd.get)(`${this.config.currencyApi}/currency?fsym=${e.toUpperCase()}&tsyms=${wy.toUpperCase()}`)]),o={};return Object.keys(n).forEach((e=>{o[e]=n[e][wy]*Number.parseFloat(i[wy])||0})),o}}function Ey(e,t){return e.reduce(((e,r)=>{const n=r[t];return"boolean"==typeof n||(e[n]=r),e}),{})}const _y=(e,t)=>{const r=Ey(e||[],"tokenAddress"),n=Ey(t||[],"tokenAddress"),i=t;return Object.keys(r).forEach((e=>{!n[e]&&r[e].isEtherScan&&i.push(r[e])})),i},Sy=18e4;class xy extends a.BaseController{constructor(e){let{config:t,state:r,provider:n,getNetworkIdentifier:i,getCustomTokens:o,getEtherScanTokens:a,getProviderConfig:c,onPreferencesStateChange:u,onNetworkStateChange:l}=e;super({config:t,state:r}),(0,s.Z)(this,"name","TokensController"),(0,s.Z)(this,"provider",void 0),(0,s.Z)(this,"ethersProvider",void 0),(0,s.Z)(this,"_timer",void 0),(0,s.Z)(this,"getNetworkIdentifier",void 0),(0,s.Z)(this,"getProviderConfig",void 0),(0,s.Z)(this,"getCustomTokens",void 0),(0,s.Z)(this,"getEtherScanTokens",void 0),this.provider=n,this.ethersProvider=new ou(this.provider,"any"),this.getNetworkIdentifier=i,this.getCustomTokens=o,this.getEtherScanTokens=a,this.getProviderConfig=c,this.defaultConfig={interval:Sy,selectedAddress:"",chainId:""},this.defaultState={tokens:{}},this.initialize(),u((e=>{e.selectedAddress!==this.config.selectedAddress&&(this.configure({selectedAddress:e.selectedAddress}),this.restartTokenDetection())})),l((e=>{const{chainId:t}=e.providerConfig;t!==this.config.chainId&&(this.configure({chainId:t}),this.restartTokenDetection())}))}get userSelectedAddress(){return this.config.selectedAddress}get userTokens(){var e;return this.userSelectedAddress&&null!==(e=this.state.tokens[this.userSelectedAddress])&&void 0!==e?e:[]}get interval(){return this.config.interval}set interval(e){this._timer&&window.clearInterval(this._timer),e&&(this._timer=window.setInterval((()=>{Nd.checkIfIdle()||(this.detectNewTokens(),this.refreshTokenBalances())}),e))}startTokenDetection(e){this.configure({selectedAddress:e}),this.restartTokenDetection()}restartTokenDetection(){this.userSelectedAddress&&(this.detectNewTokens(),this.refreshTokenBalances(),this.config.interval=Sy)}detectNewTokens(){const e=this.userSelectedAddress;if(!e)return;const t=this.getNetworkIdentifier(),r=[];if(!t)return void this.update({tokens:{[e]:[...r]}});const n=this.getProviderConfig();if(null!=n&&n.isErc20&&null!=n&&n.tokenAddress&&r.push({tokenAddress:n.tokenAddress,name:n.tickerName,logo:n.logo,erc20:!0,symbol:n.ticker,decimals:"18",chainId:t}),this.getCustomTokens){const n=this.getCustomTokens(e);r.push(...n.reduce(((e,r)=>(r.network===t&&e.push({tokenAddress:r.token_address,name:r.token_name,logo:"eth.svg",erc20:!0,symbol:r.token_symbol,decimals:r.decimals,balance:"",customTokenId:r.id.toString(),chainId:r.network}),e)),[]))}this.update({tokens:{[e]:[...r]}})}async refreshTokenBalances(){const e=this.userSelectedAddress;if(""===e)return;const t=[...this.userTokens],r=t.map((e=>e.tokenAddress)),i=[];try{const o=this.getNetworkIdentifier();if(Gu.includes(o)){const t=await this.getEtherScanTokens(e,o);i.push(...t)}if(r.length>0){const s=Ku[o];if(s){const a=new Jn(s,fu,this.ethersProvider),c=await a.balances([e],r);r.forEach(((e,r)=>{const s=K(c[r]);s&&"0x0"!==s&&i.push((0,n.Z)((0,n.Z)({},t[r]),{},{balance:s,chainId:o}))}))}else this.getTokenBalancesUsingHandler(t)}}catch(e){au().error(e,"unable to fetch token balances using single call balance address"),this.getTokenBalancesUsingHandler(t)}finally{this.update({tokens:{[e]:i}})}}async getTokenBalancesUsingHandler(e){if(!this.userSelectedAddress)return;const t=e,r=(await Promise.allSettled(t.map((async e=>{try{const t=new vy({address:e.tokenAddress,decimals:Number.parseInt(e.decimals),name:e.name,symbol:e.symbol,provider:this.ethersProvider}),r=await t.getUserBalance(this.userSelectedAddress);return{decimals:t.decimals.toString(),erc20:!0,logo:e.logo||"eth.svg",name:t.name,symbol:t.symbol,tokenAddress:Bd(t.address,e.chainId),balance:`0x${r}`,customTokenId:e.customTokenId,network:e.chainId,chainId:e.chainId}}catch(e){return void au().warn("Invalid contract address while fetching",e)}})))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));this.update({tokens:{[this.userSelectedAddress]:_y(this.userTokens,r)}})}}const Ty=class{constructor(e){let{provider:t,blockTracker:r,getPendingTransactions:n,getConfirmedTransactions:i}=e;(0,s.Z)(this,"provider",void 0),(0,s.Z)(this,"blockTracker",void 0),(0,s.Z)(this,"getPendingTransactions",void 0),(0,s.Z)(this,"getConfirmedTransactions",void 0),(0,s.Z)(this,"lockMap",void 0),this.provider=t,this.blockTracker=r,this.getPendingTransactions=n,this.getConfirmedTransactions=i,this.lockMap={}}async getGlobalLock(){const e=this._lookupMutex("global");return{releaseLock:await e.acquire()}}async getNonceLock(e){await this._globalMutexFree();const t=await this._takeMutex(e);try{const r={},n=await this._getNetworkNextNonce(e),i=this._getHighestLocallyConfirmed(e),o=n.nonce,s=Math.max(o,i),a=this.getPendingTransactions(e),c=this._getHighestContinuousFrom(a,s);return r.params={highestLocallyConfirmed:i,highestSuggested:s,nextNetworkNonce:o},r.local=c,r.network=n,{nextNonce:Math.max(n.nonce,c.nonce),nonceDetails:r,releaseLock:t}}catch(e){throw t(),e}}async _globalMutexFree(){const e=this._lookupMutex("global");(await e.acquire())()}async _takeMutex(e){const t=this._lookupMutex(e);return await t.acquire()}_lookupMutex(e){let t=this.lockMap[e];return t||(t=new l,this.lockMap[e]=t),t}async _getNetworkNextNonce(e){const t=await this.blockTracker.getLatestBlock(),r=await this.provider.request({method:ju.ETH_GET_TRANSACTION_COUNT,params:[e,t.idempotencyKey]}),n=Number.parseInt(r,16);return{name:"network",nonce:n,details:{block:t,baseCount:n}}}_getHighestLocallyConfirmed(e){const t=this.getConfirmedTransactions(e),r=this._getHighestNonce(t);return Number.isInteger(r)?r+1:0}_getHighestNonce(e){const t=e.map((e=>{const{nonce:t}=e.transaction;return Number.parseInt(t,16)}));return Math.max.apply(null,t)}_getHighestContinuousFrom(e,t){const r=new Set(e.map((e=>{const{nonce:t}=e.transaction;return Number.parseInt(t,16)})));let n=t;for(;r.has(n);)n+=1;return{name:"local",nonce:n,details:{startPoint:t,highest:n}}}};class Py extends qg.SafeEventEmitter{constructor(e){let{provider:t,nonceTracker:r,approveTransaction:n,publishTransaction:i,getPendingTransactions:o,getConfirmedTransactions:a}=e;super(),(0,s.Z)(this,"DROPPED_BUFFER_COUNT",3),(0,s.Z)(this,"nonceTracker",void 0),(0,s.Z)(this,"provider",void 0),(0,s.Z)(this,"approveTransaction",void 0),(0,s.Z)(this,"droppedBlocksBufferByHash",void 0),(0,s.Z)(this,"getConfirmedTransactions",void 0),(0,s.Z)(this,"getPendingTransactions",void 0),(0,s.Z)(this,"publishTransaction",void 0),this.provider=t,this.nonceTracker=r,this.approveTransaction=n,this.publishTransaction=i,this.getPendingTransactions=o,this.getConfirmedTransactions=a,this.droppedBlocksBufferByHash=new Map}async updatePendingTxs(){const e=await this.nonceTracker.getGlobalLock();try{const e=this.getPendingTransactions();await Promise.all(e.map((e=>this._checkPendingTx(e))))}catch(e){au().error("PendingTransactionTracker - Error updating pending transactions"),au().error(e)}e.releaseLock()}async resubmitPendingTxs(e){const t=this.getPendingTransactions();if(0!==t.length)for(const n of t)try{await this._resubmitTx(n,e.idempotencyKey)}catch(e){var r;const t=(null===(r=e.value)||void 0===r||null===(r=r.message)||void 0===r?void 0:r.toLowerCase())||e.message.toLowerCase();if(t.includes("replacement transaction underpriced")||t.includes("known transaction")||t.includes("gas price too low to replace")||t.includes("transaction with the same hash was already imported")||t.includes("gateway timeout")||t.includes("nonce too low"))return;n.warning={error:t,message:"There was an error when resubmitting this transaction."},this.emit(a.TX_EVENTS.TX_WARNING,{txMeta:n,error:e,txId:n.id})}}async _resubmitTx(e,t){e.firstRetryBlockNumber||this.emit(a.TX_EVENTS.TX_BLOCK_UPDATE,{txMeta:e,latestBlockNumber:t,txId:e.id});const r=e.firstRetryBlockNumber||t,n=Number.parseInt(t,16)-Number.parseInt(r,16),i=e.retryCount||0;if(n<=Math.min(50,2**i))return;if(!("rawTx"in e))return this.approveTransaction(e.id);const{rawTx:o}=e,s=await this.publishTransaction(o);return this.emit(a.TX_EVENTS.TX_RETRY,{txMeta:e,txId:e.id}),s}async _checkPendingTx(e){const t=e,r=t.transactionHash,n=t.id;if(t.status===a.TransactionStatus.submitted){if(!r){const e=new Error("We had an error while submitting this transaction, please try again.");return e.name="NoTxHashError",void this.emit(a.TX_EVENTS.TX_FAILED,{txId:n,error:e})}if(this._checkIfNonceIsTaken(t))this.emit(a.TX_EVENTS.TX_DROPPED,{txId:n});else{try{const e=await this.provider.request({method:ju.ETH_GET_TRANSACTION_RECEIPT,params:[r]});if(null!=e&&e.blockNumber){const{baseFeePerGas:t,timestamp:r}=await this.provider.request({method:ju.ETH_GET_BLOCK_BY_HASH,params:[e.blockHash,!1]});return void this.emit(a.TX_EVENTS.TX_CONFIRMED,{txId:n,txReceipt:e,baseFeePerGas:t,blockTimestamp:r})}}catch(e){au().error("error while loading tx",e),t.warning={error:e.message,message:"There was a problem loading this transaction."},this.emit(a.TX_EVENTS.TX_WARNING,{txMeta:t})}await this._checkIfTxWasDropped(t)&&this.emit(a.TX_EVENTS.TX_DROPPED,{txId:n})}}}async _checkIfTxWasDropped(e){const{transactionHash:t,transaction:{nonce:r,from:n}}=e,i=await this.provider.request({method:ju.ETH_GET_TRANSACTION_COUNT,params:[n,"latest"]});if(Number.parseInt(r,16)>=Number.parseInt(i,16))return!1;this.droppedBlocksBufferByHash.has(t)||this.droppedBlocksBufferByHash.set(t,0);const o=this.droppedBlocksBufferByHash.get(t);return o<this.DROPPED_BUFFER_COUNT?(this.droppedBlocksBufferByHash.set(t,o+1),!1):(this.droppedBlocksBufferByHash.delete(t),!0)}_checkIfNonceIsTaken(e){const t=e.transaction.from;return this.getConfirmedTransactions(t).some((t=>t.id!==e.id&&t.transaction.nonce===e.transaction.nonce))}}var Iy=i(8834);const ky=(e,t)=>Iy.Buffer.from(e,t);function Oy(e,t){const r=(e,r)=>t(ky(e),r)>>>0;return r.signed=(e,r)=>t(ky(e),r),r.unsigned=r,r.model=e,r}Oy("crc1",((e,t=0)=>{let r=~~t,n=0;for(let t=0;t<e.length;t++)n+=e[t];return r+=n%256,r%256}));let Cy=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];"undefined"!=typeof Int32Array&&(Cy=new Int32Array(Cy)),Oy("crc-8",((e,t=0)=>{let r=~~t;for(let t=0;t<e.length;t++)r=255&Cy[255&(r^e[t])];return r}));let Ny=[0,94,188,226,97,63,221,131,194,156,126,32,163,253,31,65,157,195,33,127,252,162,64,30,95,1,227,189,62,96,130,220,35,125,159,193,66,28,254,160,225,191,93,3,128,222,60,98,190,224,2,92,223,129,99,61,124,34,192,158,29,67,161,255,70,24,250,164,39,121,155,197,132,218,56,102,229,187,89,7,219,133,103,57,186,228,6,88,25,71,165,251,120,38,196,154,101,59,217,135,4,90,184,230,167,249,27,69,198,152,122,36,248,166,68,26,153,199,37,123,58,100,134,216,91,5,231,185,140,210,48,110,237,179,81,15,78,16,242,172,47,113,147,205,17,79,173,243,112,46,204,146,211,141,111,49,178,236,14,80,175,241,19,77,206,144,114,44,109,51,209,143,12,82,176,238,50,108,142,208,83,13,239,177,240,174,76,18,145,207,45,115,202,148,118,40,171,245,23,73,8,86,180,234,105,55,213,139,87,9,235,181,54,104,138,212,149,203,41,119,244,170,72,22,233,183,85,11,136,214,52,106,43,117,151,201,74,20,246,168,116,42,200,150,21,75,169,247,182,232,10,84,215,137,107,53];"undefined"!=typeof Int32Array&&(Ny=new Int32Array(Ny)),Oy("dallas-1-wire",((e,t=0)=>{let r=~~t;for(let t=0;t<e.length;t++)r=255&Ny[255&(r^e[t])];return r}));let Ry=[0,213,127,170,254,43,129,84,41,252,86,131,215,2,168,125,82,135,45,248,172,121,211,6,123,174,4,209,133,80,250,47,164,113,219,14,90,143,37,240,141,88,242,39,115,166,12,217,246,35,137,92,8,221,119,162,223,10,160,117,33,244,94,139,157,72,226,55,99,182,28,201,180,97,203,30,74,159,53,224,207,26,176,101,49,228,78,155,230,51,153,76,24,205,103,178,57,236,70,147,199,18,184,109,16,197,111,186,238,59,145,68,107,190,20,193,149,64,234,63,66,151,61,232,188,105,195,22,239,58,144,69,17,196,110,187,198,19,185,108,56,237,71,146,189,104,194,23,67,150,60,233,148,65,235,62,106,191,21,192,75,158,52,225,181,96,202,31,98,183,29,200,156,73,227,54,25,204,102,179,231,50,152,77,48,229,79,154,206,27,177,100,114,167,13,216,140,89,243,38,91,142,36,241,165,112,218,15,32,245,95,138,222,11,161,116,9,220,118,163,247,34,136,93,214,3,169,124,40,253,87,130,255,42,128,85,1,212,126,171,132,81,251,46,122,175,5,208,173,120,210,7,83,134,44,249];"undefined"!=typeof Int32Array&&(Ry=new Int32Array(Ry)),Oy("crc-8-dvbs2",((e,t=0)=>{let r=~~t;for(let t=0;t<e.length;t++)r=255&Ry[255&(r^e[t])];return r}));let By=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];"undefined"!=typeof Int32Array&&(By=new Int32Array(By)),Oy("crc-16",((e,t=0)=>{let r=~~t;for(let t=0;t<e.length;t++)r=65535&(By[255&(r^e[t])]^r>>8);return r}));let My=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];"undefined"!=typeof Int32Array&&(My=new Int32Array(My)),Oy("ccitt",((e,t)=>{let r=void 0!==t?~~t:65535;for(let t=0;t<e.length;t++)r=65535&(My[255&(r>>8^e[t])]^r<<8);return r}));let Ly=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];"undefined"!=typeof Int32Array&&(Ly=new Int32Array(Ly)),Oy("crc-16-modbus",((e,t)=>{let r=void 0!==t?~~t:65535;for(let t=0;t<e.length;t++)r=65535&(Ly[255&(r^e[t])]^r>>8);return r})),Oy("xmodem",((e,t)=>{let r=void 0!==t?~~t:0;for(let t=0;t<e.length;t++){let n=r>>>8&255;n^=255&e[t],n^=n>>>4,r=r<<8&65535,r^=n,n=n<<5&65535,r^=n,n=n<<7&65535,r^=n}return r}));let Fy=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960];"undefined"!=typeof Int32Array&&(Fy=new Int32Array(Fy)),Oy("kermit",((e,t)=>{let r=void 0!==t?~~t:0;for(let t=0;t<e.length;t++)r=65535&(Fy[255&(r^e[t])]^r>>8);return r}));let jy=[0,8801531,9098509,825846,9692897,1419802,1651692,10452759,10584377,2608578,2839604,11344079,3303384,11807523,12104405,4128302,12930697,4391538,5217156,13227903,5679208,13690003,14450021,5910942,6606768,14844747,15604413,6837830,16197969,7431594,8256604,16494759,840169,9084178,8783076,18463,10434312,1670131,1434117,9678590,11358416,2825259,2590173,10602790,4109873,12122826,11821884,3289031,13213536,5231515,4409965,12912278,5929345,14431610,13675660,5693559,6823513,15618722,14863188,6588335,16513208,8238147,7417269,16212302,1680338,10481449,9664223,1391140,9061683,788936,36926,8838341,12067563,4091408,3340262,11844381,2868234,11372785,10555655,2579964,14478683,5939616,5650518,13661357,5180346,13190977,12967607,4428364,8219746,16457881,16234863,7468436,15633027,6866552,6578062,14816117,1405499,9649856,10463030,1698765,8819930,55329,803287,9047340,11858690,3325945,4072975,12086004,2561507,10574104,11387118,2853909,13647026,5664841,5958079,14460228,4446803,12949160,13176670,5194661,7454091,16249200,16476294,8201341,14834538,6559633,6852199,15647388,3360676,11864927,12161705,4185682,10527045,2551230,2782280,11286707,9619101,1346150,1577872,10379115,73852,8875143,9172337,899466,16124205,7357910,8182816,16421083,6680524,14918455,15678145,6911546,5736468,13747439,14507289,5968354,12873461,4334094,5159928,13170435,4167245,12180150,11879232,3346363,11301036,2767959,2532769,10545498,10360692,1596303,1360505,9604738,913813,9157998,8856728,92259,16439492,8164415,7343561,16138546,6897189,15692510,14936872,6662099,5986813,14488838,13733104,5750795,13156124,5174247,4352529,12855018,2810998,11315341,10498427,2522496,12124823,4148844,3397530,11901793,9135439,862644,110658,8912057,1606574,10407765,9590435,1317464,15706879,6940164,6651890,14889737,8145950,16384229,16161043,7394792,5123014,13133629,12910283,4370992,14535975,5997020,5707818,13718737,2504095,10516836,11329682,2796649,11916158,3383173,4130419,12143240,8893606,129117,876971,9121104,1331783,9576124,10389322,1625009,14908182,6633453,6925851,15721184,7380471,16175372,16402682,8127489,4389423,12891860,13119266,5137369,13704398,5722165,6015427,14517560];"undefined"!=typeof Int32Array&&(jy=new Int32Array(jy)),Oy("crc-24",((e,t)=>{let r=void 0!==t?~~t:11994318;for(let t=0;t<e.length;t++)r=16777215&(jy[255&(r>>16^e[t])]^r<<8);return r}));let Uy=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"!=typeof Int32Array&&(Uy=new Int32Array(Uy));const Dy=Oy("crc-32",((e,t)=>{let r=0===t?0:-1^~~t;for(let t=0;t<e.length;t++)r=Uy[255&(r^e[t])]^r>>>8;return-1^r}));let Zy=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];"undefined"!=typeof Int32Array&&(Zy=new Int32Array(Zy)),Oy("crc-32-mpeg",((e,t)=>{let r=void 0!==t?~~t:4294967295;for(let t=0;t<e.length;t++)r=Zy[255&(r>>24^e[t])]^r<<8;return r}));let Hy=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"!=typeof Int32Array&&(Hy=new Int32Array(Hy)),Oy("jam",((e,t=-1)=>{let r=0===t?0:~~t;for(let t=0;t<e.length;t++)r=Hy[255&(r^e[t])]^r>>>8;return r}));const $y={mainnet:{name:"mainnet",chainId:1,networkId:1,defaultHardfork:"shanghai",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"The Ethereum main chain",url:"https://ethstats.net/",genesis:{gasLimit:5e3,difficulty:17179869184,nonce:"0x0000000000000042",extraData:"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfc64ec04"},{name:"homestead",block:115e4,forkHash:"0x97c2c34c"},{name:"dao",block:192e4,forkHash:"0x91d1f948"},{name:"tangerineWhistle",block:2463e3,forkHash:"0x7a64da13"},{name:"spuriousDragon",block:2675e3,forkHash:"0x3edd5b10"},{name:"byzantium",block:437e4,forkHash:"0xa00bc324"},{name:"constantinople",block:728e4,forkHash:"0x668db0af"},{name:"petersburg",block:728e4,forkHash:"0x668db0af"},{name:"istanbul",block:9069e3,forkHash:"0x879d6e30"},{name:"muirGlacier",block:92e5,forkHash:"0xe029e991"},{name:"berlin",block:12244e3,forkHash:"0x0eb440f6"},{name:"london",block:12965e3,forkHash:"0xb715077d"},{name:"arrowGlacier",block:13773e3,forkHash:"0x20c327fc"},{name:"grayGlacier",block:1505e4,forkHash:"0xf0afd0e3"},{name:"paris",ttd:"58750000000000000000000",block:15537394,forkHash:"0xf0afd0e3"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,timestamp:"1681338455",forkHash:"0xdce96c2d"},{name:"cancun",block:null,forkHash:null}],bootstrapNodes:[{ip:"18.138.108.67",port:30303,id:"d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666",location:"ap-southeast-1-001",comment:"bootnode-aws-ap-southeast-1-001"},{ip:"3.209.45.79",port:30303,id:"22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de",location:"us-east-1-001",comment:"bootnode-aws-us-east-1-001"},{ip:"65.108.70.101",port:30303,id:"2b252ab6a1d0f971d9722cb839a42cb81db019ba44c08754628ab4a823487071b5695317c8ccd085219c3a03af063495b2f1da8d18218da2d6a82981b45e6ffc",location:"eu-west-1-001",comment:"bootnode-hetzner-hel"},{ip:"157.90.35.166",port:30303,id:"4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052",location:"eu-central-1-001",comment:"bootnode-hetzner-fsn"}],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]},goerli:{name:"goerli",chainId:5,networkId:5,defaultHardfork:"shanghai",consensus:{type:"poa",algorithm:"clique",clique:{period:15,epoch:3e4}},comment:"Cross-client PoA test network",url:"https://github.com/goerli/testnet",genesis:{timestamp:"0x5c51a607",gasLimit:10485760,difficulty:1,nonce:"0x0000000000000000",extraData:"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},hardforks:[{name:"chainstart",block:0,forkHash:"0xa3f5ab08"},{name:"homestead",block:0,forkHash:"0xa3f5ab08"},{name:"tangerineWhistle",block:0,forkHash:"0xa3f5ab08"},{name:"spuriousDragon",block:0,forkHash:"0xa3f5ab08"},{name:"byzantium",block:0,forkHash:"0xa3f5ab08"},{name:"constantinople",block:0,forkHash:"0xa3f5ab08"},{name:"petersburg",block:0,forkHash:"0xa3f5ab08"},{name:"istanbul",block:1561651,forkHash:"0xc25efa5c"},{name:"berlin",block:4460644,forkHash:"0x757a1c47"},{name:"london",block:5062605,forkHash:"0xb8c6299d"},{name:"paris",ttd:"10790000",block:7382819,forkHash:"0xb8c6299d"},{name:"mergeForkIdTransition",block:null,forkHash:null},{name:"shanghai",block:null,timestamp:"1678832736",forkHash:"0xf9843abf"},{name:"cancun",block:null,forkHash:null}],bootstrapNodes:[{ip:"51.141.78.53",port:30303,id:"011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a",location:"",comment:"Upstream bootnode 1"},{ip:"13.93.54.137",port:30303,id:"176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b",location:"",comment:"Upstream bootnode 2"},{ip:"94.237.54.114",port:30313,id:"46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291",location:"",comment:"Upstream bootnode 3"},{ip:"18.218.250.66",port:30313,id:"b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949",location:"",comment:"Upstream bootnode 4"},{ip:"3.11.147.67",port:30303,id:"a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91",location:"",comment:"Ethereum Foundation bootnode"},{ip:"51.15.116.226",port:30303,id:"a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd",location:"",comment:"Goerli Initiative bootnode"},{ip:"51.15.119.157",port:30303,id:"807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33",location:"",comment:"Goerli Initiative bootnode"},{ip:"51.15.119.157",port:40303,id:"a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd",location:"",comment:"Goerli Initiative bootnode"}],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]},sepolia:{name:"sepolia",chainId:11155111,networkId:11155111,defaultHardfork:"shanghai",consensus:{type:"pow",algorithm:"ethash",ethash:{}},comment:"PoW test network to replace Ropsten",url:"https://github.com/ethereum/go-ethereum/pull/23730",genesis:{timestamp:"0x6159af19",gasLimit:3e7,difficulty:131072,nonce:"0x0000000000000000",extraData:"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},hardforks:[{name:"chainstart",block:0,forkHash:"0xfe3366e7"},{name:"homestead",block:0,forkHash:"0xfe3366e7"},{name:"tangerineWhistle",block:0,forkHash:"0xfe3366e7"},{name:"spuriousDragon",block:0,forkHash:"0xfe3366e7"},{name:"byzantium",block:0,forkHash:"0xfe3366e7"},{name:"constantinople",block:0,forkHash:"0xfe3366e7"},{name:"petersburg",block:0,forkHash:"0xfe3366e7"},{name:"istanbul",block:0,forkHash:"0xfe3366e7"},{name:"muirGlacier",block:0,forkHash:"0xfe3366e7"},{name:"berlin",block:0,forkHash:"0xfe3366e7"},{name:"london",block:0,forkHash:"0xfe3366e7"},{name:"paris",ttd:"17000000000000000",block:1450409,forkHash:"0xfe3366e7"},{name:"mergeForkIdTransition",block:1735371,forkHash:"0xb96cbd13"},{name:"shanghai",block:null,timestamp:"1677557088",forkHash:"0xf7f9bc08"},{name:"cancun",block:null,forkHash:null}],bootstrapNodes:[{ip:"18.168.182.86",port:30303,id:"9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066",location:"",comment:"geth"},{ip:"52.14.151.177",port:30303,id:"ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7",location:"",comment:"besu"},{ip:"165.22.196.173",port:30303,id:"ce970ad2e9daa9e14593de84a8b49da3d54ccfdf83cbc4fe519cb8b36b5918ed4eab087dedd4a62479b8d50756b492d5f762367c8d20329a7854ec01547568a6",location:"",comment:"EF"},{ip:"65.108.95.67",port:30303,id:"075503b13ed736244896efcde2a992ec0b451357d46cb7a8132c0384721742597fc8f0d91bbb40bb52e7d6e66728d36a1fda09176294e4a30cfac55dcce26bc6",location:"",comment:"lodestar"}],dnsNetworks:["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]}};var Gy,zy,Vy,Wy,qy,Ky;!function(e){e[e.Mainnet=1]="Mainnet",e[e.Goerli=5]="Goerli",e[e.Sepolia=11155111]="Sepolia"}(Gy||(Gy={})),Gy.Mainnet,BigInt(0),mf("0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544"),Gy.Goerli,BigInt(0),mf("0x5d6cded585e73c4e322c30c2f782a336316f17dd85a4863b9d838d2d4b8b3008"),Gy.Sepolia,BigInt(0),mf("0x5eb6e371a698b8d68f665192350ffcecbbbf322916f4b51bd79bb6887da3f494"),function(e){e.Chainstart="chainstart",e.Homestead="homestead",e.Dao="dao",e.TangerineWhistle="tangerineWhistle",e.SpuriousDragon="spuriousDragon",e.Byzantium="byzantium",e.Constantinople="constantinople",e.Petersburg="petersburg",e.Istanbul="istanbul",e.MuirGlacier="muirGlacier",e.Berlin="berlin",e.London="london",e.ArrowGlacier="arrowGlacier",e.GrayGlacier="grayGlacier",e.MergeForkIdTransition="mergeForkIdTransition",e.Paris="paris",e.Shanghai="shanghai",e.Cancun="cancun"}(zy||(zy={})),function(e){e.ProofOfStake="pos",e.ProofOfWork="pow",e.ProofOfAuthority="poa"}(Vy||(Vy={})),function(e){e.Ethash="ethash",e.Clique="clique",e.Casper="casper"}(Wy||(Wy={})),function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumOne="arbitrum-one",e.xDaiChain="x-dai-chain",e.OptimisticKovan="optimistic-kovan",e.OptimisticEthereum="optimistic-ethereum"}(qy||(qy={})),function(e){e.Draft="draft",e.Review="review",e.Final="final"}(Ky||(Ky={}));const Jy={1153:{comment:"Transient storage opcodes",url:"https://eips.ethereum.org/EIPS/eip-1153",status:Ky.Review,minimumHardfork:zy.Chainstart,requiredEIPs:[],gasPrices:{tstore:{v:100,d:"Base fee of the TSTORE opcode"},tload:{v:100,d:"Base fee of the TLOAD opcode"}}},1559:{comment:"Fee market change for ETH 1.0 chain",url:"https://eips.ethereum.org/EIPS/eip-1559",status:Ky.Final,minimumHardfork:zy.Berlin,requiredEIPs:[2930],gasConfig:{baseFeeMaxChangeDenominator:{v:8,d:"Maximum base fee change denominator"},elasticityMultiplier:{v:2,d:"Maximum block gas target elasticity"},initialBaseFee:{v:1e9,d:"Initial base fee on first EIP1559 block"}}},2315:{comment:"Simple subroutines for the EVM",url:"https://eips.ethereum.org/EIPS/eip-2315",status:Ky.Draft,minimumHardfork:zy.Istanbul,requiredEIPs:[],gasPrices:{beginsub:{v:2,d:"Base fee of the BEGINSUB opcode"},returnsub:{v:5,d:"Base fee of the RETURNSUB opcode"},jumpsub:{v:10,d:"Base fee of the JUMPSUB opcode"}}},2565:{comment:"ModExp gas cost",url:"https://eips.ethereum.org/EIPS/eip-2565",status:Ky.Final,minimumHardfork:zy.Byzantium,requiredEIPs:[],gasPrices:{modexpGquaddivisor:{v:3,d:"Gquaddivisor from modexp precompile for gas calculation"}}},2718:{comment:"Typed Transaction Envelope",url:"https://eips.ethereum.org/EIPS/eip-2718",status:Ky.Final,minimumHardfork:zy.Chainstart,requiredEIPs:[]},2929:{comment:"Gas cost increases for state access opcodes",url:"https://eips.ethereum.org/EIPS/eip-2929",status:Ky.Final,minimumHardfork:zy.Chainstart,requiredEIPs:[],gasPrices:{coldsload:{v:2100,d:"Gas cost of the first read of storage from a given location (per transaction)"},coldaccountaccess:{v:2600,d:"Gas cost of the first read of a given address (per transaction)"},warmstorageread:{v:100,d:"Gas cost of reading storage locations which have already loaded 'cold'"},sstoreCleanGasEIP2200:{v:2900,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreNoopGasEIP2200:{v:100,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:100,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitRefundEIP2200:{v:19900,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanRefundEIP2200:{v:4900,d:"Once per SSTORE operation for resetting to the original non-zero value"},call:{v:0,d:"Base fee of the CALL opcode"},callcode:{v:0,d:"Base fee of the CALLCODE opcode"},delegatecall:{v:0,d:"Base fee of the DELEGATECALL opcode"},staticcall:{v:0,d:"Base fee of the STATICCALL opcode"},balance:{v:0,d:"Base fee of the BALANCE opcode"},extcodesize:{v:0,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:0,d:"Base fee of the EXTCODECOPY opcode"},extcodehash:{v:0,d:"Base fee of the EXTCODEHASH opcode"},sload:{v:0,d:"Base fee of the SLOAD opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"}}},2930:{comment:"Optional access lists",url:"https://eips.ethereum.org/EIPS/eip-2930",status:Ky.Final,minimumHardfork:zy.Istanbul,requiredEIPs:[2718,2929],gasPrices:{accessListStorageKeyCost:{v:1900,d:"Gas cost per storage key in an Access List transaction"},accessListAddressCost:{v:2400,d:"Gas cost per storage key in an Access List transaction"}}},3074:{comment:"AUTH and AUTHCALL opcodes",url:"https://eips.ethereum.org/EIPS/eip-3074",status:Ky.Review,minimumHardfork:zy.London,requiredEIPs:[],gasPrices:{auth:{v:3100,d:"Gas cost of the AUTH opcode"},authcall:{v:0,d:"Gas cost of the AUTHCALL opcode"},authcallValueTransfer:{v:6700,d:"Paid for CALL when the value transfer is non-zero"}}},3198:{comment:"BASEFEE opcode",url:"https://eips.ethereum.org/EIPS/eip-3198",status:Ky.Final,minimumHardfork:zy.London,requiredEIPs:[],gasPrices:{basefee:{v:2,d:"Gas cost of the BASEFEE opcode"}}},3529:{comment:"Reduction in refunds",url:"https://eips.ethereum.org/EIPS/eip-3529",status:Ky.Final,minimumHardfork:zy.Berlin,requiredEIPs:[2929],gasConfig:{maxRefundQuotient:{v:5,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{selfdestructRefund:{v:0,d:"Refunded following a selfdestruct operation"},sstoreClearRefundEIP2200:{v:4800,d:"Once per SSTORE operation for clearing an originally existing storage slot"}}},3540:{comment:"EVM Object Format (EOF) v1",url:"https://eips.ethereum.org/EIPS/eip-3540",status:Ky.Review,minimumHardfork:zy.London,requiredEIPs:[3541]},3541:{comment:"Reject new contracts starting with the 0xEF byte",url:"https://eips.ethereum.org/EIPS/eip-3541",status:Ky.Final,minimumHardfork:zy.Berlin,requiredEIPs:[]},3554:{comment:"Difficulty Bomb Delay to December 1st 2021",url:"https://eips.ethereum.org/EIPS/eip-3554",status:Ky.Final,minimumHardfork:zy.MuirGlacier,requiredEIPs:[],pow:{difficultyBombDelay:{v:95e5,d:"the amount of blocks to delay the difficulty bomb with"}}},3607:{comment:"Reject transactions from senders with deployed code",url:"https://eips.ethereum.org/EIPS/eip-3607",status:Ky.Final,minimumHardfork:zy.Chainstart,requiredEIPs:[]},3651:{comment:"Warm COINBASE",url:"https://eips.ethereum.org/EIPS/eip-3651",status:Ky.Review,minimumHardfork:zy.London,requiredEIPs:[2929]},3670:{comment:"EOF - Code Validation",url:"https://eips.ethereum.org/EIPS/eip-3670",status:"Review",minimumHardfork:zy.London,requiredEIPs:[3540],gasConfig:{},gasPrices:{},vm:{},pow:{}},3675:{comment:"Upgrade consensus to Proof-of-Stake",url:"https://eips.ethereum.org/EIPS/eip-3675",status:Ky.Final,minimumHardfork:zy.London,requiredEIPs:[]},3855:{comment:"PUSH0 instruction",url:"https://eips.ethereum.org/EIPS/eip-3855",status:Ky.Review,minimumHardfork:zy.Chainstart,requiredEIPs:[],gasPrices:{push0:{v:2,d:"Base fee of the PUSH0 opcode"}}},3860:{comment:"Limit and meter initcode",url:"https://eips.ethereum.org/EIPS/eip-3860",status:Ky.Review,minimumHardfork:zy.SpuriousDragon,requiredEIPs:[],gasPrices:{initCodeWordCost:{v:2,d:"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},vm:{maxInitCodeSize:{v:49152,d:"Maximum length of initialization code when creating a contract"}}},4345:{comment:"Difficulty Bomb Delay to June 2022",url:"https://eips.ethereum.org/EIPS/eip-4345",status:Ky.Final,minimumHardfork:zy.London,requiredEIPs:[],pow:{difficultyBombDelay:{v:107e5,d:"the amount of blocks to delay the difficulty bomb with"}}},4399:{comment:"Supplant DIFFICULTY opcode with PREVRANDAO",url:"https://eips.ethereum.org/EIPS/eip-4399",status:Ky.Review,minimumHardfork:zy.London,requiredEIPs:[],gasPrices:{prevrandao:{v:2,d:"Base fee of the PREVRANDAO opcode (previously DIFFICULTY)"}}},4788:{comment:"Beacon block root in the EVM",url:"https://eips.ethereum.org/EIPS/eip-4788",status:Ky.Draft,minimumHardfork:zy.Cancun,requiredEIPs:[],gasPrices:{beaconrootCost:{v:4200,d:"Gas cost when calling the beaconroot stateful precompile"}},vm:{historicalRootsLength:{v:98304,d:"The modulo parameter of the beaconroot ring buffer in the beaconroot statefull precompile"}}},4844:{comment:"Shard Blob Transactions",url:"https://eips.ethereum.org/EIPS/eip-4844",status:Ky.Draft,minimumHardfork:zy.Paris,requiredEIPs:[1559,2718,2930,4895],gasConfig:{blobGasPerBlob:{v:131072,d:"The base fee for blob gas per blob"},targetBlobGasPerBlock:{v:393216,d:"The target blob gas consumed per block"},maxblobGasPerBlock:{v:786432,d:"The max blob gas allowable per block"},blobGasPriceUpdateFraction:{v:3338477,d:"The denominator used in the exponential when calculating a blob gas price"}},gasPrices:{simpleGasPerBlob:{v:12e3,d:"The basic gas fee for each blob"},minBlobGasPrice:{v:1,d:"The minimum fee per blob gas"},kzgPointEvaluationGasPrecompilePrice:{v:5e4,d:"The fee associated with the point evaluation precompile"},blobhash:{v:3,d:"Base fee of the BLOBHASH opcode"}},sharding:{blobCommitmentVersionKzg:{v:1,d:"The number indicated a versioned hash is a KZG commitment"},fieldElementsPerBlob:{v:4096,d:"The number of field elements allowed per blob"}}},4895:{comment:"Beacon chain push withdrawals as operations",url:"https://eips.ethereum.org/EIPS/eip-4895",status:Ky.Review,minimumHardfork:zy.Paris,requiredEIPs:[]},5133:{comment:"Delaying Difficulty Bomb to mid-September 2022",url:"https://eips.ethereum.org/EIPS/eip-5133",status:Ky.Draft,minimumHardfork:zy.GrayGlacier,requiredEIPs:[],pow:{difficultyBombDelay:{v:114e5,d:"the amount of blocks to delay the difficulty bomb with"}}},5656:{comment:"MCOPY - Memory copying instruction",url:"https://eips.ethereum.org/EIPS/eip-5656",status:Ky.Draft,minimumHardfork:zy.Shanghai,requiredEIPs:[],gasPrices:{mcopy:{v:3,d:"Base fee of the MCOPY opcode"}}},6780:{comment:"SELFDESTRUCT only in same transaction",url:"https://eips.ethereum.org/EIPS/eip-6780",status:Ky.Draft,minimumHardfork:zy.London,requiredEIPs:[]}};var Yy;!function(e){e.Draft="draft",e.Review="review",e.Final="final"}(Yy||(Yy={}));const Qy={chainstart:{name:"chainstart",comment:"Start of the Ethereum main chain",url:"",status:Yy.Final,gasConfig:{minGasLimit:{v:5e3,d:"Minimum the gas limit may ever be"},gasLimitBoundDivisor:{v:1024,d:"The bound divisor of the gas limit, used in update calculations"},maxRefundQuotient:{v:2,d:"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},gasPrices:{base:{v:2,d:"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},exp:{v:10,d:"Base fee of the EXP opcode"},expByte:{v:10,d:"Times ceil(log256(exponent)) for the EXP instruction"},keccak256:{v:30,d:"Base fee of the SHA3 opcode"},keccak256Word:{v:6,d:"Once per word of the SHA3 operation's data"},sload:{v:50,d:"Base fee of the SLOAD opcode"},sstoreSet:{v:2e4,d:"Once per SSTORE operation if the zeroness changes from zero"},sstoreReset:{v:5e3,d:"Once per SSTORE operation if the zeroness does not change from zero"},sstoreRefund:{v:15e3,d:"Once per SSTORE operation if the zeroness changes to zero"},jumpdest:{v:1,d:"Base fee of the JUMPDEST opcode"},log:{v:375,d:"Base fee of the LOG opcode"},logData:{v:8,d:"Per byte in a LOG* operation's data"},logTopic:{v:375,d:"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},create:{v:32e3,d:"Base fee of the CREATE opcode"},call:{v:40,d:"Base fee of the CALL opcode"},callStipend:{v:2300,d:"Free gas given at beginning of call"},callValueTransfer:{v:9e3,d:"Paid for CALL when the value transfor is non-zero"},callNewAccount:{v:25e3,d:"Paid for CALL when the destination address didn't exist prior"},selfdestructRefund:{v:24e3,d:"Refunded following a selfdestruct operation"},memory:{v:3,d:"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},quadCoeffDiv:{v:512,d:"Divisor for the quadratic particle of the memory cost equation"},createData:{v:200,d:""},tx:{v:21e3,d:"Per transaction. NOTE: Not payable on data of calls between transactions"},txCreation:{v:32e3,d:"The cost of creating a contract via tx"},txDataZero:{v:4,d:"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},txDataNonZero:{v:68,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},copy:{v:3,d:"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},ecRecover:{v:3e3,d:""},sha256:{v:60,d:""},sha256Word:{v:12,d:""},ripemd160:{v:600,d:""},ripemd160Word:{v:120,d:""},identity:{v:15,d:""},identityWord:{v:3,d:""},stop:{v:0,d:"Base fee of the STOP opcode"},add:{v:3,d:"Base fee of the ADD opcode"},mul:{v:5,d:"Base fee of the MUL opcode"},sub:{v:3,d:"Base fee of the SUB opcode"},div:{v:5,d:"Base fee of the DIV opcode"},sdiv:{v:5,d:"Base fee of the SDIV opcode"},mod:{v:5,d:"Base fee of the MOD opcode"},smod:{v:5,d:"Base fee of the SMOD opcode"},addmod:{v:8,d:"Base fee of the ADDMOD opcode"},mulmod:{v:8,d:"Base fee of the MULMOD opcode"},signextend:{v:5,d:"Base fee of the SIGNEXTEND opcode"},lt:{v:3,d:"Base fee of the LT opcode"},gt:{v:3,d:"Base fee of the GT opcode"},slt:{v:3,d:"Base fee of the SLT opcode"},sgt:{v:3,d:"Base fee of the SGT opcode"},eq:{v:3,d:"Base fee of the EQ opcode"},iszero:{v:3,d:"Base fee of the ISZERO opcode"},and:{v:3,d:"Base fee of the AND opcode"},or:{v:3,d:"Base fee of the OR opcode"},xor:{v:3,d:"Base fee of the XOR opcode"},not:{v:3,d:"Base fee of the NOT opcode"},byte:{v:3,d:"Base fee of the BYTE opcode"},address:{v:2,d:"Base fee of the ADDRESS opcode"},balance:{v:20,d:"Base fee of the BALANCE opcode"},origin:{v:2,d:"Base fee of the ORIGIN opcode"},caller:{v:2,d:"Base fee of the CALLER opcode"},callvalue:{v:2,d:"Base fee of the CALLVALUE opcode"},calldataload:{v:3,d:"Base fee of the CALLDATALOAD opcode"},calldatasize:{v:2,d:"Base fee of the CALLDATASIZE opcode"},calldatacopy:{v:3,d:"Base fee of the CALLDATACOPY opcode"},codesize:{v:2,d:"Base fee of the CODESIZE opcode"},codecopy:{v:3,d:"Base fee of the CODECOPY opcode"},gasprice:{v:2,d:"Base fee of the GASPRICE opcode"},extcodesize:{v:20,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:20,d:"Base fee of the EXTCODECOPY opcode"},blockhash:{v:20,d:"Base fee of the BLOCKHASH opcode"},coinbase:{v:2,d:"Base fee of the COINBASE opcode"},timestamp:{v:2,d:"Base fee of the TIMESTAMP opcode"},number:{v:2,d:"Base fee of the NUMBER opcode"},difficulty:{v:2,d:"Base fee of the DIFFICULTY opcode"},gaslimit:{v:2,d:"Base fee of the GASLIMIT opcode"},pop:{v:2,d:"Base fee of the POP opcode"},mload:{v:3,d:"Base fee of the MLOAD opcode"},mstore:{v:3,d:"Base fee of the MSTORE opcode"},mstore8:{v:3,d:"Base fee of the MSTORE8 opcode"},sstore:{v:0,d:"Base fee of the SSTORE opcode"},jump:{v:8,d:"Base fee of the JUMP opcode"},jumpi:{v:10,d:"Base fee of the JUMPI opcode"},pc:{v:2,d:"Base fee of the PC opcode"},msize:{v:2,d:"Base fee of the MSIZE opcode"},gas:{v:2,d:"Base fee of the GAS opcode"},push:{v:3,d:"Base fee of the PUSH opcode"},dup:{v:3,d:"Base fee of the DUP opcode"},swap:{v:3,d:"Base fee of the SWAP opcode"},callcode:{v:40,d:"Base fee of the CALLCODE opcode"},return:{v:0,d:"Base fee of the RETURN opcode"},invalid:{v:0,d:"Base fee of the INVALID opcode"},selfdestruct:{v:0,d:"Base fee of the SELFDESTRUCT opcode"}},vm:{stackLimit:{v:1024,d:"Maximum size of VM stack allowed"},callCreateDepth:{v:1024,d:"Maximum depth of call/create stack"},maxExtraDataSize:{v:32,d:"Maximum size extra data may be after Genesis"}},pow:{minimumDifficulty:{v:131072,d:"The minimum that the difficulty may ever be"},difficultyBoundDivisor:{v:2048,d:"The bound divisor of the difficulty, used in the update calculations"},durationLimit:{v:13,d:"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},epochDuration:{v:3e4,d:"Duration between proof-of-work epochs"},timebombPeriod:{v:1e5,d:"Exponential difficulty timebomb period"},minerReward:{v:BigInt("5000000000000000000"),d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:0,d:"the amount of blocks to delay the difficulty bomb with"}}},homestead:{name:"homestead",comment:"Homestead hardfork with protocol and network changes",url:"https://eips.ethereum.org/EIPS/eip-606",status:Yy.Final,gasPrices:{delegatecall:{v:40,d:"Base fee of the DELEGATECALL opcode"}}},dao:{name:"dao",comment:"DAO rescue hardfork",url:"https://eips.ethereum.org/EIPS/eip-779",status:Yy.Final},tangerineWhistle:{name:"tangerineWhistle",comment:"Hardfork with gas cost changes for IO-heavy operations",url:"https://eips.ethereum.org/EIPS/eip-608",status:Yy.Final,gasPrices:{sload:{v:200,d:"Once per SLOAD operation"},call:{v:700,d:"Once per CALL operation & message call transaction"},extcodesize:{v:700,d:"Base fee of the EXTCODESIZE opcode"},extcodecopy:{v:700,d:"Base fee of the EXTCODECOPY opcode"},balance:{v:400,d:"Base fee of the BALANCE opcode"},delegatecall:{v:700,d:"Base fee of the DELEGATECALL opcode"},callcode:{v:700,d:"Base fee of the CALLCODE opcode"},selfdestruct:{v:5e3,d:"Base fee of the SELFDESTRUCT opcode"}}},spuriousDragon:{name:"spuriousDragon",comment:"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit",url:"https://eips.ethereum.org/EIPS/eip-607",status:Yy.Final,gasPrices:{expByte:{v:50,d:"Times ceil(log256(exponent)) for the EXP instruction"}},vm:{maxCodeSize:{v:24576,d:"Maximum length of contract code"}}},byzantium:{name:"byzantium",comment:"Hardfork with new precompiles, instructions and other protocol changes",url:"https://eips.ethereum.org/EIPS/eip-609",status:Yy.Final,gasPrices:{modexpGquaddivisor:{v:20,d:"Gquaddivisor from modexp precompile for gas calculation"},ecAdd:{v:500,d:"Gas costs for curve addition precompile"},ecMul:{v:4e4,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:1e5,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:8e4,d:"Gas costs regarding curve pairing precompile input length"},revert:{v:0,d:"Base fee of the REVERT opcode"},staticcall:{v:700,d:"Base fee of the STATICCALL opcode"},returndatasize:{v:2,d:"Base fee of the RETURNDATASIZE opcode"},returndatacopy:{v:3,d:"Base fee of the RETURNDATACOPY opcode"}},pow:{minerReward:{v:BigInt("3000000000000000000"),d:"the amount a miner get rewarded for mining a block"},difficultyBombDelay:{v:3e6,d:"the amount of blocks to delay the difficulty bomb with"}}},constantinople:{name:"constantinople",comment:"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)",url:"https://eips.ethereum.org/EIPS/eip-1013",status:Yy.Final,gasPrices:{netSstoreNoopGas:{v:200,d:"Once per SSTORE operation if the value doesn't change"},netSstoreInitGas:{v:2e4,d:"Once per SSTORE operation from clean zero"},netSstoreCleanGas:{v:5e3,d:"Once per SSTORE operation from clean non-zero"},netSstoreDirtyGas:{v:200,d:"Once per SSTORE operation from dirty"},netSstoreClearRefund:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},netSstoreResetRefund:{v:4800,d:"Once per SSTORE operation for resetting to the original non-zero value"},netSstoreResetClearRefund:{v:19800,d:"Once per SSTORE operation for resetting to the original zero value"},shl:{v:3,d:"Base fee of the SHL opcode"},shr:{v:3,d:"Base fee of the SHR opcode"},sar:{v:3,d:"Base fee of the SAR opcode"},extcodehash:{v:400,d:"Base fee of the EXTCODEHASH opcode"},create2:{v:32e3,d:"Base fee of the CREATE2 opcode"}},pow:{minerReward:{v:BigInt("2000000000000000000"),d:"The amount a miner gets rewarded for mining a block"},difficultyBombDelay:{v:5e6,d:"the amount of blocks to delay the difficulty bomb with"}}},petersburg:{name:"petersburg",comment:"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople",url:"https://eips.ethereum.org/EIPS/eip-1716",status:Yy.Final,gasPrices:{netSstoreNoopGas:{v:null,d:"Removed along EIP-1283"},netSstoreInitGas:{v:null,d:"Removed along EIP-1283"},netSstoreCleanGas:{v:null,d:"Removed along EIP-1283"},netSstoreDirtyGas:{v:null,d:"Removed along EIP-1283"},netSstoreClearRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetRefund:{v:null,d:"Removed along EIP-1283"},netSstoreResetClearRefund:{v:null,d:"Removed along EIP-1283"}}},istanbul:{name:"istanbul",comment:"HF targeted for December 2019 following the Constantinople/Petersburg HF",url:"https://eips.ethereum.org/EIPS/eip-1679",status:Yy.Final,gasConfig:{},gasPrices:{blake2Round:{v:1,d:"Gas cost per round for the Blake2 F precompile"},ecAdd:{v:150,d:"Gas costs for curve addition precompile"},ecMul:{v:6e3,d:"Gas costs for curve multiplication precompile"},ecPairing:{v:45e3,d:"Base gas costs for curve pairing precompile"},ecPairingWord:{v:34e3,d:"Gas costs regarding curve pairing precompile input length"},txDataNonZero:{v:16,d:"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},sstoreSentryGasEIP2200:{v:2300,d:"Minimum gas required to be present for an SSTORE call, not consumed"},sstoreNoopGasEIP2200:{v:800,d:"Once per SSTORE operation if the value doesn't change"},sstoreDirtyGasEIP2200:{v:800,d:"Once per SSTORE operation if a dirty value is changed"},sstoreInitGasEIP2200:{v:2e4,d:"Once per SSTORE operation from clean zero to non-zero"},sstoreInitRefundEIP2200:{v:19200,d:"Once per SSTORE operation for resetting to the original zero value"},sstoreCleanGasEIP2200:{v:5e3,d:"Once per SSTORE operation from clean non-zero to something else"},sstoreCleanRefundEIP2200:{v:4200,d:"Once per SSTORE operation for resetting to the original non-zero value"},sstoreClearRefundEIP2200:{v:15e3,d:"Once per SSTORE operation for clearing an originally existing storage slot"},balance:{v:700,d:"Base fee of the BALANCE opcode"},extcodehash:{v:700,d:"Base fee of the EXTCODEHASH opcode"},chainid:{v:2,d:"Base fee of the CHAINID opcode"},selfbalance:{v:5,d:"Base fee of the SELFBALANCE opcode"},sload:{v:800,d:"Base fee of the SLOAD opcode"}}},muirGlacier:{name:"muirGlacier",comment:"HF to delay the difficulty bomb",url:"https://eips.ethereum.org/EIPS/eip-2384",status:Yy.Final,pow:{difficultyBombDelay:{v:9e6,d:"the amount of blocks to delay the difficulty bomb with"}}},berlin:{name:"berlin",comment:"HF targeted for July 2020 following the Muir Glacier HF",url:"https://eips.ethereum.org/EIPS/eip-2070",status:Yy.Final,eips:[2565,2929,2718,2930]},london:{name:"london",comment:"HF targeted for July 2021 following the Berlin fork",url:"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",status:Yy.Final,eips:[1559,3198,3529,3541]},arrowGlacier:{name:"arrowGlacier",comment:"HF to delay the difficulty bomb",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md",status:Yy.Final,eips:[4345]},grayGlacier:{name:"grayGlacier",comment:"Delaying the difficulty bomb to Mid September 2022",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md",status:Yy.Final,eips:[5133]},paris:{name:"paris",comment:"Hardfork to upgrade the consensus mechanism to Proof-of-Stake",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md",status:Yy.Final,consensus:{type:"pos",algorithm:"casper",casper:{}},eips:[3675,4399]},mergeForkIdTransition:{name:"mergeForkIdTransition",comment:"Pre-merge hardfork to fork off non-upgraded clients",url:"https://eips.ethereum.org/EIPS/eip-3675",status:Yy.Final,eips:[]},shanghai:{name:"shanghai",comment:"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md",status:Yy.Final,eips:[3651,3855,3860,4895]},cancun:{name:"cancun",comment:"Next feature hardfork after the shanghai having proto-danksharding EIP 4844 blobs (still WIP hence not for production use), transient storage opcodes, parent beacon block root availability in EVM and selfdestruct only in same transaction",url:"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md",status:Yy.Final,eips:[1153,4844,4788,5656,6780]}};class Xy{constructor(e){this._eips=[],this.events=new ed.EventEmitter,this._customChains=e.customChains??[],this._chainParams=this.setChain(e.chain),this.DEFAULT_HARDFORK=this._chainParams.defaultHardfork??zy.Shanghai,this.HARDFORK_CHANGES=this.hardforks().map((e=>[e.name,Qy[e.name]])),this._hardfork=this.DEFAULT_HARDFORK,void 0!==e.hardfork&&this.setHardfork(e.hardfork),e.eips&&this.setEIPs(e.eips)}static custom(e,t={}){const r=t.baseChain??"mainnet",n={...Xy._getChainParams(r)};if(n.name="custom-chain","string"!=typeof e)return new Xy({chain:{...n,...e},...t});if(e===qy.PolygonMainnet)return Xy.custom({name:qy.PolygonMainnet,chainId:137,networkId:137},t);if(e===qy.PolygonMumbai)return Xy.custom({name:qy.PolygonMumbai,chainId:80001,networkId:80001},t);if(e===qy.ArbitrumOne)return Xy.custom({name:qy.ArbitrumOne,chainId:42161,networkId:42161},t);if(e===qy.xDaiChain)return Xy.custom({name:qy.xDaiChain,chainId:100,networkId:100},t);if(e===qy.OptimisticKovan)return Xy.custom({name:qy.OptimisticKovan,chainId:69,networkId:69},{hardfork:zy.Berlin,...t});if(e===qy.OptimisticEthereum)return Xy.custom({name:qy.OptimisticEthereum,chainId:10,networkId:10},{hardfork:zy.Berlin,...t});throw new Error(`Custom chain ${e} not supported`)}static fromGethGenesis(e,{chain:t,eips:r,genesisHash:n,hardfork:i,mergeForkIdPostMerge:o}){const s=function(e,t,r){try{if(["config","difficulty","gasLimit","alloc"].some((t=>!(t in e))))throw new Error("Invalid format, expected geth genesis fields missing");return void 0!==t&&(e.name=t),function(e,t=!0){const{name:r,config:n,difficulty:i,mixHash:o,gasLimit:s,coinbase:a,baseFeePerGas:c,excessBlobGas:u}=e;let{extraData:l,timestamp:f,nonce:d}=e;const h=Number(f),{chainId:p}=n;if(""===l&&(l="0x"),uf(f)||(f=bf(parseInt(f))),18!==d.length&&(d=function(e){return e&&"0x0"!==e?uf(e)?"0x"+lf(e).padStart(16,"0"):"0x"+e.padStart(16,"0"):"0x0000000000000000"}(d)),n.eip155Block!==n.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const g={name:r,chainId:p,networkId:p,genesis:{timestamp:f,gasLimit:s,difficulty:i,nonce:d,extraData:l,mixHash:o,coinbase:a,baseFeePerGas:c,excessBlobGas:u},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:void 0!==n.clique?{type:"poa",algorithm:"clique",clique:{period:n.clique.period??n.clique.blockperiodseconds,epoch:n.clique.epoch??n.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},y={[zy.Homestead]:{name:"homesteadBlock"},[zy.Dao]:{name:"daoForkBlock"},[zy.TangerineWhistle]:{name:"eip150Block"},[zy.SpuriousDragon]:{name:"eip155Block"},[zy.Byzantium]:{name:"byzantiumBlock"},[zy.Constantinople]:{name:"constantinopleBlock"},[zy.Petersburg]:{name:"petersburgBlock"},[zy.Istanbul]:{name:"istanbulBlock"},[zy.MuirGlacier]:{name:"muirGlacierBlock"},[zy.Berlin]:{name:"berlinBlock"},[zy.London]:{name:"londonBlock"},[zy.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:t},[zy.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[zy.Cancun]:{name:"cancunTime",postMerge:!0,isTimestamp:!0}},m=Object.keys(y).reduce(((e,t)=>(e[y[t].name]=t,e)),{}),b=Object.keys(n).filter((e=>void 0!==m[e]&&void 0!==n[e]&&null!==n[e]));if(g.hardforks=b.map((e=>({name:m[e],block:!0===y[m[e]].isTimestamp||"number"!=typeof n[e]?null:n[e],timestamp:!0===y[m[e]].isTimestamp&&"number"==typeof n[e]?n[e]:void 0}))).filter((e=>null!==e.block||void 0!==e.timestamp)),g.hardforks.sort((function(e,t){return(e.block??1/0)-(t.block??1/0)})),g.hardforks.sort((function(e,t){return(e.timestamp??h)-(t.timestamp??h)})),void 0!==n.terminalTotalDifficulty){const e={name:zy.Paris,ttd:n.terminalTotalDifficulty,block:null},t=g.hardforks.findIndex((e=>!0===y[e.name]?.postMerge));-1!==t?g.hardforks.splice(t,0,e):g.hardforks.push(e)}const v=g.hardforks.length>0?g.hardforks.slice(-1)[0]:void 0;return g.hardfork=v?.name,g.hardforks.unshift({name:zy.Chainstart,block:0}),g}(e,r)}catch(e){throw new Error(`Error parsing parameters file: ${e.message}`)}}(e,t,o),a=new Xy({chain:s.name??"custom",customChains:[s],eips:r,hardfork:i??s.hardfork});return void 0!==n&&a.setForkHashes(n),a}static isSupportedChainId(e){const t=this.getInitializedChains();return Boolean(t.names[e.toString()])}static _getChainParams(e,t){const r=this.getInitializedChains(t);if("number"==typeof e||"bigint"==typeof e){if(e=e.toString(),r.names[e])return r[r.names[e]];throw new Error(`Chain with ID ${e} not supported`)}if(void 0!==r[e])return r[e];throw new Error(`Chain with name ${e} not supported`)}setChain(e){if("number"==typeof e||"bigint"==typeof e||"string"==typeof e)this._chainParams=Xy._getChainParams(e,this._customChains);else{if("object"!=typeof e)throw new Error("Wrong input format");{if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const t=["networkId","genesis","hardforks","bootstrapNodes"];for(const r of t)if(!(r in e))throw new Error(`Missing required chain parameter: ${r}`);this._chainParams=e}}for(const e of this.hardforks())if(void 0===e.block)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(e){let t=!1;for(const r of this.HARDFORK_CHANGES)r[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.events.emit("hardforkChanged",e)),t=!0);if(!t)throw new Error(`Hardfork with name ${e} not supported`)}getHardforkBy(e){let{blockNumber:t,timestamp:r,td:n}=e;t=Yf(t,Kf.BigInt),n=Yf(n,Kf.BigInt),r=Yf(r,Kf.BigInt);const i=this.hardforks().filter((e=>null!==e.block||null!==e.ttd&&void 0!==e.ttd||void 0!==e.timestamp)),o=i.findIndex((e=>null!==e.ttd&&void 0!==e.ttd));if(i.slice(o+1).findIndex((e=>null!==e.ttd&&void 0!==e.ttd))>=0)throw Error("More than one merge hardforks found with ttd specified");let s=i.findIndex((e=>void 0!==t&&null!==e.block&&BigInt(e.block)>t||void 0!==r&&void 0!==e.timestamp&&e.timestamp>r));if(-1===s)s=i.length;else if(0===s)throw Error("Must have at least one hardfork at block 0");if(void 0===r&&(s-=i.slice(0,s).reverse().findIndex((e=>null!==e.block||void 0!==e.ttd))),s-=1,null===i[s].block&&void 0===i[s].timestamp)(null==n||BigInt(i[s].ttd)>n)&&(s-=1);else if(o>=0&&null!=n){if(s>=o&&BigInt(i[o].ttd)>n)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(s<o&&BigInt(i[o].ttd)<=n)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const a=s;for(;s<i.length-1&&i[s].block===i[s+1].block&&i[s].timestamp===i[s+1].timestamp;s++);if(void 0!==r){if(i.slice(0,a).reduce(((e,t)=>Math.max(Number(t.timestamp??"0"),e)),0)>r)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(i.slice(s+1).reduce(((e,t)=>Math.min(Number(t.timestamp??r),e)),Number(r))<r)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return i[s].name}setHardforkBy(e){const t=this.getHardforkBy(e);return this.setHardfork(t),t}_getHardfork(e){const t=this.hardforks();for(const r of t)if(r.name===e)return r;return null}setEIPs(e=[]){for(const t of e){if(!(t in Jy))throw new Error(`${t} not supported`);const r=this.gteHardfork(Jy[t].minimumHardfork);if(!r)throw new Error(`${t} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${r}`);if(void 0!==Jy[t].requiredEIPs)for(const r of Jy[t].requiredEIPs)if(!e.includes(r)&&!this.isActivatedEIP(r))throw new Error(`${t} requires EIP ${r}, but is not included in the EIP list`)}this._eips=e}param(e,t){let r;for(const n of this._eips)if(r=this.paramByEIP(e,t,n),void 0!==r)return r;return this.paramByHardfork(e,t,this._hardfork)}paramByHardfork(e,t,r){let n=null;for(const i of this.HARDFORK_CHANGES){if("eips"in i[1]){const r=i[1].eips;for(const i of r){const r=this.paramByEIP(e,t,i);n="bigint"==typeof r?r:n}}else void 0!==i[1][e]&&void 0!==i[1][e][t]&&(n=i[1][e][t].v);if(i[0]===r)break}return BigInt(n??0)}paramByEIP(e,t,r){if(!(r in Jy))throw new Error(`${r} not supported`);const n=Jy[r];if(!(e in n))return;if(void 0===n[e][t])return;const i=n[e][t].v;return BigInt(i)}paramByBlock(e,t,r,n,i){const o=this.getHardforkBy({blockNumber:r,td:n,timestamp:i});return this.paramByHardfork(e,t,o)}isActivatedEIP(e){if(this.eips().includes(e))return!0;for(const t of this.HARDFORK_CHANGES){const r=t[1];if(this.gteHardfork(r.name)&&"eips"in r&&r.eips.includes(e))return!0}return!1}hardforkIsActiveOnBlock(e,t){t=Yf(t,Kf.BigInt),e=e??this._hardfork;const r=this.hardforkBlock(e);return"bigint"==typeof r&&r!==BigInt(0)&&t>=r}activeOnBlock(e){return this.hardforkIsActiveOnBlock(null,e)}hardforkGteHardfork(e,t){e=e??this._hardfork;const r=this.hardforks();let n=-1,i=-1,o=0;for(const s of r)s.name===e&&(n=o),s.name===t&&(i=o),o+=1;return n>=i&&-1!==i}gteHardfork(e){return this.hardforkGteHardfork(null,e)}hardforkBlock(e){e=e??this._hardfork;const t=this._getHardfork(e)?.block;return null==t?null:BigInt(t)}hardforkTimestamp(e){e=e??this._hardfork;const t=this._getHardfork(e)?.timestamp;return null==t?null:BigInt(t)}eipBlock(e){for(const t of this.HARDFORK_CHANGES){const r=t[1];if("eips"in r&&r.eips.includes(e))return this.hardforkBlock(t[0])}return null}hardforkTTD(e){e=e??this._hardfork;const t=this._getHardfork(e)?.ttd;return null==t?null:BigInt(t)}nextHardforkBlockOrTimestamp(e){e=e??this._hardfork;const t=this.hardforks();let r=t.findIndex((t=>t.name===e));if(e===zy.Paris&&(r-=1),r<0)return null;let n=t[r].timestamp??t[r].block;n=null!=n?Number(n):null;const i=t.slice(r+1).find((e=>{let t=e.timestamp??e.block;return t=null!=t?Number(t):null,e.name!==zy.Paris&&null!=t&&t!==n}));if(void 0===i)return null;const o=i.timestamp??i.block;return null==o?null:BigInt(o)}_calcForkHash(e,t){let r=new Uint8Array(0),n=0;for(const t of this.hardforks()){const{block:i,timestamp:o,name:s}=t;let a=o??i;if(a=null!==a?Number(a):null,"number"==typeof a&&0!==a&&a!==n&&s!==zy.Paris){const e=mf("0x"+a.toString(16).padStart(16,"0"));r=kf(r,e),n=a}if(t.name===e)break}const i=kf(t,r);return gf(vf(Dy(i)>>>0))}forkHash(e,t){e=e??this._hardfork;const r=this._getHardfork(e);if(null===r||null===r?.block&&void 0===r?.timestamp&&void 0===r?.ttd)throw new Error("No fork hash calculation possible for future hardfork");if(null!=r?.forkHash)return r.forkHash;if(!t)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(e,t)}hardforkForForkHash(e){const t=this.hardforks().filter((t=>t.forkHash===e));return t.length>=1?t[t.length-1]:null}setForkHashes(e){for(const t of this.hardforks()){const r=t.timestamp??t.block;null!==t.forkHash&&void 0!==t.forkHash||null==r&&void 0===t.ttd||(t.forkHash=this.forkHash(t.name,e))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const e=this.hardfork();let t;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(t=r[1].consensus.type),r[0]===e)break;return t??this._chainParams.consensus.type}consensusAlgorithm(){const e=this.hardfork();let t;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(t=r[1].consensus.algorithm),r[0]===e)break;return t??this._chainParams.consensus.algorithm}consensusConfig(){const e=this.hardfork();let t;for(const r of this.HARDFORK_CHANGES){if("consensus"in r[1]){const e=r[1],n=e.consensus.algorithm;t=e.consensus[n]}if(r[0]===e)break}return t??this._chainParams.consensus[this.consensusAlgorithm()]??{}}copy(){const e=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return e.events=new ed.EventEmitter,e}static getInitializedChains(e){const t={};for(const[e,r]of Object.entries(Gy))t[r]=e.toLowerCase();const r={...$y};if(e)for(const n of e){const{name:e}=n;t[n.chainId.toString()]=e,r[e]=n}return r.names=t,r}}function em(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function tm(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return om(function(e){let t="";for(let r=0;r<e.length;r++)t+=im[e[r]];return t}(e))}function rm(e,t){if(e<56)return Uint8Array.from([e+t]);const r=cm(e),n=cm(t+55+r.length/2);return Uint8Array.from(sm(n+r))}function nm(e){let t,r,n,i,o;const s=[],a=e[0];if(a<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(a<=183){if(t=a-127,n=128===a?Uint8Array.from([]):em(e,1,t),2===t&&n[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:n,remainder:e.slice(t)}}if(a<=191){if(r=a-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=tm(em(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return n=em(e,r,t+r),{data:n,remainder:e.slice(t+r)}}if(a<=247){for(t=a-191,i=em(e,1,t);i.length;)o=nm(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.slice(t)}}{if(r=a-246,t=tm(em(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const n=r+t;if(n>e.length)throw new Error("invalid RLP: total length is larger than the data");for(i=em(e,r,n);i.length;)o=nm(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.slice(n)}}}const im=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function om(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function sm(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r;t[r]=om(e.slice(n,n+2))}return t}function am(...e){if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}function cm(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function um(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function lm(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return um(e)?sm((r="string"!=typeof(n=e)?n:um(n)?n.slice(2):n).length%2?`0${r}`:r):(t=e,(new TextEncoder).encode(t));var t,r,n;if("number"==typeof e||"bigint"==typeof e)return e?sm(cm(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}const fm=function e(t){if(Array.isArray(t)){const r=[];let n=0;for(let i=0;i<t.length;i++){const o=e(t[i]);r.push(o),n+=o.length}return am(rm(n,192),...r)}const r=lm(t);return 1===r.length&&r[0]<128?r:am(rm(r.length,128),r)},dm=function(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);const r=nm(lm(e));if(t)return r;if(0!==r.remainder.length)throw new Error("invalid RLP: remainder must be zero");return r.data};var hm,pm;!function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"}(hm||(hm={})),function(e){e[e.Legacy=0]="Legacy",e[e.AccessListEIP2930=1]="AccessListEIP2930",e[e.FeeMarketEIP1559=2]="FeeMarketEIP1559",e[e.BlobEIP4844=3]="BlobEIP4844"}(pm||(pm={}));class gm{static getAccessListData(e){let t,r;if(function(e){if(0===e.length)return!0;const t=e[0];return!!Array.isArray(t)}(e)){r=e??[];const n=[];for(let e=0;e<r.length;e++){const t=r[e],i=gf(t[0]),o=[];for(let e=0;e<t[1].length;e++)o.push(gf(t[1][e]));const s={address:i,storageKeys:o};n.push(s)}t=n}else{t=e;const n=[];for(let t=0;t<e.length;t++){const r=e[t],i=mf(r.address),o=[];for(let e=0;e<r.storageKeys.length;e++)o.push(mf(r.storageKeys[e]));n.push([i,o])}r=n}return{AccessListJSON:t,accessList:r}}static verifyAccessList(e){for(let t=0;t<e.length;t++){const r=e[t],n=r[0],i=r[1];if(void 0!==r[2])throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(20!==n.length)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let e=0;e<i.length;e++)if(32!==i[e].length)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}}static getAccessListJSON(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r],i={address:gf(Ef(n[0],20)),storageKeys:[]},o=n[1];for(let e=0;e<o.length;e++){const t=o[e];i.storageKeys.push(gf(Ef(t,32)))}t.push(i)}return t}static getDataFeeEIP2930(e,t){const r=t.param("gasPrices","accessListStorageKeyCost"),n=t.param("gasPrices","accessListAddressCost");let i=0;for(let t=0;t<e.length;t++)i+=e[t][1].length;return e.length*Number(n)+i*Number(r)}}class ym{constructor(e,t){this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=Gy.Mainnet;const{nonce:r,gasLimit:n,to:i,value:o,data:s,v:a,r:c,s:u,type:l}=e;this._type=Number(yf(Sf(l))),this.txOptions=t;const f=Sf(""===i?"0x":i),d=Sf(""===a?"0x":a),h=Sf(""===c?"0x":c),p=Sf(""===u?"0x":u);this.nonce=yf(Sf(""===r?"0x":r)),this.gasLimit=yf(Sf(""===n?"0x":n)),this.to=f.length>0?new Vf(f):void 0,this.value=yf(Sf(""===o?"0x":o)),this.data=Sf(""===s?"0x":s),this.v=d.length>0?yf(d):void 0,this.r=h.length>0?yf(h):void 0,this.s=p.length>0?yf(p):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);const g=void 0===this.to||null===this.to,y=t.allowUnlimitedInitCodeSize??!1,m=t.common??this._getCommon();g&&m.isActivatedEIP(3860)&&!1===y&&function(e,t){const r=e.param("vm","maxInitCodeSize");if(r&&BigInt(t)>r)throw new Error(`the initcode size of this transaction is too large: it is ${t} while the max is ${e.param("vm","maxInitCodeSize")}`)}(m,this.data.length)}get type(){return this._type}supports(e){return this.activeCapabilities.includes(e)}getValidationErrors(){const e=[];return this.isSigned()&&!this.verifySignature()&&e.push("Invalid Signature"),this.getBaseFee()>this.gasLimit&&e.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),e}isValid(){return 0===this.getValidationErrors().length}_validateYParity(){const{v:e}=this;if(void 0!==e&&e!==BigInt(0)&&e!==BigInt(1)){const e=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(e)}}_validateHighS(){const{s:e}=this;if(this.common.gteHardfork("homestead")&&void 0!==e&&e>Nf){const e=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(e)}}getBaseFee(){const e=this.common.param("gasPrices","tx");let t=this.getDataFee();if(e&&(t+=e),this.common.gteHardfork("homestead")&&this.toCreationAddress()){const e=this.common.param("gasPrices","txCreation");e&&(t+=e)}return t}getDataFee(){const e=this.common.param("gasPrices","txDataZero"),t=this.common.param("gasPrices","txDataNonZero");let r=BigInt(0);for(let n=0;n<this.data.length;n++)0===this.data[n]?r+=e:r+=t;if((void 0===this.to||null===this.to)&&this.common.isActivatedEIP(3860)){const e=BigInt(Math.ceil(this.data.length/32));r+=this.common.param("gasPrices","initCodeWordCost")*e}return r}toCreationAddress(){return void 0===this.to||0===this.to.bytes.length}isSigned(){const{v:e,r:t,s:r}=this;return void 0!==e&&void 0!==t&&void 0!==r}verifySignature(){try{const e=this.getSenderPublicKey();return 0!==_f(e).length}catch(e){return!1}}getSenderAddress(){return new Vf(zf(this.getSenderPublicKey()))}sign(e){if(32!==e.length){const e=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(e)}let t=!1;this.type===pm.Legacy&&this.common.gteHardfork("spuriousDragon")&&!this.supports(hm.EIP155ReplayProtection)&&(this.activeCapabilities.push(hm.EIP155ReplayProtection),t=!0);const r=this.getHashedMessageToSign(),{v:n,r:i,s:o}=Qf(r,e),s=this._processSignature(n,i,o);if(t){const e=this.activeCapabilities.indexOf(hm.EIP155ReplayProtection);e>-1&&this.activeCapabilities.splice(e,1)}return s}toJSON(){return{type:Pf(BigInt(this.type)),nonce:Pf(this.nonce),gasLimit:Pf(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:Pf(this.value),data:gf(this.data),v:void 0!==this.v?Pf(this.v):void 0,r:void 0!==this.r?Pf(this.r):void 0,s:void 0!==this.s?Pf(this.s):void 0}}_getCommon(e,t){if(void 0!==t){const r=yf(Sf(t));if(e){if(e.chainId()!==r){const e=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(e)}return e.copy()}return Xy.isSupportedChainId(r)?new Xy({chain:r}):Xy.custom({name:"custom-chain",networkId:r,chainId:r},{baseChain:this.DEFAULT_CHAIN})}return e?.copy()??new Xy({chain:this.DEFAULT_CHAIN})}_validateCannotExceedMaxInteger(e,t=256,r=!1){for(const[n,i]of Object.entries(e))switch(t){case 64:if(r){if(void 0!==i&&i>=Of){const e=this._errorMsg(`${n} cannot equal or exceed MAX_UINT64 (2^64-1), given ${i}`);throw new Error(e)}}else if(void 0!==i&&i>Of){const e=this._errorMsg(`${n} cannot exceed MAX_UINT64 (2^64-1), given ${i}`);throw new Error(e)}break;case 256:if(r){if(void 0!==i&&i>=Cf){const e=this._errorMsg(`${n} cannot equal or exceed MAX_INTEGER (2^256-1), given ${i}`);throw new Error(e)}}else if(void 0!==i&&i>Cf){const e=this._errorMsg(`${n} cannot exceed MAX_INTEGER (2^256-1), given ${i}`);throw new Error(e)}break;default:{const e=this._errorMsg("unimplemented bits value");throw new Error(e)}}}static _validateNotArray(e){const t=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(const[r,n]of Object.entries(e))if(t.includes(r)&&Array.isArray(n))throw new Error(`${r} cannot be an array`)}_getSharedErrorPostfix(){let e="";try{e=this.isSigned()?gf(this.hash()):"not available (unsigned)"}catch(t){e="error"}let t="";try{t=this.isSigned().toString()}catch(t){e="error"}let r="";try{r=this.common.hardfork()}catch(e){r="error"}let n=`tx type=${this.type} hash=${e} nonce=${this.nonce} value=${this.value} `;return n+=`signed=${t} hf=${r}`,n}}const mm=mf("0x"+pm.FeeMarketEIP1559.toString(16).padStart(2,"0"));class bm extends ym{constructor(e,t={}){super({...e,type:pm.FeeMarketEIP1559},t);const{chainId:r,accessList:n,maxFeePerGas:i,maxPriorityFeePerGas:o}=e;if(this.common=this._getCommon(t.common,r),this.chainId=this.common.chainId(),!1===this.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const s=gm.getAccessListData(n??[]);if(this.accessList=s.accessList,this.AccessListJSON=s.AccessListJSON,gm.verifyAccessList(this.accessList),this.maxFeePerGas=yf(Sf(""===i?"0x":i)),this.maxPriorityFeePerGas=yf(Sf(""===o?"0x":o)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),ym._validateNotArray(e),this.gasLimit*this.maxFeePerGas>Cf){const e=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(e)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const e=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(e)}this._validateYParity(),this._validateHighS(),(t?.freeze??1)&&Object.freeze(this)}static fromTxData(e,t={}){return new bm(e,t)}static fromSerializedTx(e,t={}){if(!1===(0,cf.hD)(e.subarray(0,1),mm))throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ${pm.FeeMarketEIP1559}, received: ${gf(e.subarray(0,1))}`);const r=dm(e.subarray(1));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return bm.fromValuesArray(r,t)}static fromValuesArray(e,t={}){if(9!==e.length&&12!==e.length)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");const[r,n,i,o,s,a,c,u,l,f,d,h]=e;return this._validateNotArray({chainId:r,v:f}),Tf({nonce:n,maxPriorityFeePerGas:i,maxFeePerGas:o,gasLimit:s,value:c,v:f,r:d,s:h}),new bm({chainId:yf(r),nonce:n,maxPriorityFeePerGas:i,maxFeePerGas:o,gasLimit:s,to:a,value:c,data:u,accessList:l??[],v:void 0!==f?yf(f):void 0,r:d,s:h},t)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let e=super.getDataFee();return e+=BigInt(gm.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:e,hardfork:this.common.hardfork()}),e}getUpfrontCost(e=BigInt(0)){const t=this.maxPriorityFeePerGas,r=this.maxFeePerGas-e,n=(t<r?t:r)+e;return this.gasLimit*n+this.value}raw(){return[If(this.chainId),If(this.nonce),If(this.maxPriorityFeePerGas),If(this.maxFeePerGas),If(this.gasLimit),void 0!==this.to?this.to.bytes:new Uint8Array(0),If(this.value),this.data,this.accessList,void 0!==this.v?If(this.v):new Uint8Array(0),void 0!==this.r?If(this.r):new Uint8Array(0),void 0!==this.s?If(this.s):new Uint8Array(0)]}serialize(){const e=this.raw();return kf(mm,fm(e))}getMessageToSign(){const e=this.raw().slice(0,9);return kf(mm,fm(e))}getHashedMessageToSign(){return(0,Zf.wn)(this.getMessageToSign())}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,Zf.wn)(this.serialize())),this.cache.hash):(0,Zf.wn)(this.serialize())}getMessageToVerifySignature(){return this.getHashedMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const e=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(e)}const e=this.getMessageToVerifySignature(),{v:t,r,s:n}=this;this._validateHighS();try{return Xf(e,t+BigInt(27),If(r),If(n))}catch(e){const t=this._errorMsg("Invalid Signature");throw new Error(t)}}_processSignature(e,t,r){const n={...this.txOptions,common:this.common};return bm.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:e-BigInt(27),r:yf(t),s:yf(r)},n)}toJSON(){const e=gm.getAccessListJSON(this.accessList);return{...super.toJSON(),chainId:Pf(this.chainId),maxPriorityFeePerGas:Pf(this.maxPriorityFeePerGas),maxFeePerGas:Pf(this.maxFeePerGas),accessList:e}}errorStr(){let e=this._getSharedErrorPostfix();return e+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}}const vm=mf("0x"+pm.AccessListEIP2930.toString(16).padStart(2,"0"));class wm extends ym{constructor(e,t={}){super({...e,type:pm.AccessListEIP2930},t);const{chainId:r,accessList:n,gasPrice:i}=e;if(this.common=this._getCommon(t.common,r),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);const o=gm.getAccessListData(n??[]);if(this.accessList=o.accessList,this.AccessListJSON=o.AccessListJSON,gm.verifyAccessList(this.accessList),this.gasPrice=yf(Sf(""===i?"0x":i)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),ym._validateNotArray(e),this.gasPrice*this.gasLimit>Cf){const e=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(e)}this._validateYParity(),this._validateHighS(),(t?.freeze??1)&&Object.freeze(this)}static fromTxData(e,t={}){return new wm(e,t)}static fromSerializedTx(e,t={}){if(!1===(0,cf.hD)(e.subarray(0,1),vm))throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ${pm.AccessListEIP2930}, received: ${gf(e.subarray(0,1))}`);const r=dm(Uint8Array.from(e.subarray(1)));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return wm.fromValuesArray(r,t)}static fromValuesArray(e,t={}){if(8!==e.length&&11!==e.length)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");const[r,n,i,o,s,a,c,u,l,f,d]=e;return this._validateNotArray({chainId:r,v:l}),Tf({nonce:n,gasPrice:i,gasLimit:o,value:a,v:l,r:f,s:d}),new wm({chainId:yf(r),nonce:n,gasPrice:i,gasLimit:o,to:s,value:a,data:c,accessList:u??[],v:void 0!==l?yf(l):void 0,r:f,s:d},t)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let e=super.getDataFee();return e+=BigInt(gm.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:e,hardfork:this.common.hardfork()}),e}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[If(this.chainId),If(this.nonce),If(this.gasPrice),If(this.gasLimit),void 0!==this.to?this.to.bytes:new Uint8Array(0),If(this.value),this.data,this.accessList,void 0!==this.v?If(this.v):new Uint8Array(0),void 0!==this.r?If(this.r):new Uint8Array(0),void 0!==this.s?If(this.s):new Uint8Array(0)]}serialize(){const e=this.raw();return kf(vm,fm(e))}getMessageToSign(){const e=this.raw().slice(0,8);return kf(vm,fm(e))}getHashedMessageToSign(){return(0,Zf.wn)(this.getMessageToSign())}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,Zf.wn)(this.serialize())),this.cache.hash):(0,Zf.wn)(this.serialize())}getMessageToVerifySignature(){return this.getHashedMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const e=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(e)}const e=this.getMessageToVerifySignature(),{v:t,r,s:n}=this;this._validateHighS();try{return Xf(e,t+BigInt(27),If(r),If(n))}catch(e){const t=this._errorMsg("Invalid Signature");throw new Error(t)}}_processSignature(e,t,r){const n={...this.txOptions,common:this.common};return wm.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:e-BigInt(27),r:yf(t),s:yf(r)},n)}toJSON(){const e=gm.getAccessListJSON(this.accessList);return{...super.toJSON(),chainId:Pf(this.chainId),gasPrice:Pf(this.gasPrice),accessList:e}}errorStr(){let e=this._getSharedErrorPostfix();return e+=` gasPrice=${this.gasPrice} accessListCount=${this.accessList?.length??0}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}}const Am=mf("0x"+pm.BlobEIP4844.toString(16).padStart(2,"0"));class Em extends ym{constructor(e,t={}){super({...e,type:pm.BlobEIP4844},t);const{chainId:r,accessList:n,maxFeePerGas:i,maxPriorityFeePerGas:o,maxFeePerBlobGas:s}=e;if(this.common=this._getCommon(t.common,r),this.chainId=this.common.chainId(),!1===this.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");if(!1===this.common.isActivatedEIP(4844))throw new Error("EIP-4844 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const a=gm.getAccessListData(n??[]);if(this.accessList=a.accessList,this.AccessListJSON=a.AccessListJSON,gm.verifyAccessList(this.accessList),this.maxFeePerGas=yf(Sf(""===i?"0x":i)),this.maxPriorityFeePerGas=yf(Sf(""===o?"0x":o)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),ym._validateNotArray(e),this.gasLimit*this.maxFeePerGas>Cf){const e=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(e)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const e=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(e)}this.maxFeePerBlobGas=yf(Sf(""===(s??"")?"0x":s)),this.versionedHashes=(e.versionedHashes??[]).map((e=>Sf(e))),this._validateYParity(),this._validateHighS();for(const e of this.versionedHashes){if(32!==e.length){const e=this._errorMsg("versioned hash is invalid length");throw new Error(e)}if(BigInt(e[0])!==this.common.paramByEIP("sharding","blobCommitmentVersionKzg",4844)){const e=this._errorMsg("versioned hash does not start with KZG commitment version");throw new Error(e)}}if(this.versionedHashes.length>16777216){const e=this._errorMsg("tx can contain at most 16777216 blobs");throw new Error(e)}this.blobs=e.blobs?.map((e=>Sf(e))),this.kzgCommitments=e.kzgCommitments?.map((e=>Sf(e))),this.kzgProofs=e.kzgProofs?.map((e=>Sf(e))),(t?.freeze??1)&&Object.freeze(this)}static fromTxData(e,t){if(void 0!==e.blobsData){if(void 0!==e.blobs)throw new Error("cannot have both raw blobs data and encoded blobs in constructor");if(void 0!==e.kzgCommitments)throw new Error("cannot have both raw blobs data and KZG commitments in constructor");if(void 0!==e.versionedHashes)throw new Error("cannot have both raw blobs data and versioned hashes in constructor");if(void 0!==e.kzgProofs)throw new Error("cannot have both raw blobs data and KZG proofs in constructor");e.blobs=(e=>{const t=(0,cf.iY)(e),r=t.byteLength;if(0===r)throw Error("invalid blob data");if(r>262143)throw Error("blob data is too large");const n=Math.ceil(r/id),i=function(e,t){const r=new Uint8Array(t*id).fill(0);return r.set(e),r[e.byteLength]=128,r}(t,n),o=[];for(let e=0;e<n;e++){const t=od(i.subarray(e*id,(e+1)*id));o.push(t)}return o})(e.blobsData.reduce(((e,t)=>e+t))),e.kzgCommitments=(e=>{const t=[];for(const r of e)t.push(nd.blobToKzgCommitment(r));return t})(e.blobs),e.versionedHashes=(e=>{const t=[];for(const r of e)t.push(sd(r,1));return t})(e.kzgCommitments),e.kzgProofs=(r=e.blobs,n=e.kzgCommitments,r.map(((e,t)=>nd.computeBlobKzgProof(e,n[t]))))}var r,n;return new Em(e,t)}static minimalFromNetworkWrapper(e,t){return Em.fromTxData({...e,blobs:void 0,kzgCommitments:void 0,kzgProofs:void 0},t)}static fromSerializedTx(e,t={}){if(!1===(0,cf.hD)(e.subarray(0,1),Am))throw new Error(`Invalid serialized tx input: not an EIP-4844 transaction (wrong tx type, expected: ${pm.BlobEIP4844}, received: ${gf(e.subarray(0,1))}`);const r=dm(e.subarray(1));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return Em.fromValuesArray(r,t)}static fromValuesArray(e,t={}){if(11!==e.length&&14!==e.length)throw new Error("Invalid EIP-4844 transaction. Only expecting 11 values (for unsigned tx) or 14 values (for signed tx).");const[r,n,i,o,s,a,c,u,l,f,d,h,p,g]=e;return this._validateNotArray({chainId:r,v:h}),Tf({nonce:n,maxPriorityFeePerGas:i,maxFeePerGas:o,gasLimit:s,value:c,maxFeePerBlobGas:f,v:h,r:p,s:g}),new Em({chainId:yf(r),nonce:n,maxPriorityFeePerGas:i,maxFeePerGas:o,gasLimit:s,to:a,value:c,data:u,accessList:l??[],maxFeePerBlobGas:f,versionedHashes:d,v:void 0!==h?yf(h):void 0,r:p,s:g},t)}static fromSerializedBlobTxNetworkWrapper(e,t){if(!t||!t.common)throw new Error("common instance required to validate versioned hashes");if(!1===(0,cf.hD)(e.subarray(0,1),Am))throw new Error(`Invalid serialized tx input: not an EIP-4844 transaction (wrong tx type, expected: ${pm.BlobEIP4844}, received: ${gf(e.subarray(0,1))}`);const r=dm(e.subarray(1));if(4!==r.length)throw Error("Expected 4 values in the deserialized network transaction");const[n,i,o,s]=r,a=Em.fromValuesArray(n,{...t,freeze:!1});if(void 0===a.to)throw Error("BlobEIP4844Transaction can not be send without a valid `to`");const c=Number(t.common.paramByEIP("sharding","blobCommitmentVersionKzg",4844));return((e,t,r,n,i)=>{if(e.length!==t.length||t.length!==r.length)throw new Error("Number of versionedHashes, blobs, and commitments not all equal");if(0===e.length)throw new Error("Invalid transaction with empty blobs");let o;try{o=nd.verifyBlobKzgProofBatch(t,r,n)}catch(e){throw new Error(`KZG verification of blobs fail with error=${e}`)}if(!o)throw new Error("KZG proof cannot be verified from blobs/commitments");for(let t=0;t<e.length;t++){const n=sd(r[t],i);if(!(0,cf.hD)(n,e[t]))throw new Error(`commitment for blob at index ${t} does not match versionedHash`)}})(a.versionedHashes,i,o,s,c),a.blobs=i,a.kzgCommitments=o,a.kzgProofs=s,(t?.freeze??!0)&&Object.freeze(a),a}getUpfrontCost(e=BigInt(0)){const t=this.maxPriorityFeePerGas,r=this.maxFeePerGas-e,n=(t<r?t:r)+e;return this.gasLimit*n+this.value}raw(){return[If(this.chainId),If(this.nonce),If(this.maxPriorityFeePerGas),If(this.maxFeePerGas),If(this.gasLimit),void 0!==this.to?this.to.bytes:new Uint8Array(0),If(this.value),this.data,this.accessList,If(this.maxFeePerBlobGas),this.versionedHashes,void 0!==this.v?If(this.v):new Uint8Array(0),void 0!==this.r?If(this.r):new Uint8Array(0),void 0!==this.s?If(this.s):new Uint8Array(0)]}serialize(){const e=this.raw();return kf(Am,fm(e))}serializeNetworkWrapper(){if(void 0===this.blobs||void 0===this.kzgCommitments||void 0===this.kzgProofs)throw new Error("cannot serialize network wrapper without blobs, KZG commitments and KZG proofs provided");const e=this.raw();return kf(Am,fm([e,this.blobs,this.kzgCommitments,this.kzgProofs]))}getMessageToSign(){const e=this.raw().slice(0,11);return kf(Am,fm(e))}getHashedMessageToSign(){return(0,Zf.wn)(this.getMessageToSign())}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,Zf.wn)(this.serialize())),this.cache.hash):(0,Zf.wn)(this.serialize())}getMessageToVerifySignature(){return this.getHashedMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const e=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(e)}const e=this.getMessageToVerifySignature(),{v:t,r,s:n}=this;this._validateHighS();try{return Xf(e,t+BigInt(27),If(r),If(n))}catch(e){const t=this._errorMsg("Invalid Signature");throw new Error(t)}}toJSON(){const e=gm.getAccessListJSON(this.accessList);return{...super.toJSON(),chainId:Pf(this.chainId),maxPriorityFeePerGas:Pf(this.maxPriorityFeePerGas),maxFeePerGas:Pf(this.maxFeePerGas),accessList:e,maxFeePerBlobGas:Pf(this.maxFeePerBlobGas),versionedHashes:this.versionedHashes.map((e=>gf(e)))}}_processSignature(e,t,r){const n={...this.txOptions,common:this.common};return Em.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:e-BigInt(27),r:yf(t),s:yf(r),maxFeePerBlobGas:this.maxFeePerBlobGas,versionedHashes:this.versionedHashes,blobs:this.blobs,kzgCommitments:this.kzgCommitments,kzgProofs:this.kzgProofs},n)}errorStr(){let e=this._getSharedErrorPostfix();return e+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}numBlobs(){return this.versionedHashes.length}}function _m(e,t){const r=Number(e),n=2*Number(t);return r===n+35||r===n+36}class Sm extends ym{constructor(e,t={}){if(super({...e,type:pm.Legacy},t),this.common=this._validateTxV(this.v,t.common),this.gasPrice=yf(Sf(""===e.gasPrice?"0x":e.gasPrice)),this.gasPrice*this.gasLimit>Cf){const e=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(e)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),ym._validateNotArray(e),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?_m(this.v,this.common.chainId())&&this.activeCapabilities.push(hm.EIP155ReplayProtection):this.activeCapabilities.push(hm.EIP155ReplayProtection)),(t?.freeze??1)&&Object.freeze(this)}static fromTxData(e,t={}){return new Sm(e,t)}static fromSerializedTx(e,t={}){const r=dm(e);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,t)}static fromValuesArray(e,t={}){if(6!==e.length&&9!==e.length)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");const[r,n,i,o,s,a,c,u,l]=e;return Tf({nonce:r,gasPrice:n,gasLimit:i,value:s,v:c,r:u,s:l}),new Sm({nonce:r,gasPrice:n,gasLimit:i,to:o,value:s,data:a,v:c,r:u,s:l},t)}raw(){return[If(this.nonce),If(this.gasPrice),If(this.gasLimit),void 0!==this.to?this.to.bytes:new Uint8Array(0),If(this.value),this.data,void 0!==this.v?If(this.v):new Uint8Array(0),void 0!==this.r?If(this.r):new Uint8Array(0),void 0!==this.s?If(this.s):new Uint8Array(0)]}serialize(){return fm(this.raw())}getMessageToSign(){const e=[If(this.nonce),If(this.gasPrice),If(this.gasLimit),void 0!==this.to?this.to.bytes:new Uint8Array(0),If(this.value),this.data];return this.supports(hm.EIP155ReplayProtection)&&(e.push(If(this.common.chainId())),e.push(_f(Sf(0))),e.push(_f(Sf(0)))),e}getHashedMessageToSign(){const e=this.getMessageToSign();return(0,Zf.wn)(fm(e))}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned()){const e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,Zf.wn)(fm(this.raw()))),this.cache.hash):(0,Zf.wn)(fm(this.raw()))}getMessageToVerifySignature(){if(!this.isSigned()){const e=this._errorMsg("This transaction is not signed");throw new Error(e)}return this.getHashedMessageToSign()}getSenderPublicKey(){const e=this.getMessageToVerifySignature(),{v:t,r,s:n}=this;this._validateHighS();try{return Xf(e,t,If(r),If(n),this.supports(hm.EIP155ReplayProtection)?this.common.chainId():void 0)}catch(e){const t=this._errorMsg("Invalid Signature");throw new Error(t)}}_processSignature(e,t,r){this.supports(hm.EIP155ReplayProtection)&&(e+=this.common.chainId()*BigInt(2)+BigInt(8));const n={...this.txOptions,common:this.common};return Sm.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:e,r:yf(t),s:yf(r)},n)}toJSON(){return{...super.toJSON(),gasPrice:Pf(this.gasPrice)}}_validateTxV(e,t){let r;const n=void 0!==e?Number(e):void 0;if(void 0!==n&&n<37&&27!==n&&28!==n)throw new Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${n}`);if(void 0!==n&&0!==n&&(!t||t.gteHardfork("spuriousDragon"))&&27!==n&&28!==n)if(t){if(!_m(BigInt(n),t.chainId()))throw new Error(`Incompatible EIP155-based V ${n} and chain id ${t.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let e;e=(n-35)%2==0?35:36,r=BigInt(n-e)/BigInt(2)}return this._getCommon(t,r)}errorStr(){let e=this._getSharedErrorPostfix();return e+=` gasPrice=${this.gasPrice}`,e}_errorMsg(e){return`${e} (${this.errorStr()})`}}class xm{constructor(){}static fromTxData(e,t={}){if("type"in e&&void 0!==e.type){if(function(e){return Number(yf(Sf(e.type)))===pm.Legacy}(e))return Sm.fromTxData(e,t);if(function(e){return Number(yf(Sf(e.type)))===pm.AccessListEIP2930}(e))return wm.fromTxData(e,t);if(function(e){return Number(yf(Sf(e.type)))===pm.FeeMarketEIP1559}(e))return bm.fromTxData(e,t);if(function(e){return Number(yf(Sf(e.type)))===pm.BlobEIP4844}(e))return Em.fromTxData(e,t);throw new Error(`Tx instantiation with type ${e?.type} not supported`)}return Sm.fromTxData(e,t)}static fromSerializedData(e,t={}){if(!(e[0]<=127))return Sm.fromSerializedTx(e,t);switch(e[0]){case pm.AccessListEIP2930:return wm.fromSerializedTx(e,t);case pm.FeeMarketEIP1559:return bm.fromSerializedTx(e,t);case pm.BlobEIP4844:return Em.fromSerializedTx(e,t);default:throw new Error(`TypedTransaction with ID ${e[0]} unknown`)}}static fromBlockBodyData(e,t={}){if(e instanceof Uint8Array)return this.fromSerializedData(e,t);if(Array.isArray(e))return Sm.fromValuesArray(e,t);throw new Error("Cannot decode transaction: unknown type input")}static async fromJsonRpcProvider(e,t,r){const n=(e=>{if("string"==typeof e)return e;if("object"==typeof e&&void 0!==e._getConnection)return e._getConnection().url;throw new Error("Must provide valid provider URL or Web3Provider")})(e),i=await(async(e,t)=>{const r=JSON.stringify({method:t.method,params:t.params,jsonrpc:"2.0",id:1}),n=await fetch(e,{headers:{"content-type":"application/json"},method:"POST",body:r});return(await n.json()).result})(n,{method:"eth_getTransactionByHash",params:[t]});if(null===i)throw new Error("No data returned from provider");return xm.fromRPC(i,r)}static async fromRPC(e,t={}){return xm.fromTxData((e=>{const t=Object.assign({},e);return t.gasLimit=Yf(t.gasLimit??t.gas,Kf.BigInt),t.data=void 0===t.data?t.input:t.data,t.gasPrice=void 0!==t.gasPrice?BigInt(t.gasPrice):void 0,t.value=void 0!==t.value?BigInt(t.value):void 0,t.to=null!==t.to&&void 0!==t.to?Ef(Sf(t.to),20):null,t.v="0x0"===t.v?"0x":t.v,t.r="0x0"===t.r?"0x":t.r,t.s="0x0"===t.s?"0x":t.s,"0x"===t.v&&"0x"===t.r&&"0x"===t.s||(t.v=Yf(t.v,Kf.BigInt)),t})(e),t)}}class Tm{constructor(e,t){(0,s.Z)(this,"provider",void 0),(0,s.Z)(this,"blockTracker",void 0),this.provider=e,this.blockTracker=t}async analyzeGasUsage(e){const t=await this.blockTracker.getLatestBlock(),r=new zd.BN(lf(t.gasLimit),16).mul(new zd.BN(19)).div(new zd.BN(20));let n,i=xf(r.toString("hex"));try{i=await this.estimateTxGas(e)}catch(e){au().warn(e),n={reason:e.message,errorKey:e.errorKey,debug:{blockNumber:t.idempotencyKey,blockGasLimit:t.gasLimit}}}return{blockGasLimit:t.gasLimit,estimatedGasHex:i,simulationFails:n}}addGasBuffer(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1.5;const n=new zd.BN(lf(e),16),i=new zd.BN(lf(t),16).muln(.9),o=n.muln(r);return n.gt(i)?xf(n.toString("hex")):o.lt(i)?xf(o.toString("hex")):xf(i.toString("hex"))}async estimateTxGas(e){const t=(0,Gd.Z)(e.transaction);return delete t.gasPrice,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,this.provider.request({method:"eth_estimateGas",params:[t]})}}var Pm,Im=i(7154),km=i(8819),Om=i(9164),Cm=i(2424),Nm=i(4006),Rm=(Pm=function(e,t){return Pm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},Pm(e,t)},function(e,t){function r(){this.constructor=e}Pm(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Bm=Object.prototype.hasOwnProperty;function Mm(e,t){return Bm.call(e,t)}function Lm(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var i in e)Mm(e,i)&&n.push(i);return n}function Fm(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function jm(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0}function Um(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Dm(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Zm(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Zm(e[t]))return!0}else if("object"==typeof e)for(var n=Lm(e),i=n.length,o=0;o<i;o++)if(Zm(e[n[o]]))return!0;return!1}function Hm(e,t){var r=[e];for(var n in t){var i="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==i&&r.push(n+": "+i)}return r.join("\n")}var $m=function(e){function t(t,r,n,i,o){var s=this.constructor,a=e.call(this,Hm(t,{name:r,index:n,operation:i,tree:o}))||this;return a.name=r,a.index=n,a.operation=i,a.tree=o,Object.setPrototypeOf(a,s.prototype),a.message=Hm(t,{name:r,index:n,operation:i,tree:o}),a}return Rm(t,e),t}(Error),Gm=$m,zm=Fm,Vm={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=qm(r,this.path);n&&(n=Fm(n));var i=Km(r,{op:"remove",path:this.from}).removed;return Km(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=qm(r,this.from);return Km(r,{op:"add",path:this.path,value:Fm(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:eb(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},Wm={add:function(e,t,r){return jm(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:Vm.move,copy:Vm.copy,test:Vm.test,_get:Vm._get};function qm(e,t){if(""==t)return e;var r={op:"_get",path:t};return Km(e,r),r.value}function Km(e,t,r,n,i,o){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=0),r&&("function"==typeof r?r(t,0,e,t.path):Qm(t,0)),""===t.path){var s={newDocument:e};if("add"===t.op)return s.newDocument=t.value,s;if("replace"===t.op)return s.newDocument=t.value,s.removed=e,s;if("move"===t.op||"copy"===t.op)return s.newDocument=qm(e,t.from),"move"===t.op&&(s.removed=e),s;if("test"===t.op){if(s.test=eb(e,t.value),!1===s.test)throw new Gm("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s.newDocument=e,s}if("remove"===t.op)return s.removed=e,s.newDocument=null,s;if("_get"===t.op)return t.value=e,s;if(r)throw new Gm("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return s}n||(e=Fm(e));var a=(t.path||"").split("/"),c=e,u=1,l=a.length,f=void 0,d=void 0,h=void 0;for(h="function"==typeof r?r:Qm;;){if((d=a[u])&&-1!=d.indexOf("~")&&(d=Dm(d)),i&&("__proto__"==d||"prototype"==d&&u>0&&"constructor"==a[u-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===f&&(void 0===c[d]?f=a.slice(0,u).join("/"):u==l-1&&(f=t.path),void 0!==f&&h(t,0,e,f)),u++,Array.isArray(c)){if("-"===d)d=c.length;else{if(r&&!jm(d))throw new Gm("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);jm(d)&&(d=~~d)}if(u>=l){if(r&&"add"===t.op&&d>c.length)throw new Gm("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(s=Wm[t.op].call(t,c,d,e)).test)throw new Gm("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(u>=l){if(!1===(s=Vm[t.op].call(t,c,d,e)).test)throw new Gm("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(c=c[d],r&&u<l&&(!c||"object"!=typeof c))throw new Gm("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}function Jm(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=!0),r&&!Array.isArray(t))throw new Gm("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Fm(e));for(var o=new Array(t.length),s=0,a=t.length;s<a;s++)o[s]=Km(e,t[s],r,!0,i,s),e=o[s].newDocument;return o.newDocument=e,o}function Ym(e,t,r){var n=Km(e,t);if(!1===n.test)throw new Gm("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function Qm(e,t,r,n){if("object"!=typeof e||null===e||Array.isArray(e))throw new Gm("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(!Vm[e.op])throw new Gm("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r);if("string"!=typeof e.path)throw new Gm("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new Gm('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new Gm("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new Gm("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&Zm(e.value))throw new Gm("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r)if("add"==e.op){var i=e.path.split("/").length,o=n.split("/").length;if(i!==o+1&&i!==o)throw new Gm("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==n)throw new Gm("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if("move"===e.op||"copy"===e.op){var s=Xm([{op:"_get",path:e.from,value:void 0}],r);if(s&&"OPERATION_PATH_UNRESOLVABLE"===s.name)throw new Gm("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}function Xm(e,t,r){try{if(!Array.isArray(e))throw new Gm("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Jm(Fm(t),Fm(e),r||!0);else{r=r||Qm;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(e){if(e instanceof Gm)return e;throw e}}function eb(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,i,o=Array.isArray(e),s=Array.isArray(t);if(o&&s){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!eb(e[r],t[r]))return!1;return!0}if(o!=s)return!1;var a=Object.keys(e);if((n=a.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(a[r]))return!1;for(r=n;0!=r--;)if(!eb(e[i=a[r]],t[i]))return!1;return!0}return e!=e&&t!=t}var tb=new WeakMap,rb=function(e){this.observers=new Map,this.obj=e},nb=function(e,t){this.callback=e,this.observer=t};function ib(e,t){t.unobserve()}function ob(e,t){var r,n=function(e){return tb.get(e)}(e);if(n){var i=function(e,t){return e.observers.get(t)}(n,t);r=i&&i.observer}else n=new rb(e),tb.set(e,n);if(r)return r;if(r={},n.value=Fm(e),t){r.callback=t,r.next=null;var o=function(){sb(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(o)};"undefined"!=typeof window&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return r.patches=[],r.object=e,r.unobserve=function(){sb(r),clearTimeout(r.next),function(e,t){e.observers.delete(t.callback)}(n,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},n.observers.set(t,new nb(t,r)),r}function sb(e,t){void 0===t&&(t=!1);var r=tb.get(e.object);ab(r.value,e.object,e.patches,"",t),e.patches.length&&Jm(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function ab(e,t,r,n,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=Lm(t),s=Lm(e),a=!1,c=s.length-1;c>=0;c--){var u=e[f=s[c]];if(!Mm(t,f)||void 0===t[f]&&void 0!==u&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&r.push({op:"test",path:n+"/"+Um(f),value:Fm(u)}),r.push({op:"remove",path:n+"/"+Um(f)}),a=!0):(i&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}));else{var l=t[f];"object"==typeof u&&null!=u&&"object"==typeof l&&null!=l&&Array.isArray(u)===Array.isArray(l)?ab(u,l,r,n+"/"+Um(f),i):u!==l&&(i&&r.push({op:"test",path:n+"/"+Um(f),value:Fm(u)}),r.push({op:"replace",path:n+"/"+Um(f),value:Fm(l)}))}}if(a||o.length!=s.length)for(c=0;c<o.length;c++){var f;Mm(e,f=o[c])||void 0===t[f]||r.push({op:"add",path:n+"/"+Um(f),value:Fm(t[f])})}}}function cb(e,t,r){void 0===r&&(r=!1);var n=[];return ab(e,t,n,"",r),n}const ub=Object.assign({},t,r,{JsonPatchError:$m,deepClone:Fm,escapePathComponent:Um,unescapePathComponent:Dm});function lb(e,t,r){const n=ub.compare(e,t);return n[0]&&(r&&(n[0].note=r),n[0].timestamp=Date.now()),n}function fb(e){return(0,Gd.Z)(e).reduce(((e,t)=>ub.applyPatch(e,t).newDocument))}function db(e){const t=(0,n.Z)({},e);return delete t.history,(0,Gd.Z)(t)}const hb=new fn(cu),pb=new fn(uu),gb=new fn(lu),yb={from:function(e){return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?xf(e):xf(e).toLowerCase()},to:function(e){return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?xf(e):xf(e).toLowerCase()},nonce:e=>xf(e),customNonceValue:e=>xf(e),value:e=>xf(e),data:e=>xf(e),gas:e=>xf(e),gasPrice:e=>xf(e),type:xf,maxFeePerGas:xf,maxPriorityFeePerGas:xf};function mb(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r={id:e.id||(0,a.randomId)(),from:e.from};for(const n in yb){const i=n;e[i]&&(r[i]=yb[i](e[i],t))}return r}function bb(e,t){return void 0!==e.chainId&&e.chainId===t}function vb(e){var t,r;return df(xf(null==e||null===(t=e.transaction)||void 0===t?void 0:t.maxFeePerGas))&&df(xf(null==e||null===(r=e.transaction)||void 0===r?void 0:r.maxPriorityFeePerGas))}function wb(e){return void 0===e.transaction.maxFeePerGas&&void 0===e.transaction.maxPriorityFeePerGas&&(void 0===e.transaction.gasPrice||df(xf(e.transaction.gasPrice)))}function Ab(e,t,r){if(void 0!==e[r])throw kg.rpcErrors.invalidParams(`Invalid transaction params: specified ${t} but also included ${r}, these cannot be mixed`)}function Eb(e,t){if("string"!=typeof e[t])throw kg.rpcErrors.invalidParams(`Invalid transaction params: ${t} is not a string. got: (${e[t]})`)}function _b(e,t){switch(t){case"maxFeePerGas":case"maxPriorityFeePerGas":if(e.type&&e.type!==Uu.FEE_MARKET)throw kg.rpcErrors.invalidParams(`Invalid transaction envelope type: specified type "${e.type}" but including maxFeePerGas and maxPriorityFeePerGas requires type: "${Uu.FEE_MARKET}"`);break;default:if(e.type&&e.type===Uu.FEE_MARKET)throw kg.rpcErrors.invalidParams(`Invalid transaction envelope type: specified type "${e.type}" but included a gasPrice instead of maxFeePerGas and maxPriorityFeePerGas`)}}function Sb(e){if("string"!=typeof e.from)throw kg.rpcErrors.invalidParams(`Invalid "from" address "${e.from}": not a string.`);if(!Hf(e.from))throw kg.rpcErrors.invalidParams('Invalid "from" address.')}function xb(e){if("0x"===e.to||null===e.to){if(!e.data)throw kg.rpcErrors.invalidParams('Invalid "to" address.');delete e.to}else if(void 0!==e.to&&!Hf(e.to))throw kg.rpcErrors.invalidParams('Invalid "to" address.');return e}function Tb(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e||"object"!=typeof e||Array.isArray(e))throw kg.rpcErrors.invalidParams("Invalid transaction params: must be an object.");if(!e.to&&!e.data)throw kg.rpcErrors.invalidParams('Invalid transaction params: must specify "data" for contract deployments, or "to" (and optionally "data") for all other types of transactions.');if(vb({transaction:e})&&!t)throw kg.rpcErrors.invalidParams("Invalid transaction params: params specify an EIP-1559 transaction but the current network does not support EIP-1559");Object.entries(e).forEach((t=>{let[r,n]=t;switch(r){case"from":Sb(e);break;case"to":xb(e);break;case"gasPrice":_b(e,"gasPrice"),Ab(e,"gasPrice","maxFeePerGas"),Ab(e,"gasPrice","maxPriorityFeePerGas"),Eb(e,"gasPrice");break;case"maxFeePerGas":_b(e,"maxFeePerGas"),Ab(e,"maxFeePerGas","gasPrice"),Eb(e,"maxFeePerGas");break;case"maxPriorityFeePerGas":_b(e,"maxPriorityFeePerGas"),Ab(e,"maxPriorityFeePerGas","gasPrice"),Eb(e,"maxPriorityFeePerGas");break;case"value":if(Eb(e,"value"),n.toString().includes("-"))throw kg.rpcErrors.invalidParams(`Invalid transaction value "${n}": not a positive number.`);if(n.toString().includes("."))throw kg.rpcErrors.invalidParams(`Invalid transaction value of "${n}": number must be in wei.`);break;case"chainId":if("number"!=typeof n&&"string"!=typeof n)throw kg.rpcErrors.invalidParams(`Invalid transaction params: ${r} is not a Number or hex string. got: (${n})`);break;default:Eb(e,r)}}))}function Pb(e){const t=mb(e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]);return Tb(t),t}function Ib(){return[a.TransactionStatus.rejected,a.TransactionStatus.confirmed,a.TransactionStatus.failed,a.TransactionStatus.dropped]}function kb(e){try{const t=hb.parseTransaction({data:e});if(t)return{name:t.name,methodParams:t.args.toArray(),type:gu}}catch{}try{const t=pb.parseTransaction({data:e});if(t)return{name:t.name,methodParams:t.args.toArray(),type:yu}}catch{}try{const t=gb.parseTransaction({data:e});if(t)return{name:t.name,methodParams:t.args.toArray(),type:mu}}catch{}}const Ob=async(e,t)=>{let r;try{r=await e.request({method:ju.ETH_GET_CODE,params:[t,"latest"]})}catch(e){r=null}return{contractCode:r,isContractAddress:!!r&&"0x"!==r&&"0x0"!==r}};async function Cb(e,t){const{data:r,to:n}=e;let i,o="",s=[],c="";try{({name:o,methodParams:s,type:c}=r&&kb(r)||{})}catch(e){au().debug("Failed to parse transaction data",e)}let u="";if(r&&!n)i=a.TRANSACTION_TYPES.DEPLOY_CONTRACT;else{const{contractCode:s,isContractAddress:c}=await Ob(t,n);if(u=s,c){const t=e.value&&0!==Number(e.value),n=[a.TRANSACTION_TYPES.TOKEN_METHOD_APPROVE,a.TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER,a.TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM,a.TRANSACTION_TYPES.COLLECTIBLE_METHOD_SAFE_TRANSFER_FROM,a.TRANSACTION_TYPES.SET_APPROVAL_FOR_ALL].find((e=>{var t;return e.toLowerCase()===(null===(t=o)||void 0===t?void 0:t.toLowerCase())}));i=r&&n&&!t?n:a.TRANSACTION_TYPES.CONTRACT_INTERACTION}else i=a.TRANSACTION_TYPES.SENT_ETHER}return{type:c||pu,category:i,methodParams:s,getCodeResponse:u}}class Nb extends a.BaseTransactionStateManager{constructor(e){let{config:t,state:r,getCurrentChainId:n}=e;super({config:t,state:r,getCurrentChainId:n})}generateTxMeta(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.getCurrentChainId();if("loading"===t)throw new Error("Torus is having trouble connecting to the network");let r=null;return e.transaction&&"string"==typeof e.origin&&"torus"!==e.origin&&(void 0!==e.transaction.gasPrice?r={gasPrice:e.transaction.gasPrice}:void 0===e.transaction.maxFeePerGas&&void 0===e.transaction.maxPriorityFeePerGas||(r={maxPriorityFeePerGas:e.transaction.maxPriorityFeePerGas,maxFeePerGas:e.transaction.maxFeePerGas}),void 0!==e.transaction.gas&&(r=(0,n.Z)((0,n.Z)({},r),{},{gas:e.transaction.gas}))),(0,n.Z)({id:(0,a.randomId)(),time:Date.now(),status:a.TransactionStatus.unapproved,loadingDefaults:!0,chainId:t,dappSuggestedGasFees:r},e)}addTransactionToState(e){e.transaction&&(e.transaction=Pb(e.transaction,!1)),this.once(`${e.id}:signed`,(()=>{this.removeAllListeners(`${e.id}:rejected`)})),this.once(`${e.id}:rejected`,(()=>{this.removeAllListeners(`${e.id}:signed`)})),e.history=[];const t=db(e);e.history.push(t);const r=this.getTransactions({filterToCurrentNetwork:!1}),{txHistoryLimit:n}=this.config,i=new Set,o=r.reverse().filter((e=>{const{nonce:t}=e.transaction,{chainId:r,status:o}=e,s=`${t}-${r}`;return!(i.has(s)||(i.size<n-1||!1===Ib().includes(o))&&(i.add(s),1))})).map((e=>e.id));return this._deleteTransactions(o),this._addTransactionsToState([e]),e}wipeTransactions(e){const{transactions:t}=this.state,r=this.getCurrentChainId();this.update({transactions:(0,Im.Z)(t,(t=>{const n=(0,a.transactionMatchesNetwork)(t,r);return t.transaction.from===e&&n}))})}getTransactions(){let{searchCriteria:e={},initialList:t,filterToCurrentNetwork:r=!0,limit:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=this.getCurrentChainId(),o=(0,km.Z)(e,(e=>"function"==typeof e?e:t=>t===e)),s=t?(0,Om.Z)(t,"id"):this.state.transactions,c=(0,Cm.Z)((0,Nm.Z)(s,(e=>{const t=(0,a.transactionMatchesNetwork)(e,i);if(r&&!t)return!1;for(const[t,r]of Object.entries(o))if(t in e.transaction){if(!1===r(e.transaction[t]))return!1}else if(!1===r(e[t]))return!1;return!0})),"time");if(void 0!==n){const e=new Set,t=[];for(let r=c.length-1;r>-1;r-=1){const i=c[r],{nonce:o}=i.transaction;if(!e.has(o)){if(!(e.size<n))continue;e.add(o)}t.unshift(i)}return t}return c}getApprovedTransactions(e){const t={status:a.TransactionStatus.approved};return e&&(t.from=e),this.getTransactions({searchCriteria:t})}getSubmittedTransactions(e){const t={status:a.TransactionStatus.submitted};return e&&(t.from=e),this.getTransactions({searchCriteria:t})}getPendingTransactions(e){return[...this.getSubmittedTransactions(e),...this.getApprovedTransactions(e)]}getConfirmedTransactions(e){const t={status:a.TransactionStatus.confirmed};return e&&(t.from=e),this.getTransactions({searchCriteria:t})}getUnapprovedTxList(){const e=this.getCurrentChainId();return(0,Nm.Z)(this.state.transactions,(t=>{const r=(0,a.transactionMatchesNetwork)(t,e);return t.status===a.TransactionStatus.unapproved&&r}))}updateTransactionInState(e,t){e.transaction&&(e.transaction=Pb(e.transaction,!1));const r=db(e),n=lb(fb(e.history),r,t);n.length>0&&e.history.push(n),this.updateTransaction(e)}_setTransactionStatus(e,t,r){const n=this.getTransaction(e);n&&(n.status=t,this.updateTransactionInState(n),this.emit(a.TX_EVENTS.TX_STATUS_UPDATE,{txId:e,status:t}),this.isFinalState(t)||r?this.emit(`${n.id}:finished`,n):this.emit(`${n.id}:${t}`,e))}}var Rb=i(8834).Buffer;class Bb extends Nb{constructor(e){let{config:t,state:r,provider:n,blockTracker:i,signEthTx:o,getCurrentChainId:a,getCurrentNetworkEIP1559Compatibility:c,getProviderConfig:u,getCurrentAccountEIP1559Compatibility:l,getSelectedAddress:f,getEIP1559GasFeeEstimates:d}=e;super({config:t,state:r,getCurrentChainId:a}),(0,s.Z)(this,"getSelectedAddress",void 0),(0,s.Z)(this,"getEIP1559GasFeeEstimates",void 0),(0,s.Z)(this,"nonceTracker",void 0),(0,s.Z)(this,"pendingTxTracker",void 0),(0,s.Z)(this,"txGasUtil",void 0),(0,s.Z)(this,"_getCurrentNetworkEIP1559Compatibility",void 0),(0,s.Z)(this,"_getCurrentAccountEIP1559Compatibility",void 0),(0,s.Z)(this,"getProviderConfig",void 0),(0,s.Z)(this,"signEthTx",void 0),(0,s.Z)(this,"provider",void 0),(0,s.Z)(this,"blockTracker",void 0),(0,s.Z)(this,"inProcessOfSigning",new Set),(0,s.Z)(this,"getUnapprovedTxCount",(()=>Object.keys(this.getUnapprovedTxList()).length)),(0,s.Z)(this,"getPendingTxCount",(e=>this.getPendingTransactions(e).length)),this.blockTracker=i,this.getProviderConfig=u,this._getCurrentNetworkEIP1559Compatibility=c,this._getCurrentAccountEIP1559Compatibility=l,this.getSelectedAddress=f,this.getEIP1559GasFeeEstimates=d,this.signEthTx=o,this.provider=n,this.txGasUtil=new Tm(this.provider,this.blockTracker),this.nonceTracker=new Ty({provider:n,blockTracker:i,getConfirmedTransactions:this.getConfirmedTransactions.bind(this),getPendingTransactions:this.getSubmittedTransactions.bind(this)}),this.pendingTxTracker=new Py({provider:n,nonceTracker:this.nonceTracker,getPendingTransactions:this.getPendingTransactions.bind(this),getConfirmedTransactions:this.getConfirmedTransactions.bind(this),approveTransaction:this.approveTransaction.bind(this),publishTransaction:e=>this.provider.request({method:ju.ETH_SEND_RAW_TRANSACTION,params:[e]})}),this._setupListeners()}addTransactionUnapproved(e){this.addTransactionToState(e),this.emit(`${e.id}:unapproved`,e)}async addNewUnapprovedTransaction(e,t){const r=await this.createTransaction(e,t);return this.processApproval(r)}async processApproval(e){return new Promise(((t,r)=>{this.once(`${e.id}:finished`,(n=>n.status===a.TransactionStatus.rejected?r(kg.providerErrors.userRejectedRequest("Transaction Signature: User denied message signature")):n.status===a.TransactionStatus.failed?r(kg.rpcErrors.internal(`Transaction Signature: failed to sign message ${n.error}`)):n.status===a.TransactionStatus.submitted?t(n.transactionHash):r(kg.rpcErrors.internal(`Transaction Signature: Unknown problem: ${JSON.stringify(e.transaction)}`))))}))}async approveTransaction(e){const t=this.getTransaction(e);if(this.inProcessOfSigning.has(e))return;let r;this.inProcessOfSigning.add(e);try{this.setTxStatusApproved(e);const n=t.transaction.from,{customNonceValue:i}=t.transaction,o=Number(i);r=await this.nonceTracker.getNonceLock(n);const s=r.nextNonce,a=0===o?i:i||s;t.transaction.nonce=xf(a.toString(16)),t.nonceDetails=r.nonceDetails,this.updateTransactionInState(t,"transactions#approveTransaction");const c=await this.signTransaction(e);await this.publishTransaction(e,c),r.releaseLock()}catch(t){try{this.setTxStatusFailed(e,t)}catch(e){au().error(e)}throw r&&r.releaseLock(),t}finally{this.inProcessOfSigning.delete(e)}}async signTransaction(e){const t=this.getTransaction(e),r=this.getCurrentChainId(),i=vb(t)?Uu.FEE_MARKET:Uu.LEGACY,o=(0,n.Z)((0,n.Z)({},t.transaction),{},{type:i,chainId:r,gasLimit:t.transaction.gas}),s=o.from,a=await this.getCommonConfiguration(s),c=xm.fromTxData(o,{common:a}),u=await this.signEthTx(c,s);return t.r=xf(u.r.toString(16)),t.s=xf(u.s.toString(16)),t.v=xf(u.v.toString(16)),this.updateTransactionInState(t,"transactions#signTransaction: add r, s, v values"),this.setTxStatusSigned(e),xf(Rb.from(u.serialize()).toString("hex"))}async publishTransaction(e,t){const r=this.getTransaction(e);let n;r.rawTransaction=t,this.updateTransactionInState(r,"transactions#publishTransaction");try{n=await this.provider.request({method:ju.ETH_SEND_RAW_TRANSACTION,params:[t]})}catch(e){if(!e.message.toLowerCase().includes("known transaction"))throw e;n=at(xf(t)),n=xf(n)}this.setTxHash(e,n),this.setTxStatusSubmitted(e)}async confirmTransaction(e){const{txId:t,txReceipt:r}=e;au().info(e,"confirm params");const i=this.getTransaction(t);if(i)try{i.txReceipt=(0,n.Z)({},r),this.setTxStatusConfirmed(t),this.markNonceDuplicatesDropped(t),this.updateTransactionInState(i,"transactions#confirmTransaction - add txReceipt")}catch(e){au().error(e)}}cancelTransaction(e){throw new Error(`Method not implemented. ${e}`)}async getEIP1559Compatibility(e){const t=await this._getCurrentNetworkEIP1559Compatibility(),r=await this._getCurrentAccountEIP1559Compatibility(e);return t&&r}async addTransactionGasDefaults(e){let t=e;try{t=await this.addTxGasDefaults(e)}catch(r){throw au().warn(r),t=this.getTransaction(e.id),t.loadingDefaults=!1,this.updateTransactionInState(e,"Failed to calculate gas defaults."),r}return t.loadingDefaults=!1,this.updateTransactionInState(t,"Added new unapproved transaction."),t}async addTxGasDefaults(e){const t=e.transaction.type!==Uu.LEGACY&&await this.getEIP1559Compatibility(),{gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i}=await this.getDefaultGasFees(e,t),{gasLimit:o,simulationFails:s}=await this.getDefaultGasLimit(e);return e=this.getTransaction(e.id),s&&(e.simulationFails=s),t?(!e.transaction.gasPrice||e.transaction.maxFeePerGas||e.transaction.maxPriorityFeePerGas?(n&&!e.transaction.maxFeePerGas&&(e.transaction.maxFeePerGas=n),i&&!e.transaction.maxPriorityFeePerGas&&(e.transaction.maxPriorityFeePerGas=i),r&&!e.transaction.maxFeePerGas&&(e.transaction.maxFeePerGas=r),e.transaction.maxFeePerGas&&!e.transaction.maxPriorityFeePerGas&&(e.transaction.maxPriorityFeePerGas=e.transaction.maxFeePerGas)):(e.transaction.maxFeePerGas=e.transaction.gasPrice,e.transaction.maxPriorityFeePerGas=Ld("string"==typeof i?lf(i):i,"string"==typeof e.transaction.gasPrice?lf(e.transaction.gasPrice):e.transaction.gasPrice)?i:e.transaction.gasPrice),delete e.transaction.gasPrice):(delete e.transaction.maxPriorityFeePerGas,delete e.transaction.maxFeePerGas),!r||e.transaction.gasPrice||e.transaction.maxPriorityFeePerGas||e.transaction.maxFeePerGas||(e.transaction.gasPrice=r),o&&!e.transaction.gas&&(e.transaction.gas=o),e}setTxHash(e,t){const r=this.getTransaction(e);r.transactionHash=t,this.updateTransactionInState(r,"transactions#setTxHash")}async getDefaultGasFees(e,t){if(!t&&e.transaction.gasPrice||t&&e.transaction.maxFeePerGas&&e.transaction.maxPriorityFeePerGas)return{};try{const{gasFeeEstimates:e,gasEstimateType:r}=await this.getEIP1559GasFeeEstimates();if(t&&r===Du.FEE_MARKET){const{medium:{suggestedMaxPriorityFeePerGas:t,suggestedMaxFeePerGas:r}={}}=e;if(t&&r)return{maxFeePerGas:xf(th(new Td(r)).toString(16)),maxPriorityFeePerGas:xf(th(new Td(t)).toString(16))}}else{if(r===Du.LEGACY){const{medium:t}=e;return{gasPrice:xf(th(new Td(t)).toString(16))}}if(r===Du.ETH_GASPRICE){const{gasPrice:t}=e;return{gasPrice:xf(th(new Td(t)).toString(16))}}}}catch(e){au().error(e)}const r=await this.provider.request({method:ju.ETH_GET_GAS_PRICE});return{gasPrice:r&&xf(r)}}async getDefaultGasLimit(e){const t=this.getCurrentChainId(),r=Zu[t],n=Ud(t);if(e.transaction.gas)return{};if(e.transaction.to&&e.transactionCategory===a.TRANSACTION_TYPES.SENT_ETHER&&"custom"!==n&&!e.transaction.data)return{gasLimit:Md.SIMPLE};const{blockGasLimit:i,estimatedGasHex:o,simulationFails:s}=await this.txGasUtil.analyzeGasUsage(e);return{gasLimit:this.txGasUtil.addGasBuffer(xf(o),i,r),simulationFails:s}}async createTransaction(e,t){const r=mb(e);Tb(r,await this.getEIP1559Compatibility(e.from));let n=this.generateTxMeta({transaction:r,origin:t.origin});const{type:i,category:o,methodParams:s}=await Cb(e,this.provider);return n.type=i,n.transactionCategory=o,n.methodParams=s,n.transaction.value=n.transaction.value?xf(n.transaction.value):"0x0",this.emit(`${n.id}:unapproved`,n),n=this.addTransactionToState(n),n=await this.addTransactionGasDefaults(n),this.emit(a.TX_EVENTS.TX_UNAPPROVED,{txMeta:n,req:t}),n}_setupListeners(){this.setupBlockTrackerListener(),this.pendingTxTracker.on(a.TX_EVENTS.TX_WARNING,(e=>{this.updateTransactionInState(e.txMeta)})),this.pendingTxTracker.on(a.TX_EVENTS.TX_DROPPED,(e=>this.setTxStatusDropped(e.txId))),this.pendingTxTracker.on(a.TX_EVENTS.TX_BLOCK_UPDATE,(e=>{let{txMeta:t,latestBlockNumber:r}=e;t.firstRetryBlockNumber||(t.firstRetryBlockNumber=r,this.updateTransactionInState(t))})),this.pendingTxTracker.on(a.TX_EVENTS.TX_RETRY,(e=>{"retryCount"in e||(e.retryCount=0),e.retryCount+=1,this.updateTransactionInState(e)})),this.pendingTxTracker.on(a.TX_EVENTS.TX_FAILED,(e=>{this.setTxStatusFailed(e.txId,e.error)})),this.pendingTxTracker.on(a.TX_EVENTS.TX_CONFIRMED,(e=>this.confirmTransaction(e)))}setupBlockTrackerListener(){let e=!1;const t=this.onLatestBlock.bind(this);this.on(a.TX_EVENTS.TX_STATUS_UPDATE,(()=>{const r=this.getPendingTransactions();!e&&r.length>0?(this.blockTracker.on("latest",t),e=!0):e&&!r.length&&(this.blockTracker.removeListener("latest",t),e=!1)}))}async onLatestBlock(e){try{await this.pendingTxTracker.updatePendingTxs()}catch(e){au().error(e)}try{await this.pendingTxTracker.resubmitPendingTxs(e)}catch(e){au().error(e)}}async getCommonConfiguration(e){const{chainId:t,displayName:r}=this.getProviderConfig(),n=await this.getEIP1559Compatibility(e)?zy.Paris:zy.Berlin;return Xy.custom({chainId:"loading"===t?0:Number.parseInt(t,16),defaultHardfork:n,name:r,networkId:"loading"===t?0:Number.parseInt(t,16)})}markNonceDuplicatesDropped(e){const t=this.getTransaction(e),{nonce:r,from:n}=t.transaction,i=this.getTransactions({searchCriteria:{from:n,nonce:r}});i.length&&i.forEach((r=>{r.id!==e&&(this.updateTransactionInState(t,"transactions/pending-tx-tracker#event: tx:confirmed reference to confirmed txHash with same nonce"),r.status!==a.TransactionStatus.failed&&this.setTxStatusDropped(r.id))}))}}})(),o})()));
3
+ //# sourceMappingURL=ethereumControllers.umd.min.js.map