@xoxno/sdk-js 0.1.92-alpha → 0.1.94-alpha

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.
package/dist/711.esm.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 711.esm.js.LICENSE.txt */
2
- (this.webpackChunk_xoxno_sdk_js=this.webpackChunk_xoxno_sdk_js||[]).push([[711],{8095:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeFormula=void 0;t.TypeFormula=class{constructor(e,t){this.name=e,this.typeParameters=t}toString(){if(this.typeParameters.length>0){const e=this.typeParameters.map((e=>e.toString())).join(", ");return`${this.name}<${e}>`}return this.name}}},9132:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeFormulaParser=void 0;const n=r(8095);class i{parseExpression(e){e=e.trim();const t=this.tokenizeExpression(e).filter((e=>e!==i.COMMA)),r=[];for(const e of t)if(this.isPunctuation(e))if(this.isEndOfTypeParameters(e)){const e=this.acquireTypeWithParameters(r);r.push(e)}else{if(!this.isBeginningOfTypeParameters(e))throw new Error(`Unexpected token (punctuation): ${e}`);r.push(e)}else r.push(e);if(1!==r.length)throw new Error(`Unexpected stack length at end of parsing: ${r.length}`);if(i.PUNCTUATION.includes(r[0]))throw new Error("Unexpected root element.");const s=r[0];if(s instanceof n.TypeFormula)return s;if("string"==typeof s)return new n.TypeFormula(s,[]);throw new Error(`Unexpected item on stack: ${s}`)}tokenizeExpression(e){const t=[];let r="";for(const n of e)this.isPunctuation(n)?(r&&(t.push(r.trim()),r=""),t.push(n)):r+=n;return r&&t.push(r.trim()),t}acquireTypeWithParameters(e){const t=this.acquireTypeParameters(e),r=e.pop();return new n.TypeFormula(r,t.reverse())}acquireTypeParameters(e){const t=[];for(;;){const r=e.pop();if(void 0===r)throw new Error("Badly specified type parameters");if(this.isBeginningOfTypeParameters(r))break;if(r instanceof n.TypeFormula)t.push(r);else{if("string"!=typeof r)throw new Error(`Unexpected type parameter object in stack: ${r}`);t.push(new n.TypeFormula(r,[]))}}return t}isPunctuation(e){return i.PUNCTUATION.includes(e)}isEndOfTypeParameters(e){return e===i.END_TYPE_PARAMETERS}isBeginningOfTypeParameters(e){return e===i.BEGIN_TYPE_PARAMETERS}}t.TypeFormulaParser=i,i.BEGIN_TYPE_PARAMETERS="<",i.END_TYPE_PARAMETERS=">",i.COMMA=",",i.PUNCTUATION=[i.COMMA,i.BEGIN_TYPE_PARAMETERS,i.END_TYPE_PARAMETERS]},236:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddressComputer=t.Address=void 0;const a=s(r(9674)),u=o(r(1594)),c=r(7353),l=s(r(2581)),f=r(8390),d=r(5508),h="erd",g="0".repeat(16);class p{constructor(e){if(this.valueHex="",e){if(e instanceof p)return p.fromAddress(e);if(ArrayBuffer.isView(e))return p.fromBuffer(Buffer.from(e));if("string"==typeof e)return p.fromString(e);throw new l.ErrAddressCannotCreate(e)}}static fromAddress(e){return p.fromValidHex(e.valueHex)}static fromValidHex(e){let t=p.empty();return t.valueHex=e,t}static fromBuffer(e){if(32!=e.length)throw new l.ErrAddressCannotCreate(e);return p.fromValidHex(e.toString("hex"))}static fromString(e){return p.isValidHex(e)?p.fromValidHex(e):p.fromBech32(e)}static isValidHex(e){return 32==Buffer.from(e,"hex").length}static fromHex(e){if(!p.isValidHex(e))throw new l.ErrAddressCannotCreate(e);return p.fromValidHex(e)}static empty(){return new p("")}static fromBech32(e){let t;try{t=a.decode(e)}catch(t){throw new l.ErrAddressCannotCreate(e,t)}const r=t.prefix;if(r!=h)throw new l.ErrAddressBadHrp(h,r);const n=Buffer.from(a.fromWords(t.words));if(32!=n.length)throw new l.ErrAddressCannotCreate(e);return p.fromValidHex(n.toString("hex"))}static isValid(e){const t=a.decodeUnsafe(e),r=t?.prefix,n=t?Buffer.from(a.fromWords(t.words)):void 0;return r===h&&32===n?.length}hex(){return this.toHex()}toHex(){return this.isEmpty()?"":this.valueHex}bech32(){return this.toBech32()}toBech32(){if(this.isEmpty())return"";let e=a.toWords(this.pubkey());return a.encode(h,e)}pubkey(){return this.getPublicKey()}getPublicKey(){return this.isEmpty()?Buffer.from([]):Buffer.from(this.valueHex,"hex")}getHrp(){return h}isEmpty(){return!this.valueHex}equals(e){return!!e&&this.valueHex==e.valueHex}toString(){return this.toBech32()}toJSON(){return{bech32:this.toBech32(),pubkey:this.toHex()}}static Zero(){return new p("0".repeat(64))}isContractAddress(){return this.isSmartContract()}isSmartContract(){return this.toHex().startsWith(g)}}t.Address=p;t.AddressComputer=class{constructor(e){this.numberOfShardsWithoutMeta=e||c.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META}computeContractAddress(e,t){const r=Buffer.alloc(8,0),n=e.getPublicKey(),i=n.slice(30),s=Buffer.alloc(8),o=new u.default(t.toString()),a=f.bigIntToBuffer(o);s.write(a.reverse().toString("hex"),"hex");const l=Buffer.concat([n,s]),h=d("keccak256").update(l).digest(),g=Buffer.from(c.WasmVirtualMachine,"hex"),m=Buffer.concat([r,g,h.slice(10,30),i]);return new p(m)}getShardOfAddress(e){return this.getShardOfPubkey(e.getPublicKey(),this.numberOfShardsWithoutMeta)}getShardOfPubkey(e,t){const r=parseInt("11",2),n=parseInt("01",2),i=e[31];if(this.isPubkeyOfMetachain(e))return c.METACHAIN_ID;let s=i&r;return s>t-1&&(s=i&n),s}isPubkeyOfMetachain(e){const t=Buffer.from([0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),r=Buffer.from(e).slice(0,t.length);if(t.equals(r))return!0;return!!Buffer.alloc(32).equals(Buffer.from(e))}}},1220:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Compatibility=void 0;const n=r(236);t.Compatibility=class{static guardAddressIsSetAndNonZero(e,t,r){e&&""!=e.bech32()?e.bech32()==n.Address.Zero().bech32()&&console.warn(`${t}: address should not be the 'zero' address (also known as the 'contracts deployment address'); ${r}. In the future, this will throw an exception instead of emitting a WARN.`):console.warn(`${t}: address should be set; ${r}. In the future, this will throw an exception instead of emitting a WARN.`)}}},7353:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UNKNOWN_SIGNER=t.SDK_JS_SIGNER=t.METACHAIN_ID=t.WasmVirtualMachine=t.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META=t.BECH32_ADDRESS_LENGTH=t.HEX_TRANSACTION_HASH_LENGTH=t.MESSAGE_PREFIX=t.DEFAULT_MESSAGE_VERSION=t.ESDT_CONTRACT_ADDRESS=t.DEFAULT_HRP=t.DELEGATION_MANAGER_SC_ADDRESS=t.CONTRACT_DEPLOY_ADDRESS=t.VM_TYPE_WASM_VM=t.ARGUMENTS_SEPARATOR=t.ESDT_TRANSFER_VALUE=t.MULTI_ESDTNFT_TRANSFER_FUNCTION_NAME=t.ESDTNFT_TRANSFER_FUNCTION_NAME=t.ESDT_TRANSFER_FUNCTION_NAME=t.ESDT_TRANSFER_GAS_LIMIT=t.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS=t.TRANSACTION_VERSION_DEFAULT=t.TRANSACTION_OPTIONS_TX_GUARDED=t.TRANSACTION_OPTIONS_TX_HASH_SIGN=t.TRANSACTION_OPTIONS_DEFAULT=t.TRANSACTION_MIN_GAS_PRICE=void 0,t.TRANSACTION_MIN_GAS_PRICE=1e9,t.TRANSACTION_OPTIONS_DEFAULT=0,t.TRANSACTION_OPTIONS_TX_HASH_SIGN=1,t.TRANSACTION_OPTIONS_TX_GUARDED=2,t.TRANSACTION_VERSION_DEFAULT=2,t.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS=2,t.ESDT_TRANSFER_GAS_LIMIT=5e5,t.ESDT_TRANSFER_FUNCTION_NAME="ESDTTransfer",t.ESDTNFT_TRANSFER_FUNCTION_NAME="ESDTNFTTransfer",t.MULTI_ESDTNFT_TRANSFER_FUNCTION_NAME="MultiESDTNFTTransfer",t.ESDT_TRANSFER_VALUE="0",t.ARGUMENTS_SEPARATOR="@",t.VM_TYPE_WASM_VM=new Uint8Array([5,0]),t.CONTRACT_DEPLOY_ADDRESS="erd1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq6gq4hu",t.DELEGATION_MANAGER_SC_ADDRESS="erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqylllslmq6y6",t.DEFAULT_HRP="erd",t.ESDT_CONTRACT_ADDRESS="erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u",t.DEFAULT_MESSAGE_VERSION=1,t.MESSAGE_PREFIX="Elrond Signed Message:\n",t.HEX_TRANSACTION_HASH_LENGTH=64,t.BECH32_ADDRESS_LENGTH=62,t.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META=3,t.WasmVirtualMachine="0500",t.METACHAIN_ID=4294967295,t.SDK_JS_SIGNER="sdk-js",t.UNKNOWN_SIGNER="unknown"},6659:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionsConverter=void 0;const n=r(661),i=r(476),s=r(3217);t.TransactionsConverter=class{transactionToPlainObject(e){return{nonce:Number(e.nonce),value:e.value.toString(),receiver:e.receiver,sender:e.sender,senderUsername:this.toBase64OrUndefined(e.senderUsername),receiverUsername:this.toBase64OrUndefined(e.receiverUsername),gasPrice:Number(e.gasPrice),gasLimit:Number(e.gasLimit),data:this.toBase64OrUndefined(e.data),chainID:e.chainID.valueOf(),version:e.version,options:0==e.options?void 0:e.options,guardian:e.guardian?e.guardian:void 0,signature:this.toHexOrUndefined(e.signature),guardianSignature:this.toHexOrUndefined(e.guardianSignature)}}toBase64OrUndefined(e){return e&&e.length?Buffer.from(e).toString("base64"):void 0}toHexOrUndefined(e){return e&&e.length?Buffer.from(e).toString("hex"):void 0}plainObjectToTransaction(e){return new i.Transaction({nonce:BigInt(e.nonce),value:BigInt(e.value||""),receiver:e.receiver,receiverUsername:this.bufferFromBase64(e.receiverUsername).toString(),sender:e.sender,senderUsername:this.bufferFromBase64(e.senderUsername).toString(),guardian:e.guardian,gasPrice:BigInt(e.gasPrice),gasLimit:BigInt(e.gasLimit),data:this.bufferFromBase64(e.data),chainID:String(e.chainID),version:Number(e.version),options:Number(e.options),signature:this.bufferFromHex(e.signature),guardianSignature:this.bufferFromHex(e.guardianSignature)})}bufferFromBase64(e){return Buffer.from(e||"","base64")}bufferFromHex(e){return Buffer.from(e||"","hex")}transactionOnNetworkToOutcome(e){const t=(new n.ResultsParser).parseUntypedOutcome(e),r=new s.SmartContractCallOutcome({function:e.function,returnCode:t.returnCode.toString(),returnMessage:t.returnMessage,returnDataParts:t.values}),i=e.contractResults.items.map((e=>this.smartContractResultOnNetworkToSmartContractResult(e))),o=new s.TransactionLogs({address:e.logs.address.bech32(),events:e.logs.events.map((e=>this.eventOnNetworkToEvent(e)))});return new s.TransactionOutcome({logs:o,smartContractResults:i,directSmartContractCallOutcome:r})}smartContractResultOnNetworkToSmartContractResult(e){return new s.SmartContractResult({sender:e.sender.bech32(),receiver:e.receiver.bech32(),data:Buffer.from(e.data),logs:new s.TransactionLogs({address:e.logs.address.bech32(),events:e.logs.events.map((e=>this.eventOnNetworkToEvent(e)))})})}eventOnNetworkToEvent(e){const t=e.dataPayload?.valueOf()||Buffer.from(e.data||""),r=e.additionalData?.map((e=>Buffer.from(e.valueOf())))||[];return 0===r.length&&t.length&&r.push(Buffer.from(t)),new s.TransactionEvent({address:e.address.bech32(),identifier:e.identifier,topics:e.topics.map((e=>Buffer.from(e.hex(),"hex"))),dataItems:r})}}},2581:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ErrParseTransactionOutcome=t.ErrInvalidInnerTransaction=t.ErrBadUsage=t.ErrInvalidTokenIdentifier=t.ErrIsCompletedFieldIsMissingOnTransaction=t.ErrGasLimitShouldBe0ForInnerTransaction=t.ErrInvalidRelayedV2BuilderArguments=t.ErrInvalidRelayedV1BuilderArguments=t.ErrNotImplemented=t.ErrContractInteraction=t.ErrCodec=t.ErrCannotParseTransactionOutcome=t.ErrCannotParseContractResults=t.ErrMissingFieldOnEnum=t.ErrMissingFieldOnStruct=t.ErrTypingSystem=t.ErrMock=t.ErrContractHasNoAddress=t.ErrContract=t.ErrExpectedTransactionEventsNotFound=t.ErrExpectedTransactionStatusNotReached=t.ErrTransactionWatcherTimeout=t.ErrAsyncTimerAborted=t.ErrAsyncTimerAlreadyRunning=t.ErrInvalidFunctionName=t.ErrSignatureCannotCreate=t.ErrTransactionOptionsInvalid=t.ErrTransactionVersionInvalid=t.ErrNonceInvalid=t.ErrNotEnoughGas=t.ErrAddressEmpty=t.ErrAddressBadHrp=t.ErrAddressCannotCreate=t.ErrUnexpectedCondition=t.ErrInvariantFailed=t.ErrBadType=t.ErrUnsupportedOperation=t.ErrInvalidArgument=t.Err=void 0;class r extends Error{constructor(e,t){super(e),this.inner=void 0,this.inner=t}summary(){let e=[];e.push({name:this.name,message:this.message});let t=this.inner;for(;t;)e.push({name:t.name,message:t.message}),t=t.inner;return e}}t.Err=r;t.ErrInvalidArgument=class extends r{constructor(e,t){super(`Invalid argument: ${e}`,t)}};t.ErrUnsupportedOperation=class extends r{constructor(e,t="not specified"){super(`Operation "${e}" not supported. Reason: ${t}`)}};t.ErrBadType=class extends r{constructor(e,t,r){super(`Bad type of "${e}": ${r}. Expected type: ${t}`)}};t.ErrInvariantFailed=class extends r{constructor(e){super(`Invariant failed: [${e}]`)}};t.ErrUnexpectedCondition=class extends r{constructor(e){super(`Unexpected condition: [${e}]`)}};t.ErrAddressCannotCreate=class extends r{constructor(e,t){super(`Cannot create address from: ${e}`,t)}};t.ErrAddressBadHrp=class extends r{constructor(e,t){super(`Wrong address HRP. Expected: ${e}, got ${t}`)}};t.ErrAddressEmpty=class extends r{constructor(){super("Address is empty")}};t.ErrNotEnoughGas=class extends r{constructor(e){super(`Not enough gas provided: ${e}`)}};t.ErrNonceInvalid=class extends r{constructor(e){super(`Invalid nonce: ${e}`)}};t.ErrTransactionVersionInvalid=class extends r{constructor(e){super(`Invalid transaction version: ${e}`)}};t.ErrTransactionOptionsInvalid=class extends r{constructor(e){super(`Invalid transaction options: ${e}`)}};t.ErrSignatureCannotCreate=class extends r{constructor(e,t){super(`Cannot create signature from: ${e}`,t)}};t.ErrInvalidFunctionName=class extends r{constructor(){super("Invalid function name")}};t.ErrAsyncTimerAlreadyRunning=class extends r{constructor(){super("Async timer already running")}};t.ErrAsyncTimerAborted=class extends r{constructor(){super("Async timer aborted")}};t.ErrTransactionWatcherTimeout=class extends r{constructor(){super("TransactionWatcher has timed out")}};t.ErrExpectedTransactionStatusNotReached=class extends r{constructor(){super("Expected transaction status not reached")}};t.ErrExpectedTransactionEventsNotFound=class extends r{constructor(){super("Expected transaction events not found")}};class n extends r{constructor(e){super(e)}}t.ErrContract=n;t.ErrContractHasNoAddress=class extends n{constructor(){super("\nThe smart contract has no address set. Make sure you provide the address in the constructor, or call setAddress() appropriately.\nIf you need to recompute the address of the contract, make use of SmartContract.computeAddress() (static method). \n")}};t.ErrMock=class extends r{constructor(e){super(e)}};t.ErrTypingSystem=class extends r{constructor(e){super(e)}};t.ErrMissingFieldOnStruct=class extends r{constructor(e,t){super(`field ${e} does not exist on struct ${t}`)}};t.ErrMissingFieldOnEnum=class extends r{constructor(e,t){super(`field ${e} does not exist on enum ${t}`)}};t.ErrCannotParseContractResults=class extends r{constructor(e){super(`cannot parse contract results: ${e}`)}};t.ErrCannotParseTransactionOutcome=class extends r{constructor(e,t){super(`cannot parse outcome of transaction ${e}: ${t}`)}};t.ErrCodec=class extends r{constructor(e){super(e)}};t.ErrContractInteraction=class extends r{constructor(e){super(e)}};t.ErrNotImplemented=class extends r{constructor(){super("Method not yet implemented")}};t.ErrInvalidRelayedV1BuilderArguments=class extends r{constructor(){super("invalid arguments for relayed v1 builder")}};t.ErrInvalidRelayedV2BuilderArguments=class extends r{constructor(){super("invalid arguments for relayed v2 builder")}};t.ErrGasLimitShouldBe0ForInnerTransaction=class extends r{constructor(){super("gas limit must be 0 for the inner transaction for relayed v2")}};t.ErrIsCompletedFieldIsMissingOnTransaction=class extends r{constructor(){super("The transaction watcher requires the `isCompleted` property to be defined on the transaction object. Perhaps you've used the sdk-network-provider's `ProxyNetworkProvider.getTransaction()` and in that case you should also pass `withProcessStatus=true`.")}};t.ErrInvalidTokenIdentifier=class extends r{constructor(e){super(e)}};t.ErrBadUsage=class extends r{constructor(e){super(e)}};t.ErrInvalidInnerTransaction=class extends r{constructor(e){super(e)}};t.ErrParseTransactionOutcome=class extends r{constructor(e){super(e)}}},9342:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=void 0;const o=s(r(2581));class a{constructor(e){if(e)if(e instanceof Buffer)this.hash=e;else{if("string"!=typeof e)throw new o.ErrBadType("hash","buffer | string",e);this.hash=Buffer.from(e,"hex")}else this.hash=Buffer.from([])}static empty(){return new a(Buffer.from([]))}isEmpty(){return 0==this.hash.length}toString(){return this.hex()}hex(){return this.hash.toString("hex")}valueOf(){return this.hash}}t.Hash=a},6458:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.LogLevel=void 0,function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.None=5]="None"}(r=t.LogLevel||(t.LogLevel={}));class n{static setLevel(e){n.logLevel=e}static trace(e,...t){n.logLevel>=r.Debug||console.debug(e,t)}static debug(e,...t){n.logLevel>=r.Debug||console.debug(e,t)}static info(e,...t){n.logLevel>=r.Info||console.log(e,t)}static warn(e,...t){n.logLevel>=r.Warn||console.warn(e,t)}static error(e,...t){n.logLevel>=r.Error||console.error(e,t)}}t.Logger=n,n.logLevel=r.Debug},3500:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionOptions=t.TransactionVersion=void 0;const o=r(7353),a=s(r(2581));class u{constructor(e){if((e=Number(e))<1)throw new a.ErrTransactionVersionInvalid(e);this.value=e}static withDefaultVersion(){return new u(o.TRANSACTION_VERSION_DEFAULT)}static withTxOptions(){return new u(o.TRANSACTION_VERSION_DEFAULT)}valueOf(){return this.value}}t.TransactionVersion=u;class c{constructor(e){if((e=Number(e))<0)throw new a.ErrTransactionOptionsInvalid(e);this.value=e}static withDefaultOptions(){return new c(o.TRANSACTION_OPTIONS_DEFAULT)}static withOptions(e){let t=0;return e.hashSign&&(t|=o.TRANSACTION_OPTIONS_TX_HASH_SIGN),e.guarded&&(t|=o.TRANSACTION_OPTIONS_TX_GUARDED),new c(t)}isWithHashSign(){return(this.value&o.TRANSACTION_OPTIONS_TX_HASH_SIGN)==o.TRANSACTION_OPTIONS_TX_HASH_SIGN}isWithGuardian(){return(this.value&o.TRANSACTION_OPTIONS_TX_GUARDED)==o.TRANSACTION_OPTIONS_TX_GUARDED}setWithHashSign(){this.value|=o.TRANSACTION_OPTIONS_TX_HASH_SIGN}setWithGuardian(){this.value|=o.TRANSACTION_OPTIONS_TX_GUARDED}valueOf(){return this.value}}t.TransactionOptions=c},4330:function(e,t,r){var n,i,s;i=[r(6946)],void 0===(s="function"==typeof(n=function(e){var t,r=e.Reader,n=e.Writer,i=e.util,s=e.roots.default||(e.roots.default={});return s.proto=((t={}).Transaction=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.Nonce=i.Long?i.Long.fromBits(0,0,!0):0,t.prototype.Value=i.newBuffer([]),t.prototype.RcvAddr=i.newBuffer([]),t.prototype.RcvUserName=i.newBuffer([]),t.prototype.SndAddr=i.newBuffer([]),t.prototype.SndUserName=i.newBuffer([]),t.prototype.GasPrice=i.Long?i.Long.fromBits(0,0,!0):0,t.prototype.GasLimit=i.Long?i.Long.fromBits(0,0,!0):0,t.prototype.Data=i.newBuffer([]),t.prototype.ChainID=i.newBuffer([]),t.prototype.Version=0,t.prototype.Signature=i.newBuffer([]),t.prototype.Options=0,t.prototype.GuardianAddr=i.newBuffer([]),t.prototype.GuardianSignature=i.newBuffer([]),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=n.create()),null!=e.Nonce&&Object.hasOwnProperty.call(e,"Nonce")&&t.uint32(8).uint64(e.Nonce),null!=e.Value&&Object.hasOwnProperty.call(e,"Value")&&t.uint32(18).bytes(e.Value),null!=e.RcvAddr&&Object.hasOwnProperty.call(e,"RcvAddr")&&t.uint32(26).bytes(e.RcvAddr),null!=e.RcvUserName&&Object.hasOwnProperty.call(e,"RcvUserName")&&t.uint32(34).bytes(e.RcvUserName),null!=e.SndAddr&&Object.hasOwnProperty.call(e,"SndAddr")&&t.uint32(42).bytes(e.SndAddr),null!=e.SndUserName&&Object.hasOwnProperty.call(e,"SndUserName")&&t.uint32(50).bytes(e.SndUserName),null!=e.GasPrice&&Object.hasOwnProperty.call(e,"GasPrice")&&t.uint32(56).uint64(e.GasPrice),null!=e.GasLimit&&Object.hasOwnProperty.call(e,"GasLimit")&&t.uint32(64).uint64(e.GasLimit),null!=e.Data&&Object.hasOwnProperty.call(e,"Data")&&t.uint32(74).bytes(e.Data),null!=e.ChainID&&Object.hasOwnProperty.call(e,"ChainID")&&t.uint32(82).bytes(e.ChainID),null!=e.Version&&Object.hasOwnProperty.call(e,"Version")&&t.uint32(88).uint32(e.Version),null!=e.Signature&&Object.hasOwnProperty.call(e,"Signature")&&t.uint32(98).bytes(e.Signature),null!=e.Options&&Object.hasOwnProperty.call(e,"Options")&&t.uint32(104).uint32(e.Options),null!=e.GuardianAddr&&Object.hasOwnProperty.call(e,"GuardianAddr")&&t.uint32(114).bytes(e.GuardianAddr),null!=e.GuardianSignature&&Object.hasOwnProperty.call(e,"GuardianSignature")&&t.uint32(122).bytes(e.GuardianSignature),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof r||(e=r.create(e));for(var n=void 0===t?e.len:e.pos+t,i=new s.proto.Transaction;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:i.Nonce=e.uint64();break;case 2:i.Value=e.bytes();break;case 3:i.RcvAddr=e.bytes();break;case 4:i.RcvUserName=e.bytes();break;case 5:i.SndAddr=e.bytes();break;case 6:i.SndUserName=e.bytes();break;case 7:i.GasPrice=e.uint64();break;case 8:i.GasLimit=e.uint64();break;case 9:i.Data=e.bytes();break;case 10:i.ChainID=e.bytes();break;case 11:i.Version=e.uint32();break;case 12:i.Signature=e.bytes();break;case 13:i.Options=e.uint32();break;case 14:i.GuardianAddr=e.bytes();break;case 15:i.GuardianSignature=e.bytes();break;default:e.skipType(7&o)}}return i},t.decodeDelimited=function(e){return e instanceof r||(e=new r(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.Nonce&&e.hasOwnProperty("Nonce")&&!(i.isInteger(e.Nonce)||e.Nonce&&i.isInteger(e.Nonce.low)&&i.isInteger(e.Nonce.high))?"Nonce: integer|Long expected":null!=e.Value&&e.hasOwnProperty("Value")&&!(e.Value&&"number"==typeof e.Value.length||i.isString(e.Value))?"Value: buffer expected":null!=e.RcvAddr&&e.hasOwnProperty("RcvAddr")&&!(e.RcvAddr&&"number"==typeof e.RcvAddr.length||i.isString(e.RcvAddr))?"RcvAddr: buffer expected":null!=e.RcvUserName&&e.hasOwnProperty("RcvUserName")&&!(e.RcvUserName&&"number"==typeof e.RcvUserName.length||i.isString(e.RcvUserName))?"RcvUserName: buffer expected":null!=e.SndAddr&&e.hasOwnProperty("SndAddr")&&!(e.SndAddr&&"number"==typeof e.SndAddr.length||i.isString(e.SndAddr))?"SndAddr: buffer expected":null!=e.SndUserName&&e.hasOwnProperty("SndUserName")&&!(e.SndUserName&&"number"==typeof e.SndUserName.length||i.isString(e.SndUserName))?"SndUserName: buffer expected":null!=e.GasPrice&&e.hasOwnProperty("GasPrice")&&!(i.isInteger(e.GasPrice)||e.GasPrice&&i.isInteger(e.GasPrice.low)&&i.isInteger(e.GasPrice.high))?"GasPrice: integer|Long expected":null!=e.GasLimit&&e.hasOwnProperty("GasLimit")&&!(i.isInteger(e.GasLimit)||e.GasLimit&&i.isInteger(e.GasLimit.low)&&i.isInteger(e.GasLimit.high))?"GasLimit: integer|Long expected":null!=e.Data&&e.hasOwnProperty("Data")&&!(e.Data&&"number"==typeof e.Data.length||i.isString(e.Data))?"Data: buffer expected":null!=e.ChainID&&e.hasOwnProperty("ChainID")&&!(e.ChainID&&"number"==typeof e.ChainID.length||i.isString(e.ChainID))?"ChainID: buffer expected":null!=e.Version&&e.hasOwnProperty("Version")&&!i.isInteger(e.Version)?"Version: integer expected":null!=e.Signature&&e.hasOwnProperty("Signature")&&!(e.Signature&&"number"==typeof e.Signature.length||i.isString(e.Signature))?"Signature: buffer expected":null!=e.Options&&e.hasOwnProperty("Options")&&!i.isInteger(e.Options)?"Options: integer expected":null!=e.GuardianAddr&&e.hasOwnProperty("GuardianAddr")&&!(e.GuardianAddr&&"number"==typeof e.GuardianAddr.length||i.isString(e.GuardianAddr))?"GuardianAddr: buffer expected":null!=e.GuardianSignature&&e.hasOwnProperty("GuardianSignature")&&!(e.GuardianSignature&&"number"==typeof e.GuardianSignature.length||i.isString(e.GuardianSignature))?"GuardianSignature: buffer expected":null},t.fromObject=function(e){if(e instanceof s.proto.Transaction)return e;var t=new s.proto.Transaction;return null!=e.Nonce&&(i.Long?(t.Nonce=i.Long.fromValue(e.Nonce)).unsigned=!0:"string"==typeof e.Nonce?t.Nonce=parseInt(e.Nonce,10):"number"==typeof e.Nonce?t.Nonce=e.Nonce:"object"==typeof e.Nonce&&(t.Nonce=new i.LongBits(e.Nonce.low>>>0,e.Nonce.high>>>0).toNumber(!0))),null!=e.Value&&("string"==typeof e.Value?i.base64.decode(e.Value,t.Value=i.newBuffer(i.base64.length(e.Value)),0):e.Value.length>=0&&(t.Value=e.Value)),null!=e.RcvAddr&&("string"==typeof e.RcvAddr?i.base64.decode(e.RcvAddr,t.RcvAddr=i.newBuffer(i.base64.length(e.RcvAddr)),0):e.RcvAddr.length>=0&&(t.RcvAddr=e.RcvAddr)),null!=e.RcvUserName&&("string"==typeof e.RcvUserName?i.base64.decode(e.RcvUserName,t.RcvUserName=i.newBuffer(i.base64.length(e.RcvUserName)),0):e.RcvUserName.length>=0&&(t.RcvUserName=e.RcvUserName)),null!=e.SndAddr&&("string"==typeof e.SndAddr?i.base64.decode(e.SndAddr,t.SndAddr=i.newBuffer(i.base64.length(e.SndAddr)),0):e.SndAddr.length>=0&&(t.SndAddr=e.SndAddr)),null!=e.SndUserName&&("string"==typeof e.SndUserName?i.base64.decode(e.SndUserName,t.SndUserName=i.newBuffer(i.base64.length(e.SndUserName)),0):e.SndUserName.length>=0&&(t.SndUserName=e.SndUserName)),null!=e.GasPrice&&(i.Long?(t.GasPrice=i.Long.fromValue(e.GasPrice)).unsigned=!0:"string"==typeof e.GasPrice?t.GasPrice=parseInt(e.GasPrice,10):"number"==typeof e.GasPrice?t.GasPrice=e.GasPrice:"object"==typeof e.GasPrice&&(t.GasPrice=new i.LongBits(e.GasPrice.low>>>0,e.GasPrice.high>>>0).toNumber(!0))),null!=e.GasLimit&&(i.Long?(t.GasLimit=i.Long.fromValue(e.GasLimit)).unsigned=!0:"string"==typeof e.GasLimit?t.GasLimit=parseInt(e.GasLimit,10):"number"==typeof e.GasLimit?t.GasLimit=e.GasLimit:"object"==typeof e.GasLimit&&(t.GasLimit=new i.LongBits(e.GasLimit.low>>>0,e.GasLimit.high>>>0).toNumber(!0))),null!=e.Data&&("string"==typeof e.Data?i.base64.decode(e.Data,t.Data=i.newBuffer(i.base64.length(e.Data)),0):e.Data.length>=0&&(t.Data=e.Data)),null!=e.ChainID&&("string"==typeof e.ChainID?i.base64.decode(e.ChainID,t.ChainID=i.newBuffer(i.base64.length(e.ChainID)),0):e.ChainID.length>=0&&(t.ChainID=e.ChainID)),null!=e.Version&&(t.Version=e.Version>>>0),null!=e.Signature&&("string"==typeof e.Signature?i.base64.decode(e.Signature,t.Signature=i.newBuffer(i.base64.length(e.Signature)),0):e.Signature.length>=0&&(t.Signature=e.Signature)),null!=e.Options&&(t.Options=e.Options>>>0),null!=e.GuardianAddr&&("string"==typeof e.GuardianAddr?i.base64.decode(e.GuardianAddr,t.GuardianAddr=i.newBuffer(i.base64.length(e.GuardianAddr)),0):e.GuardianAddr.length>=0&&(t.GuardianAddr=e.GuardianAddr)),null!=e.GuardianSignature&&("string"==typeof e.GuardianSignature?i.base64.decode(e.GuardianSignature,t.GuardianSignature=i.newBuffer(i.base64.length(e.GuardianSignature)),0):e.GuardianSignature.length>=0&&(t.GuardianSignature=e.GuardianSignature)),t},t.toObject=function(e,t){t||(t={});var r={};if(t.defaults){if(i.Long){var n=new i.Long(0,0,!0);r.Nonce=t.longs===String?n.toString():t.longs===Number?n.toNumber():n}else r.Nonce=t.longs===String?"0":0;t.bytes===String?r.Value="":(r.Value=[],t.bytes!==Array&&(r.Value=i.newBuffer(r.Value))),t.bytes===String?r.RcvAddr="":(r.RcvAddr=[],t.bytes!==Array&&(r.RcvAddr=i.newBuffer(r.RcvAddr))),t.bytes===String?r.RcvUserName="":(r.RcvUserName=[],t.bytes!==Array&&(r.RcvUserName=i.newBuffer(r.RcvUserName))),t.bytes===String?r.SndAddr="":(r.SndAddr=[],t.bytes!==Array&&(r.SndAddr=i.newBuffer(r.SndAddr))),t.bytes===String?r.SndUserName="":(r.SndUserName=[],t.bytes!==Array&&(r.SndUserName=i.newBuffer(r.SndUserName))),i.Long?(n=new i.Long(0,0,!0),r.GasPrice=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.GasPrice=t.longs===String?"0":0,i.Long?(n=new i.Long(0,0,!0),r.GasLimit=t.longs===String?n.toString():t.longs===Number?n.toNumber():n):r.GasLimit=t.longs===String?"0":0,t.bytes===String?r.Data="":(r.Data=[],t.bytes!==Array&&(r.Data=i.newBuffer(r.Data))),t.bytes===String?r.ChainID="":(r.ChainID=[],t.bytes!==Array&&(r.ChainID=i.newBuffer(r.ChainID))),r.Version=0,t.bytes===String?r.Signature="":(r.Signature=[],t.bytes!==Array&&(r.Signature=i.newBuffer(r.Signature))),r.Options=0,t.bytes===String?r.GuardianAddr="":(r.GuardianAddr=[],t.bytes!==Array&&(r.GuardianAddr=i.newBuffer(r.GuardianAddr))),t.bytes===String?r.GuardianSignature="":(r.GuardianSignature=[],t.bytes!==Array&&(r.GuardianSignature=i.newBuffer(r.GuardianSignature)))}return null!=e.Nonce&&e.hasOwnProperty("Nonce")&&("number"==typeof e.Nonce?r.Nonce=t.longs===String?String(e.Nonce):e.Nonce:r.Nonce=t.longs===String?i.Long.prototype.toString.call(e.Nonce):t.longs===Number?new i.LongBits(e.Nonce.low>>>0,e.Nonce.high>>>0).toNumber(!0):e.Nonce),null!=e.Value&&e.hasOwnProperty("Value")&&(r.Value=t.bytes===String?i.base64.encode(e.Value,0,e.Value.length):t.bytes===Array?Array.prototype.slice.call(e.Value):e.Value),null!=e.RcvAddr&&e.hasOwnProperty("RcvAddr")&&(r.RcvAddr=t.bytes===String?i.base64.encode(e.RcvAddr,0,e.RcvAddr.length):t.bytes===Array?Array.prototype.slice.call(e.RcvAddr):e.RcvAddr),null!=e.RcvUserName&&e.hasOwnProperty("RcvUserName")&&(r.RcvUserName=t.bytes===String?i.base64.encode(e.RcvUserName,0,e.RcvUserName.length):t.bytes===Array?Array.prototype.slice.call(e.RcvUserName):e.RcvUserName),null!=e.SndAddr&&e.hasOwnProperty("SndAddr")&&(r.SndAddr=t.bytes===String?i.base64.encode(e.SndAddr,0,e.SndAddr.length):t.bytes===Array?Array.prototype.slice.call(e.SndAddr):e.SndAddr),null!=e.SndUserName&&e.hasOwnProperty("SndUserName")&&(r.SndUserName=t.bytes===String?i.base64.encode(e.SndUserName,0,e.SndUserName.length):t.bytes===Array?Array.prototype.slice.call(e.SndUserName):e.SndUserName),null!=e.GasPrice&&e.hasOwnProperty("GasPrice")&&("number"==typeof e.GasPrice?r.GasPrice=t.longs===String?String(e.GasPrice):e.GasPrice:r.GasPrice=t.longs===String?i.Long.prototype.toString.call(e.GasPrice):t.longs===Number?new i.LongBits(e.GasPrice.low>>>0,e.GasPrice.high>>>0).toNumber(!0):e.GasPrice),null!=e.GasLimit&&e.hasOwnProperty("GasLimit")&&("number"==typeof e.GasLimit?r.GasLimit=t.longs===String?String(e.GasLimit):e.GasLimit:r.GasLimit=t.longs===String?i.Long.prototype.toString.call(e.GasLimit):t.longs===Number?new i.LongBits(e.GasLimit.low>>>0,e.GasLimit.high>>>0).toNumber(!0):e.GasLimit),null!=e.Data&&e.hasOwnProperty("Data")&&(r.Data=t.bytes===String?i.base64.encode(e.Data,0,e.Data.length):t.bytes===Array?Array.prototype.slice.call(e.Data):e.Data),null!=e.ChainID&&e.hasOwnProperty("ChainID")&&(r.ChainID=t.bytes===String?i.base64.encode(e.ChainID,0,e.ChainID.length):t.bytes===Array?Array.prototype.slice.call(e.ChainID):e.ChainID),null!=e.Version&&e.hasOwnProperty("Version")&&(r.Version=e.Version),null!=e.Signature&&e.hasOwnProperty("Signature")&&(r.Signature=t.bytes===String?i.base64.encode(e.Signature,0,e.Signature.length):t.bytes===Array?Array.prototype.slice.call(e.Signature):e.Signature),null!=e.Options&&e.hasOwnProperty("Options")&&(r.Options=e.Options),null!=e.GuardianAddr&&e.hasOwnProperty("GuardianAddr")&&(r.GuardianAddr=t.bytes===String?i.base64.encode(e.GuardianAddr,0,e.GuardianAddr.length):t.bytes===Array?Array.prototype.slice.call(e.GuardianAddr):e.GuardianAddr),null!=e.GuardianSignature&&e.hasOwnProperty("GuardianSignature")&&(r.GuardianSignature=t.bytes===String?i.base64.encode(e.GuardianSignature,0,e.GuardianSignature.length):t.bytes===Array?Array.prototype.slice.call(e.GuardianSignature):e.GuardianSignature),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/proto.Transaction"},t}(),t),s})?n.apply(t,i):n)||(e.exports=s)},9277:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3325),t)},3325:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProtoSerializer=void 0;const a=o(r(1594)),u=r(236),c=r(7353),l=s(r(2581)),f=r(7553);t.ProtoSerializer=class{serializeTransaction(e){const t=r(4330).proto,n=new u.Address(e.getReceiver().bech32()).pubkey(),i=new u.Address(e.getSender().bech32()).pubkey();let s=new t.Transaction({Nonce:e.getNonce().valueOf()?e.getNonce().valueOf():void 0,Value:this.serializeTransactionValue(e.getValue()),RcvAddr:n,RcvUserName:e.getReceiverUsername()?Buffer.from(e.getReceiverUsername()).toString("base64"):void 0,SndAddr:i,SndUserName:e.getSenderUsername()?Buffer.from(e.getSenderUsername()).toString("base64"):void 0,GasPrice:e.getGasPrice().valueOf(),GasLimit:e.getGasLimit().valueOf(),Data:0==e.getData().length()?null:e.getData().valueOf(),ChainID:Buffer.from(e.getChainID().valueOf()),Version:e.getVersion().valueOf(),Signature:e.getSignature()});if(e.getOptions().valueOf()!==c.TRANSACTION_OPTIONS_DEFAULT&&(s.Options=e.getOptions().valueOf()),e.isGuardedTransaction()){const t=e.getGuardian();s.GuardianAddr=new u.Address(t.bech32()).pubkey(),s.GuardianSignature=e.getGuardianSignature()}const o=t.Transaction.encode(s).finish();return Buffer.from(o)}serializeTransactionValue(e){let t=new a.default(e.toString());if(t.isZero())return Buffer.from([0,0]);let r=f.bigIntToBuffer(t);return r=Buffer.concat([Buffer.from([0]),r]),r}deserializeTransaction(e){throw new l.ErrUnsupportedOperation("deserializeTransaction")}}},6063:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getJavascriptPrototypesInHierarchy=void 0,t.getJavascriptPrototypesInHierarchy=function(e,t){let r=[],n=Object.getPrototypeOf(e);for(;n&&t(n);)r.push(n),n=Object.getPrototypeOf(n);return r}},9874:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.interpretSignatureAsBuffer=t.Signature=void 0;const o=s(r(2581));class a{constructor(e){if(this.valueHex="",e)return"string"==typeof e?a.fromHex(e):e instanceof Buffer?a.fromBuffer(e):void 0}static empty(){return new a}static fromHex(e){if(e.startsWith("0x")&&(e=e.slice(2)),!a.isValidHex(e))throw new o.ErrSignatureCannotCreate(e);return a.fromValidHex(e)}static isValidHex(e){return 64==Buffer.from(e,"hex").length}static fromValidHex(e){let t=new a;return t.valueHex=e,t}static fromBuffer(e){if(64!=e.length)throw new o.ErrSignatureCannotCreate(e);return a.fromValidHex(e.toString("hex"))}hex(){return this.valueHex}}t.Signature=a,t.interpretSignatureAsBuffer=function(e){if(ArrayBuffer.isView(e))return Buffer.from(e);if(null!=e.hex)return Buffer.from(e.hex(),"hex");throw new Error(`Object cannot be interpreted as a signature: ${e}`)}},1157:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArgSerializer=void 0;const n=r(7353),i=r(9272),s=r(2747),o=r(1055),a=r(7472),u=r(6054),c={codec:new i.BinaryCodec};t.ArgSerializer=class{constructor(e){e={...c,...e},this.codec=e.codec}stringToValues(e,t){let r=this.stringToBuffers(e);return this.buffersToValues(r,t)}stringToBuffers(e){return e.split(n.ARGUMENTS_SEPARATOR).map((e=>Buffer.from(e,"hex")))}buffersToValues(e,t){const r=this;let n=[],i=0,c=(e=e||[]).length;for(let e=0;e<t.length;e++){let r=l(t[e].type);n.push(r)}function l(t){if(t.hasExactClass(o.OptionalType.ClassName)){const e=l(t.getFirstTypeParameter());return new o.OptionalValue(t,e)}if(t.hasExactClass(u.VariadicType.ClassName))return function(e){const t=e,r=[];if(t.isCounted){const t=l(new s.U32Type).valueOf().toNumber();for(let n=0;n<t;n++)r.push(l(e.getFirstTypeParameter()))}else for(;!f();)r.push(l(e.getFirstTypeParameter()));return new u.VariadicValue(t,r)}(t);if(t.hasExactClass(a.CompositeType.ClassName)){const e=[];for(const r of t.getTypeParameters())e.push(l(r));return new a.CompositeValue(t,e)}const n=function(t){if(f())return null;let n=e[i++],s=r.codec.decodeTopLevel(n,t);return s}(t);return n}function f(){return i>=c}return n}valuesToString(e){let t=this.valuesToStrings(e);return{argumentsString:t.join(n.ARGUMENTS_SEPARATOR),count:t.length}}valuesToStrings(e){return this.valuesToBuffers(e).map((e=>e.toString("hex")))}valuesToBuffers(e){const t=this,r=[];for(const t of e)n(t);function n(e){if(e.hasExactClass(o.OptionalValue.ClassName)){const t=e;return void(t.isSet()&&n(t.getTypedValue()))}if(e.hasExactClass(u.VariadicValue.ClassName))return void function(e){const i=e.getType();if(i.isCounted){const n=new s.U32Value(e.getItems().length);r.push(t.codec.encodeTopLevel(n))}for(const t of e.getItems())n(t)}(e);if(e.hasExactClass(a.CompositeValue.ClassName)){const t=e;for(const e of t.getItems())n(e);return}const i=t.codec.encodeTopLevel(e);r.push(i)}return r}}},6147:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentErrorContext=void 0;const n=r(2581);t.ArgumentErrorContext=class{constructor(e,t,r){this.endpointName=e,this.argumentIndex=t,this.parameterDefinition=r}throwError(e){throw new n.ErrInvalidArgument(`Error when converting arguments for endpoint (endpoint name: ${this.endpointName}, argument index: ${this.argumentIndex}, name: ${this.parameterDefinition.name}, type: ${this.parameterDefinition.type})\nNested error: ${e}`)}convertError(e,t){this.throwError(`Can't convert argument (argument: ${e}, type ${typeof e}), wanted type: ${t})`)}unhandledType(e,t){this.throwError(`Unhandled type (function: ${e}, type: ${t})`)}guardSameLength(e,t){(e=e||[]).length!=t.length&&this.throwError(`Incorrect composite type length: have ${e.length}, expected ${t.length} (argument: ${e})`)}guardHasField(e,t){t in(e=e||{})||this.throwError(`Struct argument does not contain a field named "${t}" (argument: ${JSON.stringify(e)})`)}}},8976:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Code=void 0;const n=r(2206);class i{constructor(e){this.hex=e}static fromBuffer(e){return new i(e.toString("hex"))}static fromHex(e){return new i(e)}toString(){return this.hex}valueOf(){return Buffer.from(this.hex,"hex")}computeHash(){const e=n(32).update(this.valueOf()).digest();return Buffer.from(e)}}t.Code=i},5225:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeMetadata=void 0;class r{constructor(e=!0,t=!1,r=!1,n=!1){this.upgradeable=e,this.readable=t,this.payable=r,this.payableBySc=n}static fromBytes(e){return r.fromBuffer(Buffer.from(e))}static fromBuffer(e){if(e.length<this.codeMetadataLength)throw new Error("Buffer is too short.");const t=e[0],n=e[1],i=0!=(t&r.ByteZero.Upgradeable),s=0!=(t&r.ByteZero.Readable),o=0!=(n&r.ByteOne.Payable),a=0!=(n&r.ByteOne.PayableBySc);return new r(i,s,o,a)}toggleUpgradeable(e){this.upgradeable=e}toggleReadable(e){this.readable=e}togglePayable(e){this.payable=e}togglePayableBySc(e){this.payableBySc=e}toBuffer(){let e=0,t=0;return this.upgradeable&&(e|=r.ByteZero.Upgradeable),this.readable&&(e|=r.ByteZero.Readable),this.payable&&(t|=r.ByteOne.Payable),this.payableBySc&&(t|=r.ByteOne.PayableBySc),Buffer.from([e,t])}toString(){return this.toBuffer().toString("hex")}toJSON(){return{upgradeable:this.upgradeable,readable:this.readable,payable:this.payable,payableBySc:this.payableBySc}}equals(e){return this.upgradeable==e.upgradeable&&this.readable==e.readable&&this.payable==e.payable&&this.payableBySc==e.payableBySc}}t.CodeMetadata=r,r.codeMetadataLength=2,r.ByteZero={Upgradeable:1,Reserved2:2,Readable:4},r.ByteOne={Reserved1:1,Payable:2,PayableBySc:4}},7648:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddressBinaryCodec=void 0;const n=r(236),i=r(2747);t.AddressBinaryCodec=class{decodeNested(e){let t=e.slice(0,32),r=new n.Address(t);return[new i.AddressValue(r),32]}decodeTopLevel(e){let[t,r]=this.decodeNested(e);return t}encodeNested(e){return e.valueOf().pubkey()}encodeTopLevel(e){return e.valueOf().pubkey()}}},2739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayVecBinaryCodec=void 0;const n=r(2747);t.ArrayVecBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){let r=t.length,i=t.getFirstTypeParameter(),s=[],o=0;for(let t=0;t<r;t++){let[t,r]=this.binaryCodec.decodeNested(e,i);s.push(t),o+=r,e=e.slice(r)}return[new n.ArrayVec(t,s),o]}decodeTopLevel(e,t){let[r,n]=this.decodeNested(e,t);return r}encodeNested(e){let t=[];for(const r of e.getItems()){let e=this.binaryCodec.encodeNested(r);t.push(e)}return Buffer.concat(t)}encodeTopLevel(e){return this.encodeNested(e)}}},675:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BinaryCodecConstraints=t.BinaryCodec=void 0;const o=s(r(2581)),a=r(2747),u=r(1069),c=r(9603),l=r(8673),f=r(82),d=r(3551),h=r(6855),g=r(8954),p=r(2739);t.BinaryCodec=class{constructor(e=null){this.constraints=e||new m,this.optionCodec=new c.OptionValueBinaryCodec(this),this.listCodec=new f.ListBinaryCodec(this),this.arrayCodec=new p.ArrayVecBinaryCodec(this),this.primitiveCodec=new l.PrimitiveBinaryCodec(this),this.structCodec=new d.StructBinaryCodec(this),this.tupleCodec=new g.TupleBinaryCodec(this),this.enumCodec=new h.EnumBinaryCodec(this)}decodeTopLevel(e,t){return this.constraints.checkBufferLength(e),a.onTypeSelect(t,{onOption:()=>this.optionCodec.decodeTopLevel(e,t.getFirstTypeParameter()),onList:()=>this.listCodec.decodeTopLevel(e,t),onArray:()=>this.arrayCodec.decodeTopLevel(e,t),onPrimitive:()=>this.primitiveCodec.decodeTopLevel(e,t),onStruct:()=>this.structCodec.decodeTopLevel(e,t),onTuple:()=>this.tupleCodec.decodeTopLevel(e,t),onEnum:()=>this.enumCodec.decodeTopLevel(e,t)})}decodeNested(e,t){this.constraints.checkBufferLength(e);let[r,n]=a.onTypeSelect(t,{onOption:()=>this.optionCodec.decodeNested(e,t.getFirstTypeParameter()),onList:()=>this.listCodec.decodeNested(e,t),onArray:()=>this.arrayCodec.decodeNested(e,t),onPrimitive:()=>this.primitiveCodec.decodeNested(e,t),onStruct:()=>this.structCodec.decodeNested(e,t),onTuple:()=>this.tupleCodec.decodeNested(e,t),onEnum:()=>this.enumCodec.decodeNested(e,t)});return[r,n]}encodeNested(e){return u.guardTrue(e.getType().getCardinality().isSingular(),"singular cardinality, thus encodable type"),a.onTypedValueSelect(e,{onPrimitive:()=>this.primitiveCodec.encodeNested(e),onOption:()=>this.optionCodec.encodeNested(e),onList:()=>this.listCodec.encodeNested(e),onArray:()=>this.arrayCodec.encodeNested(e),onStruct:()=>this.structCodec.encodeNested(e),onTuple:()=>this.tupleCodec.encodeNested(e),onEnum:()=>this.enumCodec.encodeNested(e)})}encodeTopLevel(e){return u.guardTrue(e.getType().getCardinality().isSingular(),"singular cardinality, thus encodable type"),a.onTypedValueSelect(e,{onPrimitive:()=>this.primitiveCodec.encodeTopLevel(e),onOption:()=>this.optionCodec.encodeTopLevel(e),onList:()=>this.listCodec.encodeTopLevel(e),onArray:()=>this.arrayCodec.encodeTopLevel(e),onStruct:()=>this.structCodec.encodeTopLevel(e),onTuple:()=>this.tupleCodec.encodeTopLevel(e),onEnum:()=>this.enumCodec.encodeTopLevel(e)})}};class m{constructor(e){this.maxBufferLength=e?.maxBufferLength||256e3,this.maxListLength=e?.maxListLength||128e3}checkBufferLength(e){if(e.length>this.maxBufferLength)throw new o.ErrCodec(`Buffer too large: ${e.length} > ${this.maxBufferLength}`)}checkListLength(e){if(e>this.maxListLength)throw new o.ErrCodec(`List too large: ${e} > ${this.maxListLength}`)}}t.BinaryCodecConstraints=m},3232:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBigNumber=t.decodeString=t.decodeBool=t.decodeUnsignedNumber=void 0;const i=n(r(1594)),s=r(2747),o=new(r(675).BinaryCodec);t.decodeUnsignedNumber=function(e){let t=o.decodeTopLevel(e,new s.BigUIntType);return Number(t.valueOf())},t.decodeBool=function(e){let t=o.decodeTopLevel(e,new s.BooleanType);return Boolean(t.valueOf())},t.decodeString=function(e){let t=o.decodeTopLevel(e,new s.BytesType);return String(t.valueOf())},t.decodeBigNumber=function(e){let t=o.decodeTopLevel(e,new s.BigUIntType);return new i.default(t.valueOf())}},7380:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanBinaryCodec=void 0;const o=s(r(2581)),a=r(2747);class u{decodeNested(e){let t=e.readUInt8(0);return[new a.BooleanValue(t==u.TRUE),1]}decodeTopLevel(e){if(e.length>1)throw new o.ErrInvalidArgument("buffer should be of size <= 1");let t=e[0];return new a.BooleanValue(t==u.TRUE)}encodeNested(e){return e.isTrue()?Buffer.from([u.TRUE]):Buffer.from([u.FALSE])}encodeTopLevel(e){return e.isTrue()?Buffer.from([u.TRUE]):Buffer.from([])}}t.BooleanBinaryCodec=u,u.TRUE=1,u.FALSE=0},8843:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BytesBinaryCodec=void 0;const n=r(1392),i=r(2461);t.BytesBinaryCodec=class{decodeNested(e){let t=e.readUInt32BE(0),r=e.slice(i.SizeOfU32,i.SizeOfU32+t);return[new n.BytesValue(r),i.SizeOfU32+t]}decodeTopLevel(e){return new n.BytesValue(e)}encodeNested(e){let t=Buffer.alloc(i.SizeOfU32);return t.writeUInt32BE(e.getLength()),Buffer.concat([t,e.valueOf()])}encodeTopLevel(e){return e.valueOf()}}},2461:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SizeOfU32=void 0,t.SizeOfU32=4},6855:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EnumBinaryCodec=void 0;const n=r(2747),i=r(9995);t.EnumBinaryCodec=class{constructor(e){this.binaryCodec=e,this.fieldsCodec=new i.FieldsBinaryCodec(e)}decodeTopLevel(e,t){let[r]=this.decodeNested(e,t);return r}decodeNested(e,t){let[r,i]=this.readDiscriminant(e);e=e.slice(i);let s=t.getVariantByDiscriminant(r),o=s.getFieldsDefinitions(),[a,u]=this.fieldsCodec.decodeNested(e,o);return[new n.EnumValue(t,s,a),i+u]}readDiscriminant(e){let[t,r]=this.binaryCodec.decodeNested(e,new n.U8Type);return[t.valueOf(),r]}encodeNested(e){let t=new n.U8Value(e.discriminant),r=this.binaryCodec.encodeNested(t),i=e.getFields(),s=this.fieldsCodec.encodeNested(i);return Buffer.concat([r,s])}encodeTopLevel(e){let t=e.getFields(),r=t.length>0,i=this.fieldsCodec.encodeNested(t),s=new n.U8Value(e.discriminant),o=r?this.binaryCodec.encodeNested(s):this.binaryCodec.encodeTopLevel(s);return Buffer.concat([o,i])}}},9995:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FieldsBinaryCodec=void 0;const n=r(2747);t.FieldsBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){let r=[],i=0;for(const s of t){let[t,o]=this.binaryCodec.decodeNested(e,s.type);e=e.slice(o),i+=o;let a=new n.Field(t,s.name);r.push(a)}return[r,i]}encodeNested(e){let t=[];for(const r of e){let e=this.binaryCodec.encodeNested(r.value);t.push(e)}return Buffer.concat(t)}}},8831:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.H256BinaryCodec=void 0;const n=r(1038);t.H256BinaryCodec=class{decodeNested(e){let t=e.slice(0,32);return[new n.H256Value(t),32]}decodeTopLevel(e){let[t,r]=this.decodeNested(e);return t}encodeNested(e){return e.valueOf()}encodeTopLevel(e){return e.valueOf()}}},9272:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(675),t),i(r(3232),t)},82:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ListBinaryCodec=void 0;const n=r(2747),i=r(2461);t.ListBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){let r=t.getFirstTypeParameter(),s=[],o=e.readUInt32BE(0);this.binaryCodec.constraints.checkListLength(o);let a=e,u=i.SizeOfU32;e=a.slice(u);for(let t=0;t<o;t++){let[t,n]=this.binaryCodec.decodeNested(e,r);s.push(t),u+=n,e=a.slice(u)}return[new n.List(t,s),u]}decodeTopLevel(e,t){let r=t.getFirstTypeParameter(),i=[],s=e,o=0;for(;e.length>0;){let[t,n]=this.binaryCodec.decodeNested(e,r);i.push(t),o+=n,e=s.slice(o),this.binaryCodec.constraints.checkListLength(i.length)}return new n.List(t,i)}encodeNested(e){this.binaryCodec.constraints.checkListLength(e.getLength());let t=Buffer.alloc(i.SizeOfU32);t.writeUInt32BE(e.getLength());let r=[];for(const t of e.getItems()){let e=this.binaryCodec.encodeNested(t);r.push(e)}return Buffer.concat([t,...r])}encodeTopLevel(e){this.binaryCodec.constraints.checkListLength(e.getLength());let t=[];for(const r of e.getItems()){let e=this.binaryCodec.encodeNested(r);t.push(e)}return Buffer.concat(t)}}},3157:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NothingCodec=void 0;const n=r(2747);t.NothingCodec=class{decodeNested(){return[new n.NothingValue,0]}decodeTopLevel(){return new n.NothingValue}encodeNested(){return Buffer.from([])}encodeTopLevel(){return Buffer.from([])}}},62:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NumericalBinaryCodec=void 0;const i=n(r(1594)),s=r(2747),o=r(2461),a=r(7553);t.NumericalBinaryCodec=class{decodeNested(e,t){let r=0,n=t.sizeInBytes;n||(r=o.SizeOfU32,n=e.readUInt32BE(0));let i=e.slice(r,r+n);return[this.decodeTopLevel(i,t),n+r]}decodeTopLevel(e,t){let r=a.cloneBuffer(e);if(0==e.length)return new s.NumericalValue(t,new i.default(0));if(!t.withSign||a.isMsbZero(r)){let e=a.bufferToBigInt(r);return new s.NumericalValue(t,e)}a.flipBufferBitsInPlace(r);let n=a.bufferToBigInt(r).multipliedBy(new i.default(-1)).minus(new i.default(1));return new s.NumericalValue(t,n)}encodeNested(e){if(e.sizeInBytes)return this.encodeNestedFixedSize(e,e.sizeInBytes);let t=this.encodeTopLevel(e),r=Buffer.alloc(o.SizeOfU32);return r.writeUInt32BE(t.length),Buffer.concat([r,t])}encodeNestedFixedSize(e,t){if(e.value.isZero())return Buffer.alloc(t,0);if(!e.withSign){const r=a.bigIntToBuffer(e.value),n=Buffer.alloc(t-r.length,0);return Buffer.concat([n,r])}if(e.value.isPositive()){let r=a.bigIntToBuffer(e.value);a.isMsbOne(r)&&(r=a.prependByteToBuffer(r,0));const n=Buffer.alloc(t-r.length,0);return Buffer.concat([n,r])}let r=e.value.plus(new i.default(1)),n=a.bigIntToBuffer(r);a.flipBufferBitsInPlace(n),a.isMsbZero(n)&&(n=a.prependByteToBuffer(n,255));const s=Buffer.alloc(t-n.length,255);return Buffer.concat([s,n])}encodeTopLevel(e){let t=e.withSign;return e.value.isZero()?Buffer.alloc(0):t?this.encodePrimitive(e):a.bigIntToBuffer(e.value)}encodePrimitive(e){if(e.value.isPositive()){let t=a.bigIntToBuffer(e.value);return a.isMsbOne(t)&&(t=a.prependByteToBuffer(t,0)),t}let t=e.value.plus(new i.default(1)),r=a.bigIntToBuffer(t);return a.flipBufferBitsInPlace(r),a.isMsbZero(r)&&(r=a.prependByteToBuffer(r,255)),r}}},9603:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.OptionValueBinaryCodec=void 0;const o=s(r(2581)),a=r(2747);t.OptionValueBinaryCodec=class{constructor(e){this.binaryCodec=e}decodeNested(e,t){if(0==e[0])return[a.OptionValue.newMissingTyped(t),1];if(1!=e[0])throw new o.ErrCodec("invalid buffer for optional value");let[r,n]=this.binaryCodec.decodeNested(e.slice(1),t);return[a.OptionValue.newProvided(r),n+1]}decodeTopLevel(e,t){if(0==e.length)return new a.OptionValue(t);if(1!=e[0])throw new o.ErrCodec("invalid buffer for optional value");let[r,n]=this.binaryCodec.decodeNested(e.slice(1),t);return new a.OptionValue(t,r)}encodeNested(e){return e.isSet()?Buffer.concat([Buffer.from([1]),this.binaryCodec.encodeNested(e.getTypedValue())]):Buffer.from([0])}encodeTopLevel(e){return e.isSet()?Buffer.concat([Buffer.from([1]),this.binaryCodec.encodeNested(e.getTypedValue())]):Buffer.from([])}}},8673:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrimitiveBinaryCodec=void 0;const n=r(2747),i=r(7648),s=r(7380),o=r(62),a=r(8831),u=r(8843),c=r(6714),l=r(3157),f=r(1367);t.PrimitiveBinaryCodec=class{constructor(e){this.binaryCodec=e,this.booleanCodec=new s.BooleanBinaryCodec,this.numericalCodec=new o.NumericalBinaryCodec,this.addressCodec=new i.AddressBinaryCodec,this.h256Codec=new a.H256BinaryCodec,this.bytesCodec=new u.BytesBinaryCodec,this.stringCodec=new f.StringBinaryCodec,this.tokenIdentifierCodec=new c.TokenIdentifierCodec,this.nothingCodec=new l.NothingCodec}decodeNested(e,t){return n.onPrimitiveTypeSelect(t,{onBoolean:()=>this.booleanCodec.decodeNested(e),onNumerical:()=>this.numericalCodec.decodeNested(e,t),onAddress:()=>this.addressCodec.decodeNested(e),onBytes:()=>this.bytesCodec.decodeNested(e),onString:()=>this.stringCodec.decodeNested(e),onH256:()=>this.h256Codec.decodeNested(e),onTokenIndetifier:()=>this.tokenIdentifierCodec.decodeNested(e),onNothing:()=>this.nothingCodec.decodeNested()})}decodeTopLevel(e,t){return n.onPrimitiveTypeSelect(t,{onBoolean:()=>this.booleanCodec.decodeTopLevel(e),onNumerical:()=>this.numericalCodec.decodeTopLevel(e,t),onAddress:()=>this.addressCodec.decodeTopLevel(e),onBytes:()=>this.bytesCodec.decodeTopLevel(e),onString:()=>this.stringCodec.decodeTopLevel(e),onH256:()=>this.h256Codec.decodeTopLevel(e),onTokenIndetifier:()=>this.tokenIdentifierCodec.decodeTopLevel(e),onNothing:()=>this.nothingCodec.decodeTopLevel()})}encodeNested(e){return n.onPrimitiveValueSelect(e,{onBoolean:()=>this.booleanCodec.encodeNested(e),onNumerical:()=>this.numericalCodec.encodeNested(e),onAddress:()=>this.addressCodec.encodeNested(e),onBytes:()=>this.bytesCodec.encodeNested(e),onString:()=>this.stringCodec.encodeNested(e),onH256:()=>this.h256Codec.encodeNested(e),onTypeIdentifier:()=>this.tokenIdentifierCodec.encodeNested(e),onNothing:()=>this.nothingCodec.encodeNested()})}encodeTopLevel(e){return n.onPrimitiveValueSelect(e,{onBoolean:()=>this.booleanCodec.encodeTopLevel(e),onNumerical:()=>this.numericalCodec.encodeTopLevel(e),onAddress:()=>this.addressCodec.encodeTopLevel(e),onBytes:()=>this.bytesCodec.encodeTopLevel(e),onString:()=>this.stringCodec.encodeTopLevel(e),onH256:()=>this.h256Codec.encodeTopLevel(e),onTypeIdentifier:()=>this.tokenIdentifierCodec.encodeTopLevel(e),onNothing:()=>this.nothingCodec.encodeTopLevel()})}}},1367:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringBinaryCodec=void 0;const n=r(2747),i=r(1392),s=r(8843);t.StringBinaryCodec=class{constructor(){this.bytesBinaryCodec=new s.BytesBinaryCodec}decodeNested(e){let[t,r]=this.bytesBinaryCodec.decodeNested(e);return[new n.StringValue(t.valueOf().toString()),r]}decodeTopLevel(e){return new n.StringValue(e.toString())}encodeNested(e){let t=i.BytesValue.fromUTF8(e.valueOf());return this.bytesBinaryCodec.encodeNested(t)}encodeTopLevel(e){return Buffer.from(e.valueOf())}}},3551:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StructBinaryCodec=void 0;const n=r(2747),i=r(9995);t.StructBinaryCodec=class{constructor(e){this.fieldsCodec=new i.FieldsBinaryCodec(e)}decodeTopLevel(e,t){let[r]=this.decodeNested(e,t);return r}decodeNested(e,t){let r=t.getFieldsDefinitions(),[i,s]=this.fieldsCodec.decodeNested(e,r);return[new n.Struct(t,i),s]}encodeNested(e){let t=e.getFields();return this.fieldsCodec.encodeNested(t)}encodeTopLevel(e){return this.encodeNested(e)}}},6714:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TokenIdentifierCodec=void 0;const n=r(1392),i=r(3145),s=r(8843);t.TokenIdentifierCodec=class{constructor(){this.bytesCodec=new s.BytesBinaryCodec}decodeNested(e){let[t,r]=this.bytesCodec.decodeNested(e);return[new i.TokenIdentifierValue(t.toString()),r]}decodeTopLevel(e){let t=this.bytesCodec.decodeTopLevel(e);return new i.TokenIdentifierValue(t.toString())}encodeNested(e){let t=n.BytesValue.fromUTF8(e.valueOf());return this.bytesCodec.encodeNested(t)}encodeTopLevel(e){return Buffer.from(e.valueOf())}}},8954:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TupleBinaryCodec=void 0;const n=r(3551);t.TupleBinaryCodec=class{constructor(e){this.structCodec=new n.StructBinaryCodec(e)}decodeTopLevel(e,t){return this.structCodec.decodeTopLevel(e,t)}decodeNested(e,t){return this.structCodec.decodeNested(e,t)}encodeNested(e){return this.structCodec.encodeNested(e)}encodeTopLevel(e){return this.structCodec.encodeTopLevel(e)}}},7553:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.prependByteToBuffer=t.flipBufferBitsInPlace=t.getHexMagnitudeOfBigInt=t.bigIntToBuffer=t.bufferToBigInt=t.cloneBuffer=t.isMsbZero=t.isMsbOne=void 0;const i=n(r(1594)),s=r(9161);function o(e,t=0){return 1==e[t]>>7}function a(e){return(e=new i.default(e))?(e.isNegative()&&(e=e.multipliedBy(new i.default(-1))),s.numberToPaddedHex(e)):""}t.isMsbOne=o,t.isMsbZero=function(e,t=0){return!o(e,t)},t.cloneBuffer=function(e){let t=Buffer.alloc(e.length);return e.copy(t),t},t.bufferToBigInt=function(e){let t=e.toString("hex");return new i.default(`0x${t}`,16)},t.bigIntToBuffer=function(e){let t=a(e);return Buffer.from(t,"hex")},t.getHexMagnitudeOfBigInt=a,t.flipBufferBitsInPlace=function(e){for(let t=0;t<e.length;t++)e[t]=~e[t]},t.prependByteToBuffer=function(e,t){return Buffer.concat([Buffer.from([t]),e])}},3685:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractFunction=void 0;const o=s(r(2581));class a{constructor(e){if(this.name=e,null==e)throw new o.ErrInvalidFunctionName}static none(){return new a("untitled")}toString(){return this.name}valueOf(){return this.name}}t.ContractFunction=a},661:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1157),t),i(r(8976),t),i(r(9272),t),i(r(5225),t),i(r(3685),t),i(r(1945),t),i(r(1146),t),i(r(662),t),i(r(670),t),i(r(7453),t),i(r(2528),t),i(r(3462),t),i(r(1998),t),i(r(7331),t),i(r(2747),t)},1945:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Interaction=void 0;const n=r(236),i=r(1220),s=r(7353),o=r(5132),a=r(3102),u=r(1146),c=r(7453);t.Interaction=class{constructor(e,t,r){this.nonce=0,this.value="0",this.gasLimit=0,this.gasPrice=void 0,this.chainID="",this.querent=n.Address.empty(),this.sender=n.Address.empty(),this.version=s.TRANSACTION_VERSION_DEFAULT,this.contract=e,this.function=t,this.args=r,this.tokenTransfers=[]}getContractAddress(){return this.contract.getAddress()}getFunction(){return this.function}getEndpoint(){return this.contract.getEndpoint(this.function)}getArguments(){return this.args}getValue(){return this.value}getTokenTransfers(){return this.tokenTransfers}getGasLimit(){return this.gasLimit}getExplicitReceiver(){return this.explicitReceiver}buildTransaction(){i.Compatibility.guardAddressIsSetAndNonZero(this.sender,"'sender' of interaction","use interaction.withSender()");const e=new a.TransactionsFactoryConfig({chainID:this.chainID.valueOf()}),t=new a.SmartContractTransactionsFactory({config:e}).createTransactionForExecute({sender:this.sender,contract:this.contract.getAddress(),function:this.function.valueOf(),gasLimit:BigInt(this.gasLimit.valueOf()),arguments:this.args,nativeTransferAmount:BigInt(this.value.toString()),tokenTransfers:this.tokenTransfers});return t.chainID=this.chainID.valueOf(),t.nonce=BigInt(this.nonce.valueOf()),t.version=this.version,this.gasPrice&&(t.gasPrice=BigInt(this.gasPrice.valueOf())),t}buildQuery(){return new c.Query({address:this.contract.getAddress(),func:this.function,args:this.args,value:this.value,caller:this.querent})}withValue(e){return this.value=e,this}withSingleESDTTransfer(e){return this.tokenTransfers=[e].map((e=>new o.TokenTransfer(e))),this}withSingleESDTNFTTransfer(e){return this.tokenTransfers=[e].map((e=>new o.TokenTransfer(e))),this}withMultiESDTNFTTransfer(e){return this.tokenTransfers=e.map((e=>new o.TokenTransfer(e))),this}withGasLimit(e){return this.gasLimit=e,this}withGasPrice(e){return this.gasPrice=e,this}withNonce(e){return this.nonce=e,this}useThenIncrementNonceOf(e){return this.withNonce(e.getNonceThenIncrement())}withChainID(e){return this.chainID=e,this}withSender(e){return this.sender=e,this}withVersion(e){return this.version=e,this}withQuerent(e){return this.querent=e,this}withExplicitReceiver(e){return this.explicitReceiver=e,this}check(){return(new u.InteractionChecker).checkInteraction(this,this.getEndpoint()),this}}},1146:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InteractionChecker=void 0;const a=s(r(2581)),u=o(r(1594));t.InteractionChecker=class{checkInteraction(e,t){this.checkPayable(e,t),this.checkArguments(e,t)}checkPayable(e,t){let r=!new u.default(e.getValue().toString()).isZero(),n=t.modifiers.isPayableInEGLD();if(r&&!n)throw new a.ErrContractInteraction("cannot send EGLD value to non-payable")}checkArguments(e,t){let r=t.input,n=e.getArguments(),i=r.length,s=n.length;if(i!=s)throw new a.ErrContractInteraction(`bad arguments, expected: ${i}, got: ${s}`);for(let e=0;e<i;e++){let t=r[e].type,i=n[e].getType();if(!t.isAssignableFrom(i))throw new a.ErrContractInteraction(`type mismatch at index ${e}, expected: ${t}, got: ${i}`)}}}},662:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},670:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeSerializer=void 0;const i=n(r(1594)),s=r(236),o=r(2581),a=r(9161),u=r(6147),c=r(2747);!function(e){function t(e){let t=[...e].reverse(),r=e.length,n=e.length,i=!1;t.length>0&&t[0].type.getCardinality().isComposite()&&(n=1/0,i=!0);for(let e of t){if(e.type.getCardinality().isSingular())break;r-=1}return{min:r,max:n,variadic:i}}function r(e,t,s){return e&&e.belongsToTypesystem?e:t instanceof c.OptionType?function(e,t,n){if(null==e)return c.OptionValue.newMissing();let i=r(e,t.getFirstTypeParameter(),n);return c.OptionValue.newProvided(i)}(e,t,s):t instanceof c.OptionalType?function(e,t,n){if(null==e)return new c.OptionalValue(t);let i=r(e,t.getFirstTypeParameter(),n);return new c.OptionalValue(t,i)}(e,t,s):t instanceof c.VariadicType?function(e,t,n){if(t.isCounted)throw new o.ErrInvalidArgument('Counted variadic arguments must be explicitly typed. E.g. use "VariadicValue.fromItemsCounted()" or "new VariadicValue()"');null==e&&(e=[]);void 0===e.map&&n.convertError(e,"Variadic");let i=e.map((function(e){return r(e,t.getFirstTypeParameter(),n)}));return new c.VariadicValue(t,i)}(e,t,s):t instanceof c.CompositeType?function(e,t,n){let i=[],s=t.getTypeParameters();n.guardSameLength(e,s);for(let t=0;t<s.length;t++)i.push(r(e[t],s[t],n));return new c.CompositeValue(t,i)}(e,t,s):t instanceof c.TupleType?function(e,t,n){let i=[];const s=t.getFieldsDefinitions();n.guardSameLength(e,s);for(let t=0;t<s.length;t++)i.push(r(e[t],s[t].type,n));return c.Tuple.fromItems(i)}(e,t,s):t instanceof c.StructType?function(e,t,n){let i=[];const s=t.getFieldsDefinitions();for(let t=0;t<s.length;t++){const o=s[t].name;n.guardHasField(e,o);const a=r(e[o],s[t].type,n);i.push(new c.Field(a,o))}return new c.Struct(t,i)}(e,t,s):t instanceof c.ListType?function(e,t,n){void 0===e.map&&n.convertError(e,"List");let i=e.map((function(e){return r(e,t.getFirstTypeParameter(),n)}));return new c.List(t,i)}(e,t,s):t instanceof c.PrimitiveType?function(e,t,r){if(t instanceof c.NumericalType){return function(e,t,r){switch(t.constructor){case c.U8Type:return new c.U8Value(e);case c.I8Type:return new c.I8Value(e);case c.U16Type:return new c.U16Value(e);case c.I16Type:return new c.I16Value(e);case c.U32Type:return new c.U32Value(e);case c.I32Type:return new c.I32Value(e);case c.U64Type:return new c.U64Value(e);case c.I64Type:return new c.I64Value(e);case c.BigUIntType:return new c.BigUIntValue(e);case c.BigIntType:return new c.BigIntValue(e);default:r.unhandledType("convertNumericalType",t)}}(new i.default(e),t,r)}if(t instanceof c.BytesType)return function(e,t){const r=e.valueOf();void 0===e&&t.convertError(e,"BytesValue");if(e instanceof Buffer)return new c.BytesValue(e);if("string"==typeof e)return c.BytesValue.fromUTF8(e);if(r instanceof Buffer)return new c.BytesValue(r);if("number"==typeof r)return c.BytesValue.fromHex(a.numberToPaddedHex(r));t.convertError(e,"BytesValue")}(e,r);if(t instanceof c.AddressType)return new c.AddressValue(n(e,r));if(t instanceof c.BooleanType)return new c.BooleanValue(e);if(t instanceof c.TokenIdentifierType)return new c.TokenIdentifierValue(function(e,t){void 0===e&&t.convertError(e,"Buffer");if(e instanceof Buffer)return e.toString();if("string"==typeof e)return e;t.convertError(e,"Buffer")}(e,r));r.throwError(`(function: toPrimitive) unsupported type ${t}`)}(e,t,s):t instanceof c.EnumType?function(e,t,n){if("number"==typeof e)return c.EnumValue.fromDiscriminant(t,e);if("string"==typeof e)return c.EnumValue.fromName(t,e);if("object"==typeof e){n.guardHasField(e,"name");const i=t.getVariantByName(e.name);n.guardHasField(e,"fields");const s=e.fields,o=[],a=i.getFieldsDefinitions();for(let e=0;e<a.length;e++){const t=a[e].name;n.guardHasField(s,t);const i=r(s[t],a[e].type,n);o.push(new c.Field(i,t))}return new c.EnumValue(t,i,o)}n.throwError("(function: toEnumValue) unsupported native type "+typeof e)}(e,t,s):void s.throwError(`convertToTypedValue: unhandled type ${t}`)}function n(e,t){if(e.bech32)return e;if(e.getAddress)return e.getAddress();switch(e.constructor){case Buffer:case String:return new s.Address(e);default:t.convertError(e,"Address")}}e.nativeToTypedValues=function(e,n){(function(e,r){const{min:n,max:i}=t(r.input);if(!(n<=e.length&&e.length<=i))throw new o.ErrInvalidArgument(`Wrong number of arguments for endpoint ${r.name}: expected between ${n} and ${i} arguments, have ${e.length}`)})(e=e||[],n),function(e){const t=e.input[e.input.length-1];return t?.type instanceof c.VariadicType&&!t.type.isCounted}(n)&&(e=function(e,t){const r=t.input.length-1,n=e[r];if(n?.belongsToTypesystem){if(!n.hasClassOrSuperclass(c.VariadicValue.ClassName))throw new o.ErrInvalidArgument(`Wrong argument type for endpoint ${t.name}: typed value provided; expected variadic type, have ${n.getClassName()}`)}else e[r]=e.slice(r);return e}(e,n));let i=n.input,s=[];for(let t=0;t<i.length;t++){let o=i[t],a=new u.ArgumentErrorContext(n.name,t,o),c=r(e[t],o.type,a);s.push(c)}return s},e.getArgumentsCardinality=t,e.convertNativeToAddress=n}(t.NativeSerializer||(t.NativeSerializer={}))},7453:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Query=void 0;const n=r(236),i=r(1157);t.Query=class{constructor(e){this.caller=e.caller||n.Address.empty(),this.address=e.address,this.func=e.func,this.args=e.args||[],this.value=e.value||0}getEncodedArguments(){return(new i.ArgSerializer).valuesToStrings(this.args)}}},2528:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResultsParser=void 0;const n=r(2866),i=r(236),s=r(2581),o=r(6458),a=r(1157),u=r(3462);var c,l;!function(e){e.OnTransactionCompleted="completedTxEvent",e.OnSignalError="signalError",e.OnWriteLog="writeLog"}(c||(c={})),function(e){e.TooMuchGas="@too much gas provided for processing"}(l||(l={}));const f={argsSerializer:new a.ArgSerializer};t.ResultsParser=class{constructor(e){e={...f,...e},this.argsSerializer=e.argsSerializer}parseQueryResponse(e,t){let r=e.getReturnDataParts(),n=this.argsSerializer.buffersToValues(r,t.output);return{returnCode:new u.ReturnCode(e.returnCode.toString()),returnMessage:e.returnMessage,values:n,firstValue:n[0],secondValue:n[1],thirdValue:n[2],lastValue:n[n.length-1]}}parseUntypedQueryResponse(e){return{returnCode:new u.ReturnCode(e.returnCode.toString()),returnMessage:e.returnMessage,values:e.getReturnDataParts()}}parseOutcome(e,t){const r=this.parseUntypedOutcome(e);return this.parseOutcomeFromUntypedBundle(r,t)}parseOutcomeFromUntypedBundle(e,t){const r=this.argsSerializer.buffersToValues(e.values,t.output);return{returnCode:e.returnCode,returnMessage:e.returnMessage,values:r,firstValue:r[0],secondValue:r[1],thirdValue:r[2],lastValue:r[r.length-1]}}parseUntypedOutcome(e){let t,r=this.parseTransactionMetadata(e);if(t=this.createBundleOnSimpleMoveBalance(e),t)return o.Logger.trace("parseUntypedOutcome(): on simple move balance"),t;if(t=this.createBundleOnInvalidTransaction(e),t)return o.Logger.trace("parseUntypedOutcome(): on invalid transaction"),t;if(t=this.createBundleOnEasilyFoundResultWithReturnData(e.contractResults),t)return o.Logger.trace("parseUntypedOutcome(): on easily found result with return data"),t;if(t=this.createBundleOnSignalError(e.logs),t)return o.Logger.trace("parseUntypedOutcome(): on signal error"),t;if(t=this.createBundleOnTooMuchGasWarning(e.logs),t)return o.Logger.trace("parseUntypedOutcome(): on 'too much gas' warning"),t;if(t=this.createBundleOnWriteLogWhereFirstTopicEqualsAddress(e.logs,e.sender),t)return o.Logger.trace("parseUntypedOutcome(): on writelog with topics[0] == tx.sender"),t;if(t=this.createBundleWithCustomHeuristics(e,r),t)return o.Logger.trace("parseUntypedOutcome(): with custom heuristics"),t;if(t=this.createBundleWithFallbackHeuristics(e,r),t)return o.Logger.trace("parseUntypedOutcome(): with fallback heuristics"),t;throw new s.ErrCannotParseContractResults(`transaction ${e.hash.toString()}`)}parseTransactionMetadata(e){return(new n.TransactionDecoder).getTransactionMetadata({sender:e.sender.bech32(),receiver:e.receiver.bech32(),data:e.data.toString("base64"),value:e.value.toString()})}createBundleOnSimpleMoveBalance(e){let t=0==e.contractResults.items.length,r=0==e.logs.events.length;return t&&r?{returnCode:u.ReturnCode.None,returnMessage:u.ReturnCode.None.toString(),values:[]}:null}createBundleOnInvalidTransaction(e){return e.status.isInvalid()&&e.receipt.data?{returnCode:u.ReturnCode.OutOfFunds,returnMessage:e.receipt.data,values:[]}:null}createBundleOnEasilyFoundResultWithReturnData(e){let t=e.items.find((e=>0!=e.nonce.valueOf()&&e.data.startsWith("@")));if(!t)return null;let{returnCode:r,returnDataParts:n}=this.sliceDataFieldInParts(t.data),i=t.returnMessage||r.toString();return{returnCode:r,returnMessage:i,values:n}}createBundleOnSignalError(e){let t=e.findSingleOrNoneEvent(c.OnSignalError);if(!t)return null;let{returnCode:r,returnDataParts:n}=this.sliceDataFieldInParts(t.data),i=t.getLastTopic(),s=i?.toString()||r.toString();return{returnCode:r,returnMessage:s,values:n}}createBundleOnTooMuchGasWarning(e){let t=e.findSingleOrNoneEvent(c.OnWriteLog,(e=>null!=e.findFirstOrNoneTopic((e=>e.toString().startsWith(l.TooMuchGas)))));if(!t)return null;let{returnCode:r,returnDataParts:n}=this.sliceDataFieldInParts(t.data),i=t.getLastTopic(),s=i?.toString()||r.toString();return{returnCode:r,returnMessage:s,values:n}}createBundleOnWriteLogWhereFirstTopicEqualsAddress(e,t){let r=new i.Address(t.bech32()).hex(),n=e.findSingleOrNoneEvent(c.OnWriteLog,(e=>null!=e.findFirstOrNoneTopic((e=>e.hex()==r))));if(!n)return null;let{returnCode:s,returnDataParts:o}=this.sliceDataFieldInParts(n.data),a=s.toString();return{returnCode:s,returnMessage:a,values:o}}createBundleWithCustomHeuristics(e,t){return null}createBundleWithFallbackHeuristics(e,t){let r=new i.Address(t.receiver);for(const t of e.contractResults.items){let n=t.logs.findSingleOrNoneEvent(c.OnWriteLog,(t=>{let n=t.address.bech32()==e.sender.bech32(),i=t.topics[0]?.hex()==r.hex();return n&&i}));if(n){let{returnCode:e,returnDataParts:t}=this.sliceDataFieldInParts(n.data),r=e.toString();return{returnCode:e,returnMessage:r,values:t}}}return null}sliceDataFieldInParts(e){let t=1;e.startsWith("ESDTTransfer")&&(t=3);let r=this.argsSerializer.stringToBuffers(e),n=r[t]||Buffer.from([]),i=r.slice(t+1);if(0==n.length)throw new s.ErrCannotParseContractResults("no return code");return{returnCode:u.ReturnCode.fromBuffer(n),returnDataParts:i}}parseEvent(e,t){const r=e.topics.map((e=>Buffer.from(e.valueOf()))).slice(1),n=e.dataPayload?.valueOf()||Buffer.from([]),i=e.additionalData?.map((e=>Buffer.from(e.valueOf())))||[];return 0===i.length&&n.length&&i.push(Buffer.from(n)),this.doParseEvent({topics:r,dataItems:i,eventDefinition:t})}doParseEvent(e){const t={},r=e.eventDefinition.inputs.filter((e=>e.indexed)),n=this.argsSerializer.buffersToValues(e.topics,r);for(let e=0;e<r.length;e++)t[r[e].name]=n[e].valueOf();const i=e.eventDefinition.inputs.filter((e=>!e.indexed)),s=this.argsSerializer.buffersToValues(e.dataItems,i);for(let e=0;e<i.length;e++)t[i[e].name]=s[e].valueOf();return t}}},3462:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ReturnCode=void 0;class r{constructor(e){this.text=e}static fromBuffer(e){let t=e.toString();return new r(t)}toString(){return this.text}valueOf(){return this.text}equals(e){return!!e&&this.text==e.text}isSuccess(){return this.equals(r.Ok)||this.equals(r.None)}}t.ReturnCode=r,r.None=new r(""),r.Ok=new r("ok"),r.FunctionNotFound=new r("function not found"),r.FunctionWrongSignature=new r("wrong signature for function"),r.ContractNotFound=new r("contract not found"),r.UserError=new r("user error"),r.OutOfGas=new r("out of gas"),r.AccountCollision=new r("account collision"),r.OutOfFunds=new r("out of funds"),r.CallStackOverFlow=new r("call stack overflow"),r.ContractInvalid=new r("contract invalid"),r.ExecutionFailed=new r("execution failed"),r.Unknown=new r("unknown")},1998:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContract=void 0;const n=r(236),i=r(1220),s=r(7353),o=r(2581),a=r(9712),u=r(3473),c=r(1069),l=r(5225),f=r(3685),d=r(1945),h=r(670),g=r(7453);t.SmartContract=class{constructor(e={}){this.address=n.Address.empty(),this.methodsExplicit={},this.methods={},this.address=e.address||n.Address.empty(),this.abi=e.abi,this.abi&&this.setupMethods()}setupMethods(){let e=this,t=this.getAbi();for(const r of t.getEndpoints()){let t=r.name;this.methodsExplicit[t]=function(r){let n=new f.ContractFunction(t);return new d.Interaction(e,n,r||[])},this.methods[t]=function(n){let i=new f.ContractFunction(t),s=h.NativeSerializer.nativeToTypedValues(n||[],r);return new d.Interaction(e,i,s||[])}}}setAddress(e){this.address=e}getAddress(){return this.address}getAbi(){return c.guardValueIsSet("abi",this.abi),this.abi}getEndpoint(e){return this.getAbi().getEndpoint(e)}deploy({deployer:e,code:t,codeMetadata:r,initArguments:n,value:o,gasLimit:c,gasPrice:l,chainID:f}){i.Compatibility.guardAddressIsSetAndNonZero(e,"'deployer' of SmartContract.deploy()","pass the actual address to deploy()");const d=new u.TransactionsFactoryConfig({chainID:f.valueOf()}),h=new a.SmartContractTransactionsFactory({config:d,abi:this.abi}),g=Buffer.from(t.toString(),"hex"),p=this.getMetadataPropertiesAsObject(r),m=h.createTransactionForDeploy({sender:e,bytecode:g,gasLimit:BigInt(c.valueOf()),arguments:n,isUpgradeable:p.upgradeable,isReadable:p.readable,isPayable:p.payable,isPayableBySmartContract:p.payableBySc});return m.setChainID(f),m.setValue(o??0),m.setGasPrice(l??s.TRANSACTION_MIN_GAS_PRICE),m}getMetadataPropertiesAsObject(e){let t;t=e?l.CodeMetadata.fromBytes(Buffer.from(e.toString(),"hex")):new l.CodeMetadata;return t.toJSON()}upgrade({caller:e,code:t,codeMetadata:r,initArguments:n,value:o,gasLimit:c,gasPrice:l,chainID:f}){i.Compatibility.guardAddressIsSetAndNonZero(e,"'caller' of SmartContract.upgrade()","pass the actual address to upgrade()"),this.ensureHasAddress();const d=new u.TransactionsFactoryConfig({chainID:f.valueOf()}),h=new a.SmartContractTransactionsFactory({config:d,abi:this.abi}),g=Uint8Array.from(Buffer.from(t.toString(),"hex")),p=this.getMetadataPropertiesAsObject(r),m=h.createTransactionForUpgrade({sender:e,contract:this.getAddress(),bytecode:g,gasLimit:BigInt(c.valueOf()),arguments:n,isUpgradeable:p.upgradeable,isReadable:p.readable,isPayable:p.payable,isPayableBySmartContract:p.payableBySc});return m.setChainID(f),m.setValue(o??0),m.setGasPrice(l??s.TRANSACTION_MIN_GAS_PRICE),m}call({func:e,args:t,value:r,gasLimit:n,receiver:o,gasPrice:c,chainID:l,caller:f}){i.Compatibility.guardAddressIsSetAndNonZero(f,"'caller' of SmartContract.call()","pass the actual address to call()"),this.ensureHasAddress();const d=new u.TransactionsFactoryConfig({chainID:l.valueOf()});t=t||[],r=r||0;const h=new a.SmartContractTransactionsFactory({config:d,abi:this.abi}).createTransactionForExecute({sender:f,contract:o||this.getAddress(),function:e.toString(),gasLimit:BigInt(n.valueOf()),arguments:t});return h.setChainID(l),h.setValue(r),h.setGasPrice(c??s.TRANSACTION_MIN_GAS_PRICE),h}createQuery({func:e,args:t,value:r,caller:n}){return this.ensureHasAddress(),new g.Query({address:this.getAddress(),func:e,args:t,value:r,caller:n})}ensureHasAddress(){if(!this.getAddress().bech32())throw new o.ErrContractHasNoAddress}static computeAddress(e,t){const r=n.Address.fromBech32(e.bech32());return(new n.AddressComputer).computeContractAddress(r,BigInt(t.valueOf()))}}},7331:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContractCallPayloadBuilder=t.ContractUpgradePayloadBuilder=t.ContractDeployPayloadBuilder=void 0;const n=r(7353),i=r(3548),s=r(1069),o=r(1157);t.ContractDeployPayloadBuilder=class{constructor(){this.code=null,this.codeMetadata="",this.arguments=[]}setCode(e){return this.code=e,this}setCodeMetadata(e){return this.codeMetadata=e,this}addInitArg(e){return this.arguments.push(e),this}setInitArgs(e){return this.arguments=e,this}build(){s.guardValueIsSet("code",this.code);let e=this.code.toString(),t=this.codeMetadata.toString(),r=`${e}@${n.WasmVirtualMachine}@${t}`;return r=a(r,this.arguments),new i.TransactionPayload(r)}};t.ContractUpgradePayloadBuilder=class{constructor(){this.code=null,this.codeMetadata="",this.arguments=[]}setCode(e){return this.code=e,this}setCodeMetadata(e){return this.codeMetadata=e,this}addInitArg(e){return this.arguments.push(e),this}setInitArgs(e){return this.arguments=e,this}build(){s.guardValueIsSet("code",this.code);let e=`upgradeContract@${this.code.toString()}@${this.codeMetadata.toString()}`;return e=a(e,this.arguments),new i.TransactionPayload(e)}};function a(e,t){let{argumentsString:r,count:n}=(new o.ArgSerializer).valuesToString(t);return 0==n?e:`${e}@${r}`}t.ContractCallPayloadBuilder=class{constructor(){this.contractFunction=null,this.arguments=[]}setFunction(e){return this.contractFunction=e,this}addArg(e){return this.arguments.push(e),this}setArgs(e){return this.arguments=e,this}build(){s.guardValueIsSet("calledFunction",this.contractFunction);let e=this.contractFunction.toString();return e=a(e,this.arguments),new i.TransactionPayload(e)}}},4966:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AbiRegistry=void 0;const o=s(r(2581)),a=r(1069),u=r(5730),c=r(1414),l=r(4143),f=r(7586),d=r(7654);class h{constructor(e){this.endpoints=[],this.customTypes=[],this.events=[],this.name=e.name,this.constructorDefinition=e.constructorDefinition,this.endpoints=e.endpoints,this.customTypes=e.customTypes,this.events=e.events||[]}static create(e){const t=e.name||"?",r=e.constructor||{},n=e.endpoints||[],i=e.types||{},s=e.events||[],a=u.EndpointDefinition.fromJSON({name:"constructor",...r}),d=n.map((e=>u.EndpointDefinition.fromJSON(e))),g=[];for(const e in i){const t=i[e];if("struct"==t.type)g.push(f.StructType.fromJSON({name:e,fields:t.fields}));else{if("enum"!=t.type&&"explicit-enum"!=t.type)throw new o.ErrTypingSystem(`Cannot handle custom type: ${e}`);g.push(c.EnumType.fromJSON({name:e,variants:t.variants}))}}const p=s.map((e=>l.EventDefinition.fromJSON(e)));return new h({name:t,constructorDefinition:a,endpoints:d,customTypes:g,events:p}).remapToKnownTypes()}getCustomType(e){const t=this.customTypes.find((t=>t.getName()==e));return a.guardValueIsSetWithMessage(`custom type [${e}] not found`,t),t}getStruct(e){const t=this.customTypes.find((t=>t.getName()==e&&t.hasExactClass(f.StructType.ClassName)));return a.guardValueIsSetWithMessage(`struct [${e}] not found`,t),t}getStructs(e){return e.map((e=>this.getStruct(e)))}getEnum(e){const t=this.customTypes.find((t=>t.getName()==e&&t.hasExactClass(c.EnumType.ClassName)));return a.guardValueIsSetWithMessage(`enum [${e}] not found`,t),t}getEnums(e){return e.map((e=>this.getEnum(e)))}getEndpoints(){return this.endpoints}getEndpoint(e){const t=this.endpoints.find((t=>t.name==e));return a.guardValueIsSetWithMessage(`endpoint [${e}] not found`,t),t}getEvent(e){const t=this.events.find((t=>t.identifier==e));return a.guardValueIsSetWithMessage(`event [${e}] not found`,t),t}remapToKnownTypes(){const e=new d.TypeMapper([]),t=[];for(const r of this.customTypes)this.mapCustomTypeDepthFirst(r,this.customTypes,e,t);if(this.customTypes.length!=t.length)throw new o.ErrTypingSystem("Did not re-map all custom types");const r=g(this.constructorDefinition,e),n=[];for(const t of this.endpoints)n.push(g(t,e));const i=this.events.map((t=>function(e,t){const r=e.inputs.map((e=>new l.EventTopicDefinition({name:e.name,type:t.mapType(e.type),indexed:e.indexed})));return new l.EventDefinition(e.identifier,r)}(t,e)));return new h({name:this.name,constructorDefinition:r,endpoints:n,customTypes:t,events:i})}mapCustomTypeDepthFirst(e,t,r,n){if(n.findIndex((t=>t.getName()==e.getName()))>=0)return;for(const i of e.getNamesOfDependencies()){const e=t.find((e=>e.getName()==i));e&&this.mapCustomTypeDepthFirst(e,t,r,n)}const i=r.mapType(e);n.push(i)}}function g(e,t){const r=e.input.map((e=>new u.EndpointParameterDefinition(e.name,e.description,t.mapType(e.type)))),n=e.output.map((e=>new u.EndpointParameterDefinition(e.name,e.description,t.mapType(e.type))));return new u.EndpointDefinition(e.name,r,n,e.modifiers)}t.AbiRegistry=h},8551:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddressValue=t.AddressType=void 0;const n=r(236),i=r(5626);class s extends i.PrimitiveType{constructor(){super("Address")}getClassName(){return s.ClassName}}t.AddressType=s,s.ClassName="AddressType";class o extends i.PrimitiveValue{constructor(e){super(new s),this.value=new n.Address(e.bech32())}getClassName(){return o.ClassName}equals(e){return this.value.equals(e.value)}valueOf(){return this.value}}t.AddressValue=o,o.ClassName="AddressValue"},1055:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionalValue=t.OptionalType=void 0;const n=r(1069),i=r(5626);class s extends i.Type{constructor(e){super("Optional",[e],i.TypeCardinality.variable(1))}getClassName(){return s.ClassName}isAssignableFrom(e){if(!e.hasExactClass(s.ClassName))return!1;let t=this.getFirstTypeParameter().equals(e.getFirstTypeParameter()),r=e.getFirstTypeParameter().hasExactClass(i.NullType.ClassName);return t||r}}t.OptionalType=s,s.ClassName="OptionalType";class o extends i.TypedValue{constructor(e,t=null){super(e),this.value=t}getClassName(){return o.ClassName}static newMissing(){let e=new s(new i.NullType);return new o(e)}isSet(){return!!this.value}getTypedValue(){return n.guardValueIsSet("value",this.value),this.value}valueOf(){return this.value?this.value.valueOf():null}equals(e){return this.value?.equals(e.value)||!1}}t.OptionalValue=o,o.ClassName="OptionalValue"},3979:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanValue=t.BooleanType=void 0;const n=r(5626);class i extends n.PrimitiveType{constructor(){super("bool")}getClassName(){return i.ClassName}}t.BooleanType=i,i.ClassName="BooleanType";class s extends n.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}equals(e){return this.value===e.value}isTrue(){return!0===this.value}isFalse(){return!this.isTrue()}valueOf(){return this.value}}t.BooleanValue=s,s.ClassName="BooleanValue"},1392:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BytesValue=t.BytesType=void 0;const n=r(5626);class i extends n.PrimitiveType{constructor(){super("bytes")}getClassName(){return i.ClassName}}t.BytesType=i,i.ClassName="BytesType";class s extends n.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}static fromUTF8(e){let t=Buffer.from(e,"utf-8");return new s(t)}static fromHex(e){let t=Buffer.from(e,"hex");return new s(t)}getLength(){return this.value.length}equals(e){return this.getLength()==e.getLength()&&this.value.equals(e.value)}valueOf(){return this.value}toString(){return this.value.toString()}}t.BytesValue=s,s.ClassName="BytesValue"},1847:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeMetadataValue=t.CodeMetadataType=void 0;const n=r(5626);class i extends n.PrimitiveType{constructor(){super("CodeMetadata")}}t.CodeMetadataType=i;class s extends n.PrimitiveValue{constructor(e){super(new i),this.value=e}equals(e){return this.value.equals(e.value)}valueOf(){return this.value}}t.CodeMetadataValue=s},902:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionOfTypedValues=void 0;t.CollectionOfTypedValues=class{constructor(e){this.items=e}getLength(){return this.items.length}getItems(){return this.items}valueOf(){return this.items.map((e=>e.valueOf()))}equals(e){if(this.getLength()!=e.getLength())return!1;for(let t=0;t<this.getLength();t++){let r=this.items[t],n=e.items[t];if(!r.equals(n))return!1}return!0}}},7472:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CompositeValue=t.CompositeType=void 0;const n=r(1069),i=r(5626);class s extends i.Type{constructor(...e){super("Composite",e,i.TypeCardinality.variable(e.length))}getClassName(){return s.ClassName}}t.CompositeType=s,s.ClassName="CompositeType";class o extends i.TypedValue{constructor(e,t){super(e),n.guardLength(t,e.getTypeParameters().length),this.items=t}getClassName(){return o.ClassName}static fromItems(...e){let t=e.map((e=>e.getType())),r=new s(...t);return new o(r,e)}getItems(){return this.items}valueOf(){return this.items.map((e=>e?.valueOf()))}equals(e){if(this.getType().differs(e.getType()))return!1;for(let t=0;t<this.items.length;t++){let r=this.items[t],n=e.items[t];if(!r.equals(n))return!1}return!0}}t.CompositeValue=o,o.ClassName="CompositeValue"},5730:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EndpointParameterDefinition=t.EndpointModifiers=t.EndpointDefinition=void 0;const n=r(7966);class i{constructor(e,t,r,n){this.input=[],this.output=[],this.name=e,this.input=t||[],this.output=r||[],this.modifiers=n}isConstructor(){return"constructor"==this.name}static fromJSON(e){e.name=null==e.name?"?":e.name,e.onlyOwner=e.onlyOwner||!1,e.payableInTokens=e.payableInTokens||[],e.inputs=e.inputs||[],e.outputs=e.outputs||[];let t=e.inputs.map((e=>o.fromJSON(e))),r=e.outputs.map((e=>o.fromJSON(e))),n=new s(e.mutability,e.payableInTokens,e.onlyOwner);return new i(e.name,t,r,n)}}t.EndpointDefinition=i;class s{constructor(e,t,r){this.mutability=e||"",this.payableInTokens=t||[],this.onlyOwner=r||!1}isPayableInEGLD(){return this.isPayableInToken("EGLD")}isPayableInToken(e){return!!this.payableInTokens.includes(e)||!this.payableInTokens.includes(`!${e}`)&&!!this.payableInTokens.includes("*")}isPayable(){return 0!=this.payableInTokens.length}isReadonly(){return"readonly"==this.mutability}isOnlyOwner(){return this.onlyOwner}}t.EndpointModifiers=s;class o{constructor(e,t,r){this.name=e,this.description=t,this.type=r}static fromJSON(e){let t=(new n.TypeExpressionParser).parse(e.type);return new o(e.name||"?",e.description||"N / A",t)}}t.EndpointParameterDefinition=o},1414:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EnumValue=t.EnumVariantDefinition=t.EnumType=void 0;const n=r(2581),i=r(1069),s=r(5766),o=r(5626);class a extends o.CustomType{constructor(e,t){super(e),this.variants=[],this.variants=t}getClassName(){return a.ClassName}static fromJSON(e){const t=a.assignMissingDiscriminants(e.variants||[]).map((e=>u.fromJSON(e)));return new a(e.name,t)}static assignMissingDiscriminants(e){return e.every((e=>null==e.discriminant))?e.map(((e,t)=>({...e,discriminant:t}))):e}getVariantByDiscriminant(e){let t=this.variants.find((t=>t.discriminant==e));return i.guardValueIsSet(`variant by discriminant (${e})`,t),t}getVariantByName(e){let t=this.variants.find((t=>t.name==e));return i.guardValueIsSet(`variant by name (${e})`,t),t}getNamesOfDependencies(){const e=[];for(const t of this.variants)e.push(...t.getNamesOfDependencies());return[...new Set(e)]}}t.EnumType=a,a.ClassName="EnumType";class u{constructor(e,t,r=[]){this.fieldsDefinitions=[],i.guardTrue(t<256,"discriminant for simple enum should be less than 256"),this.name=e,this.discriminant=t,this.fieldsDefinitions=r}static fromJSON(e){let t=(e.fields||[]).map((e=>s.FieldDefinition.fromJSON(e)));return new u(e.name,e.discriminant,t)}getFieldsDefinitions(){return this.fieldsDefinitions}getFieldDefinition(e){return this.fieldsDefinitions.find((t=>t.name==e))}getNamesOfDependencies(){return s.Fields.getNamesOfTypeDependencies(this.fieldsDefinitions)}}t.EnumVariantDefinition=u;class c extends o.TypedValue{constructor(e,t,r){super(e),this.fields=[],this.name=t.name,this.discriminant=t.discriminant,this.fields=r,this.fieldsByName=new Map(r.map((e=>[e.name,e])));let n=t.getFieldsDefinitions();s.Fields.checkTyping(this.fields,n)}getClassName(){return c.ClassName}static fromName(e,t){let r=e.getVariantByName(t);return new c(e,r,[])}static fromDiscriminant(e,t){let r=e.getVariantByDiscriminant(t);return new c(e,r,[])}equals(e){if(!this.getType().equals(e.getType()))return!1;let t=this.getFields(),r=e.getFields();const n=this.name==e.name,i=this.discriminant==e.discriminant,o=s.Fields.equals(t,r);return n&&i&&o}getFields(){return this.fields}getFieldValue(e){let t=this.fieldsByName.get(e);if(t)return t.value.valueOf();throw new n.ErrMissingFieldOnEnum(e,this.getType().getName())}valueOf(){let e={name:this.name,fields:[]};return this.fields.forEach(((t,r)=>e.fields[r]=t.value.valueOf())),e}}t.EnumValue=c,c.ClassName="EnumValue"},4143:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventTopicDefinition=t.EventDefinition=void 0;const n=r(7966);class i{constructor(e,t){this.inputs=[],this.identifier=e,this.inputs=t||[]}static fromJSON(e){e.identifier=null==e.identifier?"?":e.identifier,e.inputs=e.inputs||[];const t=e.inputs.map((e=>s.fromJSON(e)));return new i(e.identifier,t)}}t.EventDefinition=i;class s{constructor(e){this.name=e.name,this.type=e.type,this.indexed=e.indexed}static fromJSON(e){const t=(new n.TypeExpressionParser).parse(e.type);return new s({name:e.name||"?",type:t,indexed:e.indexed})}}t.EventTopicDefinition=s},8689:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createListOfTokenIdentifiers=t.createListOfAddresses=void 0;const n=r(8551),i=r(926),s=r(3145);t.createListOfAddresses=function(e){let t=e.map((e=>new n.AddressValue(e)));return i.List.fromItems(t)},t.createListOfTokenIdentifiers=function(e){let t=e.map((e=>new s.TokenIdentifierValue(e)));return i.List.fromItems(t)}},5766:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Fields=t.Field=t.FieldDefinition=void 0;const o=s(r(2581)),a=r(7966);class u{constructor(e,t,r){this.name=e,this.description=t,this.type=r}static fromJSON(e){let t=(new a.TypeExpressionParser).parse(e.type);return new u(e.name,e.description,t)}}t.FieldDefinition=u;t.Field=class{constructor(e,t=""){this.value=e,this.name=t}checkTyping(e){const t=this.value.getType();if(!t.equals(e.type))throw new o.ErrTypingSystem(`check type of field "${e.name}; expected: ${e.type}, actual: ${t}"`);if(this.name!=e.name)throw new o.ErrTypingSystem(`check name of field "${e.name}"`)}equals(e){return this.name==e.name&&this.value.equals(e.value)}};t.Fields=class{static checkTyping(e,t){if(e.length!=t.length)throw new o.ErrTypingSystem("fields length vs. field definitions length");for(let r=0;r<e.length;r++){let n=e[r],i=t[r];n.checkTyping(i)}}static equals(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let n=e[r],i=t[r];if(!n.equals(i))return!1}return!0}static getNamesOfTypeDependencies(e){const t=[];for(const r of e)t.push(r.type.getName()),t.push(...r.type.getNamesOfDependencies());return[...new Set(t)]}}},926:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.List=t.OptionValue=t.ListType=t.OptionType=void 0;const n=r(1069),i=r(902),s=r(5626);class o extends s.Type{constructor(e){super("Option",[e])}getClassName(){return o.ClassName}isAssignableFrom(e){if(!e.hasExactClass(o.ClassName))return!1;let t=this.getFirstTypeParameter().equals(e.getFirstTypeParameter()),r=e.getFirstTypeParameter().hasExactClass(s.NullType.ClassName);return t||r}}t.OptionType=o,o.ClassName="OptionType";class a extends s.Type{constructor(e){super("List",[e])}getClassName(){return a.ClassName}}t.ListType=a,a.ClassName="ListType";class u extends s.TypedValue{constructor(e,t=null){super(e),this.value=t}getClassName(){return u.ClassName}static newMissing(){let e=new o(new s.NullType);return new u(e)}static newMissingTyped(e){return new u(new o(e))}static newProvided(e){let t=new o(e.getType());return new u(t,e)}isSet(){return!!this.value}getTypedValue(){return n.guardValueIsSet("value",this.value),this.value}valueOf(){return this.value?this.value.valueOf():null}equals(e){return this.value?.equals(e.value)||!1}}t.OptionValue=u,u.ClassName="OptionValue";class c extends s.TypedValue{constructor(e,t){super(e),this.backingCollection=new i.CollectionOfTypedValues(t)}getClassName(){return c.ClassName}static fromItems(e){if(0==e.length)return new c(new s.TypePlaceholder,[]);let t=e[0].getType(),r=new a(t);return new c(r,e)}getLength(){return this.backingCollection.getLength()}getItems(){return this.backingCollection.getItems()}valueOf(){return this.backingCollection.valueOf()}equals(e){return this.backingCollection.equals(e.backingCollection)}}t.List=c,c.ClassName="List"},177:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayVec=t.ArrayVecType=void 0;const n=r(1069),i=r(902),s=r(5626);class o extends s.Type{constructor(e,t){super("Array",[t]),n.guardTrue(e>0,"array length > 0"),this.length=e}getClassName(){return o.ClassName}}t.ArrayVecType=o,o.ClassName="ArrayVecType";class a extends s.TypedValue{constructor(e,t){super(e),n.guardLength(t,e.length),this.backingCollection=new i.CollectionOfTypedValues(t)}getClassName(){return a.ClassName}getLength(){return this.backingCollection.getLength()}getItems(){return this.backingCollection.getItems()}valueOf(){return this.backingCollection.valueOf()}equals(e){return this.backingCollection.equals(e.backingCollection)}}t.ArrayVec=a,a.ClassName="ArrayVec"},1038:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.H256Value=t.H256Type=void 0;const n=r(5626);class i extends n.PrimitiveType{constructor(){super("H256")}getClassName(){return i.ClassName}}t.H256Type=i,i.ClassName="H256Type";class s extends n.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}equals(e){return this.value.equals(e.value)}valueOf(){return this.value}}t.H256Value=s,s.ClassName="H256Value"},2747:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4966),t),i(r(8551),t),i(r(1055),t),i(r(3979),t),i(r(1392),t),i(r(7472),t),i(r(5730),t),i(r(1414),t),i(r(8689),t),i(r(5766),t),i(r(926),t),i(r(177),t),i(r(1038),t),i(r(5648),t),i(r(1782),t),i(r(4473),t),i(r(6514),t),i(r(7586),t),i(r(3145),t),i(r(1025),t),i(r(7966),t),i(r(7654),t),i(r(5626),t),i(r(6054),t)},5648:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.onPrimitiveTypeSelect=t.onPrimitiveValueSelect=t.onTypedValueSelect=t.onTypeSelect=void 0;const o=s(r(2581)),a=r(8551),u=r(3979),c=r(1392),l=r(1414),f=r(926),d=r(1038),h=r(4473),g=r(1782),p=r(7586),m=r(3145),y=r(1025),A=r(5626),v=r(177),w=r(6514);t.onTypeSelect=function(e,t){if(e.hasExactClass(f.OptionType.ClassName))return t.onOption();if(e.hasExactClass(f.ListType.ClassName))return t.onList();if(e.hasExactClass(v.ArrayVecType.ClassName))return t.onArray();if(e.hasClassOrSuperclass(A.PrimitiveType.ClassName))return t.onPrimitive();if(e.hasExactClass(p.StructType.ClassName))return t.onStruct();if(e.hasExactClass(y.TupleType.ClassName))return t.onTuple();if(e.hasExactClass(l.EnumType.ClassName))return t.onEnum();if(t.onOther)return t.onOther();throw new o.ErrTypingSystem(`type isn't known: ${e}`)},t.onTypedValueSelect=function(e,t){if(e.hasClassOrSuperclass(A.PrimitiveValue.ClassName))return t.onPrimitive();if(e.hasExactClass(f.OptionValue.ClassName))return t.onOption();if(e.hasExactClass(f.List.ClassName))return t.onList();if(e.hasExactClass(v.ArrayVec.ClassName))return t.onArray();if(e.hasExactClass(p.Struct.ClassName))return t.onStruct();if(e.hasExactClass(y.Tuple.ClassName))return t.onTuple();if(e.hasExactClass(l.EnumValue.ClassName))return t.onEnum();if(t.onOther)return t.onOther();throw new o.ErrTypingSystem(`value isn't typed: ${e}`)},t.onPrimitiveValueSelect=function(e,t){if(e.hasExactClass(u.BooleanValue.ClassName))return t.onBoolean();if(e.hasClassOrSuperclass(h.NumericalValue.ClassName))return t.onNumerical();if(e.hasExactClass(a.AddressValue.ClassName))return t.onAddress();if(e.hasExactClass(c.BytesValue.ClassName))return t.onBytes();if(e.hasExactClass(w.StringValue.ClassName))return t.onString();if(e.hasExactClass(d.H256Value.ClassName))return t.onH256();if(e.hasExactClass(m.TokenIdentifierValue.ClassName))return t.onTypeIdentifier();if(e.hasExactClass(g.NothingValue.ClassName))return t.onNothing();if(t.onOther)return t.onOther();throw new o.ErrTypingSystem(`value isn't a primitive: ${e.getType()}`)},t.onPrimitiveTypeSelect=function(e,t){if(e.hasExactClass(u.BooleanType.ClassName))return t.onBoolean();if(e.hasClassOrSuperclass(h.NumericalType.ClassName))return t.onNumerical();if(e.hasExactClass(a.AddressType.ClassName))return t.onAddress();if(e.hasExactClass(c.BytesType.ClassName))return t.onBytes();if(e.hasExactClass(w.StringType.ClassName))return t.onString();if(e.hasExactClass(d.H256Type.ClassName))return t.onH256();if(e.hasExactClass(m.TokenIdentifierType.ClassName))return t.onTokenIndetifier();if(e.hasExactClass(g.NothingType.ClassName))return t.onNothing();if(t.onOther)return t.onOther();throw new o.ErrTypingSystem(`type isn't a known primitive: ${e}`)}},1782:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NothingValue=t.NothingType=void 0;const n=r(5626);class i extends n.PrimitiveType{constructor(){super("nothing")}getClassName(){return i.ClassName}}t.NothingType=i,i.ClassName="NothingType";class s extends n.PrimitiveValue{constructor(){super(new i)}getClassName(){return s.ClassName}equals(e){return!1}valueOf(){return{}}}t.NothingValue=s,s.ClassName="NothingValue"},4473:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BigIntValue=t.BigUIntValue=t.I64Value=t.U64Value=t.I32Value=t.U32Value=t.I16Value=t.U16Value=t.I8Value=t.U8Value=t.NumericalValue=t.BigIntType=t.BigUIntType=t.I64Type=t.U64Type=t.I32Type=t.U32Type=t.I16Type=t.U16Type=t.I8Type=t.U8Type=t.NumericalType=void 0;const a=o(r(1594)),u=s(r(2581)),c=r(5626);class l extends c.PrimitiveType{constructor(e,t,r){super(e),this.sizeInBytes=t,this.withSign=r}getClassName(){return l.ClassName}hasFixedSize(){return!!this.sizeInBytes}hasArbitrarySize(){return!this.hasFixedSize()}}t.NumericalType=l,l.ClassName="NumericalType";class f extends l{constructor(){super("u8",1,!1)}getClassName(){return f.ClassName}}t.U8Type=f,f.ClassName="U8Type";class d extends l{constructor(){super("i8",1,!0)}getClassName(){return d.ClassName}}t.I8Type=d,d.ClassName="I8Type";class h extends l{constructor(){super("u16",2,!1)}getClassName(){return h.ClassName}}t.U16Type=h,h.ClassName="U16Type";class g extends l{constructor(){super("i16",2,!0)}getClassName(){return g.ClassName}}t.I16Type=g,g.ClassName="I16Type";class p extends l{constructor(){super("u32",4,!1)}getClassName(){return p.ClassName}}t.U32Type=p,p.ClassName="U32Type";class m extends l{constructor(){super("i32",4,!0)}getClassName(){return m.ClassName}}t.I32Type=m,m.ClassName="I32Type";class y extends l{constructor(){super("u64",8,!1)}getClassName(){return y.ClassName}}t.U64Type=y,y.ClassName="U64Type";class A extends l{constructor(){super("i64",8,!0)}getClassName(){return A.ClassName}}t.I64Type=A,A.ClassName="I64Type";class v extends l{constructor(){super("BigUint",0,!1)}getClassName(){return v.ClassName}}t.BigUIntType=v,v.ClassName="BigUIntType";class w extends l{constructor(){super("Bigint",0,!0)}getClassName(){return w.ClassName}}t.BigIntType=w,w.ClassName="BigIntType";class b extends c.PrimitiveValue{constructor(e,t){if(super(e),"bigint"==typeof t&&(t=t.toString()),this.value=new a.default(t),this.sizeInBytes=e.sizeInBytes,this.withSign=e.withSign,this.value.isNaN())throw new u.ErrInvalidArgument(`not a number: ${t}`);if(!this.withSign&&this.value.isNegative())throw new u.ErrInvalidArgument(`negative, but type is unsigned: ${t}`)}getClassName(){return b.ClassName}equals(e){return this.value.isEqualTo(e.value)}valueOf(){return this.value}toString(){return this.value.toString()}}t.NumericalValue=b,b.ClassName="NumericalValue";class I extends b{constructor(e){super(new f,e)}getClassName(){return I.ClassName}}t.U8Value=I,I.ClassName="U8Value";class T extends b{constructor(e){super(new d,e)}getClassName(){return T.ClassName}}t.I8Value=T,T.ClassName="I8Value";class C extends b{constructor(e){super(new h,e)}getClassName(){return C.ClassName}}t.U16Value=C,C.ClassName="U16Value";class S extends b{constructor(e){super(new g,e)}getClassName(){return S.ClassName}}t.I16Value=S,S.ClassName="I16Value";class E extends b{constructor(e){super(new p,e)}getClassName(){return E.ClassName}}t.U32Value=E,E.ClassName="U32Value";class B extends b{constructor(e){super(new m,e)}getClassName(){return B.ClassName}}t.I32Value=B,B.ClassName="I32Value";class N extends b{constructor(e){super(new y,e)}getClassName(){return N.ClassName}}t.U64Value=N,N.ClassName="U64Value";class O extends b{constructor(e){super(new A,e)}getClassName(){return O.ClassName}}t.I64Value=O,O.ClassName="I64Value";class _ extends b{constructor(e){super(new v,e)}getClassName(){return _.ClassName}}t.BigUIntValue=_,_.ClassName="BigUIntValue";class P extends b{constructor(e){super(new w,e)}getClassName(){return P.ClassName}}t.BigIntValue=P,P.ClassName="BigIntValue"},6514:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringValue=t.StringType=void 0;const n=r(5626);class i extends n.PrimitiveType{constructor(){super("utf-8 string")}getClassName(){return i.ClassName}}t.StringType=i,i.ClassName="StringType";class s extends n.PrimitiveValue{constructor(e){super(new i),this.value=e}getClassName(){return s.ClassName}static fromUTF8(e){return new s(e)}static fromHex(e){let t=Buffer.from(e,"hex").toString();return new s(t)}getLength(){return this.value.length}equals(e){return this.value===e.value}valueOf(){return this.value}}t.StringValue=s,s.ClassName="StringValue"},7586:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Struct=t.StructType=void 0;const n=r(2581),i=r(5766),s=r(5626);class o extends s.CustomType{constructor(e,t){super(e),this.fieldsDefinitions=[],this.fieldsDefinitions=t}getClassName(){return o.ClassName}static fromJSON(e){let t=(e.fields||[]).map((e=>i.FieldDefinition.fromJSON(e)));return new o(e.name,t)}getFieldsDefinitions(){return this.fieldsDefinitions}getFieldDefinition(e){return this.fieldsDefinitions.find((t=>t.name==e))}getNamesOfDependencies(){return i.Fields.getNamesOfTypeDependencies(this.fieldsDefinitions)}}t.StructType=o,o.ClassName="StructType";class a extends s.TypedValue{constructor(e,t){super(e),this.fields=t,this.fieldsByName=new Map(t.map((e=>[e.name,e]))),this.checkTyping()}getClassName(){return a.ClassName}checkTyping(){let e=this.getType().getFieldsDefinitions();i.Fields.checkTyping(this.fields,e)}getFields(){return this.fields}getFieldValue(e){let t=this.fieldsByName.get(e);if(t)return t.value.valueOf();throw new n.ErrMissingFieldOnStruct(e,this.getType().getName())}valueOf(){let e={};for(const t of this.fields)e[t.name]=t.value.valueOf();return e}equals(e){if(!this.getType().equals(e.getType()))return!1;let t=this.getFields(),r=e.getFields();return i.Fields.equals(t,r)}}t.Struct=a,a.ClassName="Struct"},3145:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TokenIdentifierValue=t.TokenIdentifierType=void 0;const n=r(5626);class i extends n.PrimitiveType{constructor(){super("TokenIdentifier")}getClassName(){return i.ClassName}}t.TokenIdentifierType=i,i.ClassName="TokenIdentifierType";class s extends n.PrimitiveValue{constructor(e){super(new i),this.value=e}static egld(){return new s("EGLD")}static esdtTokenIdentifier(e){return new s(e)}getClassName(){return s.ClassName}getLength(){return this.value.length}equals(e){return this.getLength()==e.getLength()&&this.value==e.value}valueOf(){return this.value}toString(){return this.value.toString()}}t.TokenIdentifierValue=s,s.ClassName="TokenIdentifierValue"},1025:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Tuple=t.TupleType=void 0;const o=s(r(2581)),a=r(5766),u=r(7586);class c extends u.StructType{constructor(...e){super(c.prepareName(e),c.prepareFieldDefinitions(e))}getClassName(){return c.ClassName}static prepareName(e){return`tuple<${e.map((e=>e.toString())).join(", ")}>`}static prepareFieldDefinitions(e){return e.map(((e,t)=>new a.FieldDefinition(l(t),"anonymous tuple field",e)))}}function l(e){return`field${e}`}t.TupleType=c,c.ClassName="TupleType";class f extends u.Struct{constructor(e,t){super(e,t)}getClassName(){return f.ClassName}static fromItems(e){if(e.length<1)throw new o.ErrTypingSystem("bad tuple items");let t=e.map((e=>e.getType())),r=new c(...t),n=e.map(((e,t)=>new a.Field(e,l(t))));return new f(r,n)}}t.Tuple=f,f.ClassName="Tuple"},7966:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeExpressionParser=void 0;const n=r(9132),i=r(2581),s=r(5626);t.TypeExpressionParser=class{constructor(){this.backingTypeFormulaParser=new n.TypeFormulaParser}parse(e){try{return this.doParse(e)}catch(t){throw new i.ErrTypingSystem(`Failed to parse type expression: ${e}. Error: ${t}`)}}doParse(e){const t=this.backingTypeFormulaParser.parseExpression(e);return this.typeFormulaToType(t)}typeFormulaToType(e){const t=e.typeParameters.map((e=>this.typeFormulaToType(e)));return new s.Type(e.name,t)}}},7654:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TypeMapper=void 0;const o=s(r(2581)),a=r(8551),u=r(1055),c=r(3979),l=r(1392),f=r(1847),d=r(7472),h=r(1414),g=r(5766),p=r(926),m=r(177),y=r(1038),A=r(1782),v=r(4473),w=r(6514),b=r(7586),I=r(3145),T=r(1025),C=r(6054);t.TypeMapper=class{constructor(e=[]){this.openTypesFactories=new Map([["Option",(...e)=>new p.OptionType(e[0])],["List",(...e)=>new p.ListType(e[0])],["VarArgs",(...e)=>new C.VariadicType(e[0])],["MultiResultVec",(...e)=>new C.VariadicType(e[0])],["variadic",(...e)=>new C.VariadicType(e[0])],["counted-variadic",(...e)=>new C.VariadicType(e[0],!0)],["OptionalArg",(...e)=>new u.OptionalType(e[0])],["optional",(...e)=>new u.OptionalType(e[0])],["OptionalResult",(...e)=>new u.OptionalType(e[0])],["multi",(...e)=>new d.CompositeType(...e)],["MultiArg",(...e)=>new d.CompositeType(...e)],["MultiResult",(...e)=>new d.CompositeType(...e)],["multi",(...e)=>new d.CompositeType(...e)],["tuple",(...e)=>new T.TupleType(...e)],["tuple2",(...e)=>new T.TupleType(...e)],["tuple3",(...e)=>new T.TupleType(...e)],["tuple4",(...e)=>new T.TupleType(...e)],["tuple5",(...e)=>new T.TupleType(...e)],["tuple6",(...e)=>new T.TupleType(...e)],["tuple7",(...e)=>new T.TupleType(...e)],["tuple8",(...e)=>new T.TupleType(...e)],["array2",(...e)=>new m.ArrayVecType(2,e[0])],["array8",(...e)=>new m.ArrayVecType(8,e[0])],["array16",(...e)=>new m.ArrayVecType(16,e[0])],["array20",(...e)=>new m.ArrayVecType(20,e[0])],["array32",(...e)=>new m.ArrayVecType(32,e[0])],["array46",(...e)=>new m.ArrayVecType(46,e[0])],["array48",(...e)=>new m.ArrayVecType(48,e[0])],["array64",(...e)=>new m.ArrayVecType(64,e[0])],["array128",(...e)=>new m.ArrayVecType(128,e[0])],["array256",(...e)=>new m.ArrayVecType(256,e[0])]]),this.closedTypesMap=new Map([["u8",new v.U8Type],["u16",new v.U16Type],["u32",new v.U32Type],["u64",new v.U64Type],["U64",new v.U64Type],["BigUint",new v.BigUIntType],["i8",new v.I8Type],["i16",new v.I16Type],["i32",new v.I32Type],["i64",new v.I64Type],["Bigint",new v.BigIntType],["BigInt",new v.BigIntType],["bool",new c.BooleanType],["bytes",new l.BytesType],["Address",new a.AddressType],["H256",new y.H256Type],["utf-8 string",new w.StringType],["TokenIdentifier",new I.TokenIdentifierType],["EgldOrEsdtTokenIdentifier",new I.TokenIdentifierType],["CodeMetadata",new f.CodeMetadataType],["nothing",new A.NothingType],["AsyncCall",new A.NothingType]]),this.learnedTypesMap=new Map;for(const t of e)this.learnedTypesMap.set(t.getName(),t)}mapType(e){let t=this.mapTypeRecursively(e);if(t)return t.isGenericType()||this.learnType(t),t;throw new o.ErrTypingSystem(`Cannot map the type "${e.getName()}" to a known type`)}mapTypeRecursively(e){let t=e.isGenericType(),r=this.learnedTypesMap.get(e.getName());if(r)return r;let n=this.closedTypesMap.get(e.getName());return n||(e.hasExactClass(h.EnumType.ClassName)?this.mapEnumType(e):e.hasExactClass(b.StructType.ClassName)?this.mapStructType(e):t?this.mapGenericType(e):null)}learnType(e){this.learnedTypesMap.delete(e.getName()),this.learnedTypesMap.set(e.getName(),e)}mapStructType(e){let t=this.mappedFields(e.getFieldsDefinitions());return new b.StructType(e.getName(),t)}mapEnumType(e){let t=e.variants.map((e=>new h.EnumVariantDefinition(e.name,e.discriminant,this.mappedFields(e.getFieldsDefinitions()))));return new h.EnumType(e.getName(),t)}mappedFields(e){return e.map((e=>new g.FieldDefinition(e.name,e.description,this.mapType(e.type))))}mapGenericType(e){let t=e.getTypeParameters().map((e=>this.mapType(e))),r=this.openTypesFactories.get(e.getName());if(!r)throw new o.ErrTypingSystem(`Cannot map the generic type "${e.getName()}" to a known type`);return r(...t)}}},5626:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NullType=t.TypePlaceholder=t.isTyped=t.PrimitiveValue=t.TypedValue=t.CustomType=t.PrimitiveType=t.TypeCardinality=t.Type=void 0;const n=r(6063),i=r(1069);class s{constructor(e,t=[],r=o.fixed(1)){i.guardValueIsSet("name",e),this.name=e,this.typeParameters=t,this.cardinality=r}getName(){return this.name}getClassName(){return s.ClassName}getClassHierarchy(){return n.getJavascriptPrototypesInHierarchy(this,(e=>e.belongsToTypesystem)).map((e=>e.getClassName())).reverse()}getFullyQualifiedName(){let e=this.getTypeParameters().map((e=>e.getFullyQualifiedName())).join(", ");return this.isGenericType()?`multiversx:types:${this.getName()}<${e}>`:`multiversx:types:${this.getName()}`}hasExactClass(e){return this.getClassName()==e}hasClassOrSuperclass(e){return this.getClassHierarchy().includes(e)}getTypeParameters(){return this.typeParameters}isGenericType(){return this.typeParameters.length>0}getFirstTypeParameter(){return i.guardTrue(this.typeParameters.length>0,"type parameters length > 0"),this.typeParameters[0]}toString(){let e=this.getTypeParameters().map((e=>e.toString())).join(", "),t=e?`<${e}>`:"";return`${this.name}${t}`}equals(e){return s.equals(this,e)}static equals(e,t){return e.getFullyQualifiedName()==t.getFullyQualifiedName()}static equalsMany(e,t){return e.every(((e,r)=>e.equals(t[r])))}static isAssignableFromMany(e,t){return e.every(((e,r)=>e.isAssignableFrom(t[r])))}differs(e){return!this.equals(e)}valueOf(){return this.name}isAssignableFrom(e){if(!s.equalsMany(this.getTypeParameters(),e.getTypeParameters()))return!1;let t=this.getFullyQualifiedName();return!!s.getFullyQualifiedNamesInHierarchy(e).includes(t)||e.hasClassOrSuperclass(this.getClassName())}static getFullyQualifiedNamesInHierarchy(e){return n.getJavascriptPrototypesInHierarchy(e,(e=>e.belongsToTypesystem)).map((t=>t.getFullyQualifiedName.call(e)))}getNamesOfDependencies(){const e=[];for(const t of this.typeParameters)e.push(t.getName()),e.push(...t.getNamesOfDependencies());return[...new Set(e)]}toJSON(){return{name:this.name,typeParameters:this.typeParameters.map((e=>e.toJSON()))}}getCardinality(){return this.cardinality}belongsToTypesystem(){}}t.Type=s,s.ClassName="Type";class o{constructor(e,t){this.lowerBound=e,this.upperBound=t}static fixed(e){return new o(e,e)}static variable(e){return new o(0,e)}isSingular(){return 1==this.lowerBound&&1==this.upperBound}isSingularOrNone(){return 0==this.lowerBound&&1==this.upperBound}isComposite(){return 1!=this.upperBound}isFixed(){return this.lowerBound==this.upperBound}getLowerBound(){return this.lowerBound}getUpperBound(){return this.upperBound||o.MaxCardinality}}t.TypeCardinality=o,o.MaxCardinality=4096;class a extends s{constructor(e){super(e)}getClassName(){return a.ClassName}}t.PrimitiveType=a,a.ClassName="PrimitiveType";class u extends s{getClassName(){return u.ClassName}}t.CustomType=u,u.ClassName="CustomType";class c{constructor(e){this.type=e}getClassName(){return c.ClassName}getClassHierarchy(){return n.getJavascriptPrototypesInHierarchy(this,(e=>e.belongsToTypesystem)).map((e=>e.getClassName())).reverse()}getType(){return this.type}hasExactClass(e){return this.getClassName()==e}hasClassOrSuperclass(e){return this.getClassHierarchy().includes(e)}belongsToTypesystem(){}}t.TypedValue=c,c.ClassName="TypedValue";class l extends c{constructor(e){super(e)}getClassName(){return l.ClassName}}t.PrimitiveValue=l,l.ClassName="PrimitiveValue",t.isTyped=function(e){return void 0!==e.belongsToTypesystem};class f extends s{constructor(){super("...")}getClassName(){return f.ClassName}}t.TypePlaceholder=f,f.ClassName="TypePlaceholder";class d extends s{constructor(){super("?")}getClassName(){return d.ClassName}}t.NullType=d,d.ClassName="NullType"},6054:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VariadicValue=t.CountedVariadicType=t.VariadicType=void 0;const n=r(5626);class i extends n.Type{constructor(e,t=!1){super("Variadic",[e],n.TypeCardinality.variable()),this.isCounted=t}getClassName(){return i.ClassName}}t.VariadicType=i,i.ClassName="VariadicType";class s extends n.Type{constructor(e){super("Variadic",[e],n.TypeCardinality.variable())}getClassName(){return i.ClassName}}t.CountedVariadicType=s,s.ClassName="VariadicType";class o extends n.TypedValue{constructor(e,t){super(e),this.items=t}getClassName(){return o.ClassName}static fromItems(...e){return this.createFromItems(e,!1)}static fromItemsCounted(...e){return this.createFromItems(e,!0)}static createFromItems(e,t){if(0==e.length)return new o(new i(new n.TypePlaceholder,t),[]);const r=e[0].getType();return new o(new i(r,t),e)}getItems(){return this.items}valueOf(){return this.items.map((e=>e.valueOf()))}equals(e){if(this.getType().differs(e.getType()))return!1;for(let t=0;t<this.items.length;t++){let r=this.items[t],n=e.items[t];if(!r.equals(n))return!1}return!0}}t.VariadicValue=o,o.ClassName="VariadicValue"},8390:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.bufferToHex=t.addressToHex=t.bigIntToHex=t.utf8ToHex=t.bigIntToBuffer=t.bufferToBigInt=t.stringToBuffer=void 0;const a=o(r(1594)),u=s(r(7553)),c=s(r(9161));t.stringToBuffer=function(e){return Buffer.from(e)},t.bufferToBigInt=function(e){return 0==e.length?new a.default(0):u.bufferToBigInt(e)},t.bigIntToBuffer=function(e){return 0==e?Buffer.from([]):u.bigIntToBuffer(e)};var l=r(9161);Object.defineProperty(t,"utf8ToHex",{enumerable:!0,get:function(){return l.utf8ToHex}}),Object.defineProperty(t,"bigIntToHex",{enumerable:!0,get:function(){return l.bigIntToHex}}),Object.defineProperty(t,"addressToHex",{enumerable:!0,get:function(){return l.addressToHex}}),t.bufferToHex=function(e){const t=e.toString("hex");return c.zeroPadStringIfOddLength(t)}},5132:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TokenPayment=t.TokenComputer=t.TokenTransfer=t.Token=void 0;const i=n(r(1594)),s=r(2581),o="EGLD";i.default.set({ROUNDING_MODE:1});class a{constructor(e){this.identifier=e.identifier,this.nonce=e.nonce||0n}}t.Token=a;class u{constructor(e){if(this.isLegacyTokenTransferOptions(e)){const t=new i.default(e.amountAsBigInteger);if(!t.isInteger()||t.isNegative())throw new s.ErrInvalidArgument(`bad amountAsBigInteger: ${e.amountAsBigInteger}`);this.tokenIdentifier=e.tokenIdentifier,this.nonce=e.nonce,this.amountAsBigInteger=t,this.numDecimals=e.numDecimals||0,this.token=new a({identifier:e.tokenIdentifier,nonce:BigInt(e.nonce)}),this.amount=BigInt(this.amountAsBigInteger.toFixed(0))}else this.token=e.token,this.amount=e.amount,this.tokenIdentifier=e.token.identifier,this.nonce=Number(e.token.nonce),this.amountAsBigInteger=new i.default(this.amount.toString()),this.numDecimals=0}isLegacyTokenTransferOptions(e){return void 0!==e.tokenIdentifier}static egldFromAmount(e){const t=new i.default(e).shiftedBy(18).decimalPlaces(0);return this.egldFromBigInteger(t)}static egldFromBigInteger(e){return new u({tokenIdentifier:o,nonce:0,amountAsBigInteger:e,numDecimals:18})}static fungibleFromAmount(e,t,r){const n=new i.default(t).shiftedBy(r).decimalPlaces(0);return this.fungibleFromBigInteger(e,n,r)}static fungibleFromBigInteger(e,t,r=0){return new u({tokenIdentifier:e,nonce:0,amountAsBigInteger:t,numDecimals:r})}static nonFungible(e,t){return new u({tokenIdentifier:e,nonce:t,amountAsBigInteger:1,numDecimals:0})}static semiFungible(e,t,r){return new u({tokenIdentifier:e,nonce:t,amountAsBigInteger:r,numDecimals:0})}static metaEsdtFromAmount(e,t,r,n){const s=new i.default(r).shiftedBy(n).decimalPlaces(0);return this.metaEsdtFromBigInteger(e,t,s,n)}static metaEsdtFromBigInteger(e,t,r,n=0){return new u({tokenIdentifier:e,nonce:t,amountAsBigInteger:r,numDecimals:n})}toString(){return this.amount.toString()}valueOf(){return new i.default(this.amount.toString())}toPrettyString(){return`${this.toAmount()} ${this.tokenIdentifier}`}toAmount(){return this.amountAsBigInteger.shiftedBy(-this.numDecimals).toFixed(this.numDecimals)}isEgld(){return this.token.identifier==o}isFungible(){return 0n==this.token.nonce}}t.TokenTransfer=u;t.TokenComputer=class{constructor(){}isFungible(e){return 0n===e.nonce}extractNonceFromExtendedIdentifier(e){const t=e.split("-");if(this.checkIfExtendedIdentifierWasProvided(t),this.checkLengthOfRandomSequence(t[1]),2==t.length)return 0;const r=Buffer.from(t[2],"hex");return(n=r).readUIntBE(0,n.length);var n}extractIdentifierFromExtendedIdentifier(e){const t=e.split("-");return this.checkIfExtendedIdentifierWasProvided(t),this.ensureTokenTickerValidity(t[0]),this.checkLengthOfRandomSequence(t[1]),t[0]+"-"+t[1]}checkIfExtendedIdentifierWasProvided(e){if(e.length<2||e.length>3)throw new s.ErrInvalidTokenIdentifier("Invalid extended token identifier provided")}checkLengthOfRandomSequence(e){if(6!==e.length)throw new s.ErrInvalidTokenIdentifier("The identifier is not valid. The random sequence does not have the right length")}ensureTokenTickerValidity(e){if(e.length<3||e.length>10)throw new s.ErrInvalidTokenIdentifier("The token ticker should be between 3 and 10 characters");if(!e.match(/^[a-zA-Z0-9]+$/))throw new s.ErrInvalidTokenIdentifier("The token ticker should only contain alphanumeric characters");if(e!=e.toUpperCase())throw new s.ErrInvalidTokenIdentifier("The token ticker should be upper case")}};t.TokenPayment=class extends u{constructor(e,t,r,n){super({tokenIdentifier:e,nonce:t,amountAsBigInteger:r,numDecimals:n})}}},476:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionHash=t.Transaction=void 0;const n=r(1594),i=r(236),s=r(7353),o=r(6659),a=r(9342),u=r(3500),c=r(9874),l=r(3548),f=r(9825);t.Transaction=class{constructor(e){this.nonce=BigInt(e.nonce?.valueOf()||0n),this.value=e.value?BigInt(new n.BigNumber(e.value.toString()).toFixed(0)):0n,this.sender=this.addressAsBech32(e.sender),this.receiver=this.addressAsBech32(e.receiver),this.senderUsername=e.senderUsername||"",this.receiverUsername=e.receiverUsername||"",this.gasPrice=BigInt(e.gasPrice?.valueOf()||s.TRANSACTION_MIN_GAS_PRICE),this.gasLimit=BigInt(e.gasLimit.valueOf()),this.data=e.data?.valueOf()||new Uint8Array,this.chainID=e.chainID.valueOf(),this.version=Number(e.version?.valueOf()||s.TRANSACTION_VERSION_DEFAULT),this.options=Number(e.options?.valueOf()||s.TRANSACTION_OPTIONS_DEFAULT),this.guardian=e.guardian?this.addressAsBech32(e.guardian):"",this.signature=e.signature||Buffer.from([]),this.guardianSignature=e.guardianSignature||Buffer.from([])}addressAsBech32(e){return"string"==typeof e?e:e.bech32()}getNonce(){return Number(this.nonce)}setNonce(e){this.nonce=BigInt(e.valueOf())}getValue(){return this.value}setValue(e){this.value=BigInt(e.toString())}getSender(){return i.Address.fromBech32(this.sender)}setSender(e){this.sender="string"==typeof e?e:e.bech32()}getReceiver(){return i.Address.fromBech32(this.receiver)}getSenderUsername(){return this.senderUsername}setSenderUsername(e){this.senderUsername=e}getReceiverUsername(){return this.receiverUsername}setReceiverUsername(e){this.receiverUsername=e}getGuardian(){return new i.Address(this.guardian)}getGasPrice(){return Number(this.gasPrice)}setGasPrice(e){this.gasPrice=BigInt(e.valueOf())}getGasLimit(){return Number(this.gasLimit)}setGasLimit(e){this.gasLimit=BigInt(e.valueOf())}getData(){return new l.TransactionPayload(Buffer.from(this.data))}getChainID(){return this.chainID}setChainID(e){this.chainID=e.valueOf()}getVersion(){return new u.TransactionVersion(this.version)}setVersion(e){this.version=e.valueOf()}getOptions(){return new u.TransactionOptions(this.options.valueOf())}setOptions(e){this.options=e.valueOf()}getSignature(){return Buffer.from(this.signature)}getGuardianSignature(){return Buffer.from(this.guardianSignature)}setGuardian(e){this.guardian="string"==typeof e?e:e.bech32()}getHash(){return d.compute(this)}serializeForSigning(){const e=(new f.TransactionComputer).computeBytesForSigning(this);return Buffer.from(e)}isGuardedTransaction(){const e=this.guardian.length>0,t=this.guardianSignature.length>0;return this.getOptions().isWithGuardian()&&e&&t}toPlainObject(){return(new o.TransactionsConverter).transactionToPlainObject(this)}static fromPlainObject(e){return(new o.TransactionsConverter).plainObjectToTransaction(e)}applySignature(e){this.signature=c.interpretSignatureAsBuffer(e)}applyGuardianSignature(e){this.guardianSignature=c.interpretSignatureAsBuffer(e)}toSendable(){return this.toPlainObject()}computeFee(e){const t=(new f.TransactionComputer).computeTransactionFee(this,e);return new n.BigNumber(t.toString())}};class d extends a.Hash{constructor(e){super(e)}static compute(e){const t=(new f.TransactionComputer).computeTransactionHash(e);return new d(Buffer.from(t).toString("hex"))}}t.TransactionHash=d},9825:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionComputer=void 0;const a=s(r(2581)),u=o(r(1594)),c=r(9277),l=r(476),f=r(7353),d=r(2206),h=r(5508);t.TransactionComputer=class{constructor(){}computeTransactionFee(e,t){const r=BigInt(t.MinGasLimit+e.data.length*t.GasPerDataByte);if(r>e.gasLimit)throw new a.ErrNotEnoughGas(parseInt(e.gasLimit.toString(),10));const n=e.gasPrice,i=r*n;if(r===e.gasLimit)return i;return i+(e.gasLimit-r)*BigInt(new u.default(n.toString()).multipliedBy(new u.default(t.GasPriceModifier)).toFixed(0))}computeBytesForSigning(e){this.ensureValidTransactionFields(e);const t=this.toPlainObjectForSigning(e),r=JSON.stringify(t);return new Uint8Array(Buffer.from(r))}computeBytesForVerifying(e){return this.hasOptionsSetForHashSigning(e)?this.computeHashForSigning(e):this.computeBytesForSigning(e)}computeHashForSigning(e){const t=this.toPlainObjectForSigning(e),r=Buffer.from(JSON.stringify(t));return h("keccak256").update(r).digest()}computeTransactionHash(e){const t=(new c.ProtoSerializer).serializeTransaction(new l.Transaction(e)),r=d(32).update(t).digest("hex");return Buffer.from(r,"hex")}hasOptionsSetForGuardedTransaction(e){return(e.options&f.TRANSACTION_OPTIONS_TX_GUARDED)==f.TRANSACTION_OPTIONS_TX_GUARDED}hasOptionsSetForHashSigning(e){return(e.options&f.TRANSACTION_OPTIONS_TX_HASH_SIGN)==f.TRANSACTION_OPTIONS_TX_HASH_SIGN}applyGuardian(e,t){e.version<f.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS&&(e.version=f.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS),e.options=e.options|f.TRANSACTION_OPTIONS_TX_GUARDED,e.guardian=t}applyOptionsForHashSigning(e){e.version<f.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS&&(e.version=f.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS),e.options=e.options|f.TRANSACTION_OPTIONS_TX_HASH_SIGN}toPlainObjectForSigning(e){return{nonce:Number(e.nonce),value:e.value.toString(),receiver:e.receiver,sender:e.sender,senderUsername:this.toBase64OrUndefined(e.senderUsername),receiverUsername:this.toBase64OrUndefined(e.receiverUsername),gasPrice:Number(e.gasPrice),gasLimit:Number(e.gasLimit),data:this.toBase64OrUndefined(e.data),chainID:e.chainID,version:e.version,options:e.options?e.options:void 0,guardian:e.guardian?e.guardian:void 0}}toBase64OrUndefined(e){return e&&e.length?Buffer.from(e).toString("base64"):void 0}ensureValidTransactionFields(e){if(e.sender.length!==f.BECH32_ADDRESS_LENGTH)throw new a.ErrBadUsage("Invalid `sender` field. Should be the bech32 address of the sender.");if(e.receiver.length!==f.BECH32_ADDRESS_LENGTH)throw new a.ErrBadUsage("Invalid `receiver` field. Should be the bech32 address of the receiver.");if(!e.chainID.length)throw new a.ErrBadUsage("The `chainID` field is not set");if(e.version<f.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS&&(this.hasOptionsSetForGuardedTransaction(e)||this.hasOptionsSetForHashSigning(e)))throw new a.ErrBadUsage(`Non-empty transaction options requires transaction version >= ${f.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS}`)}}},3548:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionPayload=void 0;class r{constructor(e){this.data=Buffer.from(e||[])}static fromEncoded(e){if(!e)return new r("");let t=Buffer.from(e,"base64").toString();return new r(t)}isEmpty(){return 0==this.data.length}encoded(){return this.data.toString("base64")}valueOf(){return this.data}toString(){return this.data.toString()}getEncodedArguments(){return this.toString().split("@")}getRawArguments(){return this.getEncodedArguments().map((e=>Buffer.from(e,"hex")))}length(){return Buffer.from(this.data).length}}t.TransactionPayload=r},6520:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AccountTransactionsFactory=void 0;const n=r(236),i=r(4059);t.AccountTransactionsFactory=class{constructor(e){this.config=e.config}createTransactionForSavingKeyValue(e){const t=["SaveKeyValue",...this.computeDataPartsForSavingKeyValue(e.keyValuePairs)],r=this.computeExtraGasForSavingKeyValue(e.keyValuePairs);return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}computeExtraGasForSavingKeyValue(e){let t=0n;return e.forEach(((e,r)=>{t+=this.config.gasLimitPersistPerByte*BigInt(r.length+e.length)+this.config.gasLimitStorePerByte*BigInt(e.length)})),t+this.config.gasLimitSaveKeyValue}computeDataPartsForSavingKeyValue(e){const t=[];return e.forEach(((e,r)=>{t.push(Buffer.from(r).toString("hex"),Buffer.from(e).toString("hex"))})),t}createTransactionForSettingGuardian(e){const t=["SetGuardian",n.Address.fromBech32(e.guardianAddress.bech32()).toHex(),Buffer.from(e.serviceID).toString("hex")];return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitSetGuardian,addDataMovementGas:!0}).build()}createTransactionForGuardingAccount(e){return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:["GuardAccount"],gasLimit:this.config.gasLimitGuardAccount,addDataMovementGas:!0}).build()}createTransactionForUnguardingAccount(e){return new i.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:["UnGuardAccount"],gasLimit:this.config.gasLimitUnguardAccount,addDataMovementGas:!0}).build()}}},7673:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DelegationTransactionsFactory=void 0;const n=r(236),i=r(7353),s=r(2581),o=r(661),a=r(4059);t.DelegationTransactionsFactory=class{constructor(e){this.config=e.config,this.argSerializer=new o.ArgSerializer}createTransactionForNewDelegationContract(e){const t=["createNewDelegationContract",...this.argSerializer.valuesToStrings([new o.BigUIntValue(e.totalDelegationCap),new o.BigUIntValue(e.serviceFee)])],r=this.config.gasLimitCreateDelegationContract+this.config.additionalGasLimitForDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.DELEGATION_MANAGER_SC_ADDRESS),dataParts:t,gasLimit:r,addDataMovementGas:!0,amount:e.amount}).build()}createTransactionForAddingNodes(e){if(e.publicKeys.length!==e.signedMessages.length)throw new s.Err("The number of public keys should match the number of signed messages");const t=e.signedMessages.map((e=>new o.BytesValue(Buffer.from(e)))),r=this.argSerializer.valuesToStrings(t),n=e.publicKeys.length,i=["addNodes"];for(let t=0;t<n;t++)i.push(e.publicKeys[t].hex(),r[t]);return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:i,gasLimit:this.computeExecutionGasLimitForNodesManagement(n),addDataMovementGas:!0}).build()}createTransactionForRemovingNodes(e){const t=["removeNodes"];for(const r of e.publicKeys)t.push(r.hex());const r=e.publicKeys.length;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:this.computeExecutionGasLimitForNodesManagement(r),addDataMovementGas:!0}).build()}createTransactionForStakingNodes(e){let t=["stakeNodes"];for(const r of e.publicKeys)t=t.concat(r.hex());const r=e.publicKeys.length,n=BigInt(r)*this.config.additionalGasLimitPerValidatorNode+this.config.gasLimitStake+this.config.gasLimitDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForUnbondingNodes(e){let t=["unBondNodes"];for(const r of e.publicKeys)t=t.concat(r.hex());const r=e.publicKeys.length,n=BigInt(r)*this.config.additionalGasLimitPerValidatorNode+this.config.gasLimitUnbond+this.config.gasLimitDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForUnstakingNodes(e){let t=["unStakeNodes"];for(const r of e.publicKeys)t=t.concat(r.hex());const r=e.publicKeys.length,n=BigInt(r)*this.config.additionalGasLimitPerValidatorNode+this.config.gasLimitUnstake+this.config.gasLimitDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}createTransactionForUnjailingNodes(e){const t=["unJailNodes"];for(const r of e.publicKeys)t.push(r.hex());const r=e.publicKeys.length;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:this.computeExecutionGasLimitForNodesManagement(r),addDataMovementGas:!0}).build()}createTransactionForChangingServiceFee(e){const t=["changeServiceFee",this.argSerializer.valuesToStrings([new o.BigUIntValue(e.serviceFee)])[0]],r=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForModifyingDelegationCap(e){const t=["modifyTotalDelegationCap",this.argSerializer.valuesToStrings([new o.BigUIntValue(e.delegationCap)])[0]],r=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForSettingAutomaticActivation(e){const t=["setAutomaticActivation",this.argSerializer.valuesToStrings([new o.StringValue("true")])[0]],r=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForUnsettingAutomaticActivation(e){const t=["setAutomaticActivation",this.argSerializer.valuesToStrings([new o.StringValue("false")])[0]],r=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForSettingCapCheckOnRedelegateRewards(e){const t=["setCheckCapOnReDelegateRewards",this.argSerializer.valuesToStrings([new o.StringValue("true")])[0]],r=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForUnsettingCapCheckOnRedelegateRewards(e){const t=["setCheckCapOnReDelegateRewards",this.argSerializer.valuesToStrings([new o.StringValue("false")])[0]],r=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}createTransactionForSettingMetadata(e){const t=["setMetaData",...this.argSerializer.valuesToStrings([new o.StringValue(e.name),new o.StringValue(e.website),new o.StringValue(e.identifier)])],r=this.config.gasLimitDelegationOperations+this.config.additionalGasLimitForDelegationOperations;return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.delegationContract,dataParts:t,gasLimit:r,addDataMovementGas:!0}).build()}computeExecutionGasLimitForNodesManagement(e){const t=this.config.additionalGasLimitPerValidatorNode*BigInt(e);return this.config.gasLimitDelegationOperations+t}}},3102:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7673),t),i(r(2713),t),i(r(9712),t),i(r(6943),t),i(r(3473),t),i(r(4934),t),i(r(6520),t)},2713:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RelayedTransactionsFactory=void 0;const i=n(r(1594)),s=r(236),o=r(2581),a=r(661),u=r(476),c=r(1013);t.RelayedTransactionsFactory=class{constructor(e){this.config=e.config}createRelayedV1Transaction(e){if(!e.innerTransaction.gasLimit)throw new o.ErrInvalidInnerTransaction("The gas limit is not set for the inner transaction");if(!e.innerTransaction.signature.length)throw new o.ErrInvalidInnerTransaction("The inner transaction is not signed");const t=this.prepareInnerTransactionForRelayedV1(e.innerTransaction),r=`relayedTx@${Buffer.from(t).toString("hex")}`,n=this.config.gasLimitPerByte*BigInt(r.length),i=this.config.minGasLimit+n+e.innerTransaction.gasLimit;return new u.Transaction({chainID:this.config.chainID,sender:e.relayerAddress.bech32(),receiver:e.innerTransaction.sender,gasLimit:i,data:Buffer.from(r)})}createRelayedV2Transaction(e){if(e.innerTransaction.gasLimit)throw new o.ErrInvalidInnerTransaction("The gas limit should not be set for the inner transaction");if(!e.innerTransaction.signature.length)throw new o.ErrInvalidInnerTransaction("The inner transaction is not signed");const{argumentsString:t}=(new a.ArgSerializer).valuesToString([new a.AddressValue(s.Address.fromBech32(e.innerTransaction.receiver)),new a.U64Value(new i.default(e.innerTransaction.nonce.toString())),new a.BytesValue(Buffer.from(e.innerTransaction.data)),new a.BytesValue(Buffer.from(e.innerTransaction.signature))]),r=`relayedTxV2@${t}`,n=this.config.gasLimitPerByte*BigInt(r.length),c=e.innerTransactionGasLimit+this.config.minGasLimit+n;return new u.Transaction({sender:e.relayerAddress.bech32(),receiver:e.innerTransaction.sender,value:0n,gasLimit:c,chainID:this.config.chainID,data:Buffer.from(r),version:e.innerTransaction.version,options:e.innerTransaction.options})}prepareInnerTransactionForRelayedV1(e){const t={nonce:e.nonce,sender:s.Address.fromBech32(e.sender).pubkey().toString("base64"),receiver:s.Address.fromBech32(e.receiver).pubkey().toString("base64"),value:e.value,gasPrice:e.gasPrice,gasLimit:e.gasLimit,data:Buffer.from(e.data).toString("base64"),signature:Buffer.from(e.signature).toString("base64"),chainID:Buffer.from(e.chainID).toString("base64"),version:e.version,options:0==e.options.valueOf()?void 0:e.options,guardian:e.guardian?s.Address.fromBech32(e.guardian).pubkey().toString("base64"):void 0,guardianSignature:e.guardianSignature.length?Buffer.from(e.guardianSignature).toString("base64"):void 0,sndUserName:e.senderUsername?Buffer.from(e.senderUsername).toString("base64"):void 0,rcvUserName:e.receiverUsername?Buffer.from(e.receiverUsername).toString("base64"):void 0};return c.stringify(t)}}},9712:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SmartContractTransactionsFactory=void 0;const n=r(236),i=r(7353),s=r(2581),o=r(6458),a=r(661),u=r(670),c=r(5132),l=r(9161),f=r(5560),d=r(4059);t.SmartContractTransactionsFactory=class{constructor(e){this.config=e.config,this.abi=e.abi,this.tokenComputer=new c.TokenComputer,this.dataArgsBuilder=new f.TokenTransfersDataBuilder}createTransactionForDeploy(e){const t=e.nativeTransferAmount??0n,r=e.isUpgradeable??!0,s=e.isReadable??!0,o=e.isPayable??!1,u=e.isPayableBySmartContract??!0,c=e.arguments||[],f=new a.CodeMetadata(r,s,o,u),h=[l.byteArrayToHex(e.bytecode),l.byteArrayToHex(i.VM_TYPE_WASM_VM),f.toString()],g=this.abi?.constructorDefinition,p=this.argsToDataParts(c,g);return h.push(...p),new d.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.CONTRACT_DEPLOY_ADDRESS),dataParts:h,gasLimit:e.gasLimit,addDataMovementGas:!1,amount:t}).build()}createTransactionForExecute(e){const t=e.arguments||[],r=e.tokenTransfers||[],n=e.nativeTransferAmount??0n,i=r.length;if(n&&i)throw new s.ErrBadUsage("Can't send both native tokens and custom tokens(ESDT/NFT)");let o=e.contract,a=[];if(1===i){const t=r[0];this.tokenComputer.isFungible(t.token)?a=this.dataArgsBuilder.buildDataPartsForESDTTransfer(t):(a=this.dataArgsBuilder.buildDataPartsForSingleESDTNFTTransfer(t,o),o=e.sender)}else i>1&&(a=this.dataArgsBuilder.buildDataPartsForMultiESDTNFTTransfer(o,r),o=e.sender);a.push(a.length?l.utf8ToHex(e.function):e.function);const u=this.abi?.getEndpoint(e.function),c=this.argsToDataParts(t,u);return a.push(...c),new d.TransactionBuilder({config:this.config,sender:e.sender,receiver:o,dataParts:a,gasLimit:e.gasLimit,addDataMovementGas:!1,amount:n}).build()}createTransactionForUpgrade(e){const t=e.nativeTransferAmount??0n,r=e.isUpgradeable??!0,n=e.isReadable??!0,i=e.isPayable??!1,s=e.isPayableBySmartContract??!0,o=e.arguments||[],u=new a.CodeMetadata(r,n,i,s),c=["upgradeContract",l.byteArrayToHex(e.bytecode),u.toString()],f=this.getEndpointForUpgrade(),h=this.argsToDataParts(o,f);return c.push(...h),new d.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.contract,dataParts:c,gasLimit:e.gasLimit,addDataMovementGas:!1,amount:t}).build()}getEndpointForUpgrade(){if(this.abi)try{return this.abi.getEndpoint("upgrade")}catch(e){return o.Logger.warn("In the ABI, cannot find the 'upgrade' endpoint definition. Will use the constructor definition (fallback)."),this.abi.constructorDefinition}}createTransactionForClaimingDeveloperRewards(e){return new d.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.contract,dataParts:["ClaimDeveloperRewards"],gasLimit:this.config.gasLimitClaimDeveloperRewards,addDataMovementGas:!1}).build()}createTransactionForChangingOwnerAddress(e){const t=["ChangeOwnerAddress",n.Address.fromBech32(e.newOwner.bech32()).toHex()];return new d.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.contract,dataParts:t,gasLimit:this.config.gasLimitChangeOwnerAddress,addDataMovementGas:!1}).build()}argsToDataParts(e,t){if(t){const r=u.NativeSerializer.nativeToTypedValues(e,t);return(new a.ArgSerializer).valuesToStrings(r)}if(this.areArgsOfTypedValue(e))return(new a.ArgSerializer).valuesToStrings(e);throw new s.Err("Can't convert args to TypedValues")}areArgsOfTypedValue(e){for(const t of e)if(!t.belongsToTypesystem)return!1;return!0}}},6943:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TokenManagementTransactionsFactory=void 0;const n=r(236),i=r(7353),s=r(6458),o=r(661),a=r(4059);t.TokenManagementTransactionsFactory=class{constructor(e){this.config=e.config,this.argSerializer=new o.ArgSerializer,this.trueAsString="true",this.falseAsString="false"}createTransactionForIssuingFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.BigUIntValue(e.initialSupply),new o.BigUIntValue(e.numDecimals),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],r=["issue",...this.argSerializer.valuesToStrings(t)];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.ESDT_CONTRACT_ADDRESS),dataParts:r,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForIssuingSemiFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canTransferNFTCreateRole"),new o.StringValue(this.boolToString(e.canTransferNFTCreateRole)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],r=["issueSemiFungible",...this.argSerializer.valuesToStrings(t)];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.ESDT_CONTRACT_ADDRESS),dataParts:r,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForIssuingNonFungible(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canTransferNFTCreateRole"),new o.StringValue(this.boolToString(e.canTransferNFTCreateRole)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],r=["issueNonFungible",...this.argSerializer.valuesToStrings(t)];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.ESDT_CONTRACT_ADDRESS),dataParts:r,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForRegisteringMetaESDT(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=[new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.BigUIntValue(e.numDecimals),new o.StringValue("canFreeze"),new o.StringValue(this.boolToString(e.canFreeze)),new o.StringValue("canWipe"),new o.StringValue(this.boolToString(e.canWipe)),new o.StringValue("canPause"),new o.StringValue(this.boolToString(e.canPause)),new o.StringValue("canTransferNFTCreateRole"),new o.StringValue(this.boolToString(e.canTransferNFTCreateRole)),new o.StringValue("canChangeOwner"),new o.StringValue(this.boolToString(e.canChangeOwner)),new o.StringValue("canUpgrade"),new o.StringValue(this.boolToString(e.canUpgrade)),new o.StringValue("canAddSpecialRoles"),new o.StringValue(this.boolToString(e.canAddSpecialRoles))],r=["registerMetaESDT",...this.argSerializer.valuesToStrings(t)];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.ESDT_CONTRACT_ADDRESS),dataParts:r,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForRegisteringAndSettingRoles(e){this.notifyAboutUnsettingBurnRoleGlobally();const t=["registerAndSetAllRoles",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenName),new o.StringValue(e.tokenTicker),new o.StringValue(e.tokenType),new o.BigUIntValue(e.numDecimals)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.ESDT_CONTRACT_ADDRESS),dataParts:t,gasLimit:this.config.gasLimitIssue,addDataMovementGas:!0,amount:this.config.issueCost}).build()}createTransactionForSettingBurnRoleGlobally(e){const t=["setBurnRoleGlobally",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.ESDT_CONTRACT_ADDRESS),dataParts:t,gasLimit:this.config.gasLimitToggleBurnRoleGlobally,addDataMovementGas:!0}).build()}createTransactionForUnsettingBurnRoleGlobally(e){const t=["unsetBurnRoleGlobally",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.ESDT_CONTRACT_ADDRESS),dataParts:t,gasLimit:this.config.gasLimitToggleBurnRoleGlobally,addDataMovementGas:!0}).build()}createTransactionForSettingSpecialRoleOnFungibleToken(e){const t=[new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)];e.addRoleLocalMint&&t.push(new o.StringValue("ESDTRoleLocalMint")),e.addRoleLocalBurn&&t.push(new o.StringValue("ESDTRoleLocalBurn")),e.addRoleESDTTransferRole&&t.push(new o.StringValue("ESDTTransferRole"));const r=["setSpecialRole",...this.argSerializer.valuesToStrings(t)];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.ESDT_CONTRACT_ADDRESS),dataParts:r,gasLimit:this.config.gasLimitSetSpecialRole,addDataMovementGas:!0}).build()}createTransactionForSettingSpecialRoleOnSemiFungibleToken(e){const t=[new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)];e.addRoleNFTCreate&&t.push(new o.StringValue("ESDTRoleNFTCreate")),e.addRoleNFTBurn&&t.push(new o.StringValue("ESDTRoleNFTBurn")),e.addRoleNFTAddQuantity&&t.push(new o.StringValue("ESDTRoleNFTAddQuantity")),e.addRoleESDTTransferRole&&t.push(new o.StringValue("ESDTTransferRole"));const r=["setSpecialRole",...this.argSerializer.valuesToStrings(t)];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.ESDT_CONTRACT_ADDRESS),dataParts:r,gasLimit:this.config.gasLimitSetSpecialRole,addDataMovementGas:!0}).build()}createTransactionForSettingSpecialRoleOnMetaESDT(e){return this.createTransactionForSettingSpecialRoleOnSemiFungibleToken(e)}createTransactionForSettingSpecialRoleOnNonFungibleToken(e){const t=[new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)];e.addRoleNFTCreate&&t.push(new o.StringValue("ESDTRoleNFTCreate")),e.addRoleNFTBurn&&t.push(new o.StringValue("ESDTRoleNFTBurn")),e.addRoleNFTUpdateAttributes&&t.push(new o.StringValue("ESDTRoleNFTUpdateAttributes")),e.addRoleNFTAddURI&&t.push(new o.StringValue("ESDTRoleNFTAddURI")),e.addRoleESDTTransferRole&&t.push(new o.StringValue("ESDTTransferRole"));const r=["setSpecialRole",...this.argSerializer.valuesToStrings(t)];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:n.Address.fromBech32(i.ESDT_CONTRACT_ADDRESS),dataParts:r,gasLimit:this.config.gasLimitSetSpecialRole,addDataMovementGas:!0}).build()}createTransactionForCreatingNFT(e){const t=["ESDTNFTCreate",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.initialQuantity),new o.StringValue(e.name),new o.BigUIntValue(e.royalties),new o.StringValue(e.hash),new o.BytesValue(Buffer.from(e.attributes)),...e.uris.map((e=>new o.StringValue(e)))])],r=e.name+e.hash+e.attributes+e.uris.join(""),n=this.config.gasLimitStorePerByte+BigInt(r.length);return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftCreate+n,addDataMovementGas:!0}).build()}createTransactionForPausing(e){const t=["pause",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitPausing,addDataMovementGas:!0}).build()}createTransactionForUnpausing(e){const t=["unPause",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitPausing,addDataMovementGas:!0}).build()}createTransactionForFreezing(e){const t=["freeze",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitFreezing,addDataMovementGas:!0}).build()}createTransactionForUnfreezing(e){const t=["UnFreeze",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitFreezing,addDataMovementGas:!0}).build()}createTransactionForWiping(e){const t=["wipe",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.AddressValue(e.user)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitWiping,addDataMovementGas:!0}).build()}createTransactionForLocalMint(e){const t=["ESDTLocalMint",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.supplyToMint)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtLocalMint,addDataMovementGas:!0}).build()}createTransactionForLocalBurning(e){const t=["ESDTLocalBurn",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.supplyToBurn)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtLocalBurn,addDataMovementGas:!0}).build()}createTransactionForUpdatingAttributes(e){const t=["ESDTNFTUpdateAttributes",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BytesValue(Buffer.from(e.attributes))])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftUpdateAttributes,addDataMovementGas:!0}).build()}createTransactionForAddingQuantity(e){const t=["ESDTNFTAddQuantity",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BigUIntValue(e.quantityToAdd)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftAddQuantity,addDataMovementGas:!0}).build()}createTransactionForBurningQuantity(e){const t=["ESDTNFTBurn",...this.argSerializer.valuesToStrings([new o.StringValue(e.tokenIdentifier),new o.BigUIntValue(e.tokenNonce),new o.BigUIntValue(e.quantityToBurn)])];return new a.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:t,gasLimit:this.config.gasLimitEsdtNftBurn,addDataMovementGas:!0}).build()}notifyAboutUnsettingBurnRoleGlobally(){s.Logger.info('\n==========\nIMPORTANT!\n==========\nYou are about to issue (register) a new token. This will set the role "ESDTRoleBurnForAll" (globally).\nOnce the token is registered, you can unset this role by calling "unsetBurnRoleGlobally" (in a separate transaction).')}boolToString(e){return e?this.trueAsString:this.falseAsString}}},5560:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TokenTransfersDataBuilder=void 0;const n=r(1157),i=r(2747),s=r(5132);t.TokenTransfersDataBuilder=class{constructor(){this.tokenComputer=new s.TokenComputer,this.argsSerializer=new n.ArgSerializer}buildDataPartsForESDTTransfer(e){return["ESDTTransfer",...this.argsSerializer.valuesToStrings([new i.TokenIdentifierValue(e.token.identifier),new i.BigUIntValue(e.amount)])]}buildDataPartsForSingleESDTNFTTransfer(e,t){const r=e.token,n=this.tokenComputer.extractIdentifierFromExtendedIdentifier(r.identifier);return["ESDTNFTTransfer",...this.argsSerializer.valuesToStrings([new i.TokenIdentifierValue(n),new i.BigUIntValue(r.nonce),new i.BigUIntValue(e.amount),new i.AddressValue(t)])]}buildDataPartsForMultiESDTNFTTransfer(e,t){const r=[new i.AddressValue(e),new i.U32Value(t.length)];for(const e of t){const t=this.tokenComputer.extractIdentifierFromExtendedIdentifier(e.token.identifier);r.push(new i.TokenIdentifierValue(t),new i.BigUIntValue(e.token.nonce),new i.BigUIntValue(e.amount))}return["MultiESDTNFTTransfer",...this.argsSerializer.valuesToStrings(r)]}}},4059:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionBuilder=void 0;const n=r(7353),i=r(476),s=r(3548);t.TransactionBuilder=class{constructor(e){this.config=e.config,this.sender=e.sender,this.receiver=e.receiver,this.dataParts=e.dataParts,this.providedGasLimit=e.gasLimit,this.addDataMovementGas=e.addDataMovementGas,this.amount=e.amount}computeGasLimit(e){if(!this.addDataMovementGas)return this.providedGasLimit;return this.config.minGasLimit+this.config.gasLimitPerByte*BigInt(e.length())+this.providedGasLimit}buildTransactionPayload(){const e=this.dataParts.join(n.ARGUMENTS_SEPARATOR);return new s.TransactionPayload(e)}build(){const e=this.buildTransactionPayload(),t=this.computeGasLimit(e);return new i.Transaction({sender:this.sender.bech32(),receiver:this.receiver.bech32(),gasLimit:t,value:this.amount||0n,data:e.valueOf(),chainID:this.config.chainID})}}},3473:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionsFactoryConfig=void 0;const n=r(7353);t.TransactionsFactoryConfig=class{constructor(e){this.chainID=e.chainID,this.addressHrp=n.DEFAULT_HRP,this.minGasLimit=50000n,this.gasLimitPerByte=1500n,this.gasLimitIssue=60000000n,this.gasLimitToggleBurnRoleGlobally=60000000n,this.gasLimitEsdtLocalMint=300000n,this.gasLimitEsdtLocalBurn=300000n,this.gasLimitSetSpecialRole=60000000n,this.gasLimitPausing=60000000n,this.gasLimitFreezing=60000000n,this.gasLimitWiping=60000000n,this.gasLimitEsdtNftCreate=3000000n,this.gasLimitEsdtNftUpdateAttributes=1000000n,this.gasLimitEsdtNftAddQuantity=1000000n,this.gasLimitEsdtNftBurn=1000000n,this.gasLimitStorePerByte=10000n,this.issueCost=50000000000000000n,this.gasLimitStake=5000000n,this.gasLimitUnstake=5000000n,this.gasLimitUnbond=5000000n,this.gasLimitCreateDelegationContract=50000000n,this.gasLimitDelegationOperations=1000000n,this.additionalGasLimitPerValidatorNode=6000000n,this.additionalGasLimitForDelegationOperations=10000000n,this.gasLimitSaveKeyValue=100000n,this.gasLimitPersistPerByte=1000n,this.gasLimitSetGuardian=250000n,this.gasLimitGuardAccount=250000n,this.gasLimitUnguardAccount=250000n,this.gasLimitESDTTransfer=200000n,this.gasLimitESDTNFTTransfer=200000n,this.gasLimitMultiESDTNFTTransfer=200000n,this.gasLimitClaimDeveloperRewards=6000000n,this.gasLimitChangeOwnerAddress=6000000n}}},4934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransferTransactionsFactory=void 0;const n=r(2581),i=r(661),s=r(5132),o=r(476),a=r(3548),u=r(5560),c=r(4059),l=8e5;t.TransferTransactionsFactory=class{constructor(e){this.isGasEstimator(e)?this.gasEstimator=e:(this.config=e.config,this.tokenComputer=new s.TokenComputer,this.tokenTransfersDataBuilder=new u.TokenTransfersDataBuilder)}isGasEstimator(e){return"object"==typeof e&&"function"==typeof e.forEGLDTransfer&&"function"==typeof e.forESDTTransfer&&"function"==typeof e.forESDTNFTTransfer&&"function"==typeof e.forMultiESDTNFTTransfer}isGasEstimatorDefined(){return void 0!==this.gasEstimator}ensureMembersAreDefined(){if(void 0===this.config)throw new n.Err("'config' is not defined");if(void 0===this.tokenTransfersDataBuilder)throw new n.Err("`dataArgsBuilder is not defined`");if(void 0===this.tokenComputer)throw new n.Err("`tokenComputer is not defined`")}createTransactionForNativeTokenTransfer(e){this.ensureMembersAreDefined();const t=e.data||new Uint8Array;return new o.Transaction({sender:e.sender.bech32(),receiver:e.receiver.bech32(),chainID:this.config.chainID,gasLimit:this.computeGasForMoveBalance(this.config,t),data:t,value:e.nativeAmount})}createTransactionForESDTTokenTransfer(e){this.ensureMembersAreDefined();const t=e.tokenTransfers.length;if(0===t)throw new n.ErrBadUsage("No token transfer has been provided");if(1===t)return this.createSingleESDTTransferTransaction(e);const r=this.tokenTransfersDataBuilder.buildDataPartsForMultiESDTNFTTransfer(e.receiver,e.tokenTransfers),i=this.config.gasLimitMultiESDTNFTTransfer*BigInt(t)+BigInt(l);return new c.TransactionBuilder({config:this.config,sender:e.sender,receiver:e.sender,dataParts:r,gasLimit:i,addDataMovementGas:!0}).build()}createEGLDTransfer(e){if(!this.isGasEstimatorDefined())throw new n.Err("You are calling a legacy function to create an EGLD transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForNativeTokenTransfer` method.");const t=e.data?.length()||0,r=this.gasEstimator.forEGLDTransfer(t);return new o.Transaction({nonce:e.nonce,value:e.value,receiver:e.receiver,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||r,data:e.data,chainID:e.chainID})}createESDTTransfer(e){if(!this.isGasEstimatorDefined())throw new n.Err("You are calling a legacy function to create an ESDT transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForESDTTokenTransfer` method.");const{argumentsString:t}=(new i.ArgSerializer).valuesToString([i.BytesValue.fromUTF8(e.tokenTransfer.tokenIdentifier),new i.BigUIntValue(e.tokenTransfer.valueOf())]),r=`ESDTTransfer@${t}`,s=new a.TransactionPayload(r),u=s.length()||0,c=this.gasEstimator.forESDTTransfer(u);return new o.Transaction({nonce:e.nonce,receiver:e.receiver,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||c,data:s,chainID:e.chainID})}createESDTNFTTransfer(e){if(!this.isGasEstimatorDefined())throw new n.Err("You are calling a legacy function to create an ESDTNFT transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForESDTTokenTransfer` method.");const{argumentsString:t}=(new i.ArgSerializer).valuesToString([i.BytesValue.fromUTF8(e.tokenTransfer.tokenIdentifier),new i.U64Value(e.tokenTransfer.nonce),new i.BigUIntValue(e.tokenTransfer.valueOf()),new i.AddressValue(e.destination)]),r=`ESDTNFTTransfer@${t}`,s=new a.TransactionPayload(r),u=s.length()||0,c=this.gasEstimator.forESDTNFTTransfer(u);return new o.Transaction({nonce:e.nonce,receiver:e.sender,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||c,data:s,chainID:e.chainID})}createMultiESDTNFTTransfer(e){if(!this.isGasEstimatorDefined())throw new n.Err("You are calling a legacy function to create a MultiESDTNFT transfer transaction. If this is your intent, then instantiate the class using a `GasEstimator`. Or, instead, use the new, recommended `createTransactionForESDTTokenTransfer` method.");const t=[new i.AddressValue(e.destination),new i.U16Value(e.tokenTransfers.length)];for(const r of e.tokenTransfers)t.push(i.BytesValue.fromUTF8(r.tokenIdentifier),new i.U64Value(r.nonce),new i.BigUIntValue(r.valueOf()));const{argumentsString:r}=(new i.ArgSerializer).valuesToString(t),s=`MultiESDTNFTTransfer@${r}`,u=new a.TransactionPayload(s),c=u.length()||0,l=this.gasEstimator.forMultiESDTNFTTransfer(c,e.tokenTransfers.length);return new o.Transaction({nonce:e.nonce,receiver:e.sender,sender:e.sender,gasPrice:e.gasPrice,gasLimit:e.gasLimit||l,data:u,chainID:e.chainID})}createSingleESDTTransferTransaction(e){this.ensureMembersAreDefined();let t=[];const r=e.tokenTransfers[0];let n=0n,i=e.receiver;return this.tokenComputer.isFungible(r.token)?(t=this.tokenTransfersDataBuilder.buildDataPartsForESDTTransfer(r),n=this.config.gasLimitESDTTransfer+BigInt(1e5)):(t=this.tokenTransfersDataBuilder.buildDataPartsForSingleESDTNFTTransfer(r,i),n=this.config.gasLimitESDTNFTTransfer+BigInt(l),i=e.sender),new c.TransactionBuilder({config:this.config,sender:e.sender,receiver:i,dataParts:t,gasLimit:n,addDataMovementGas:!0}).build()}computeGasForMoveBalance(e,t){return e.minGasLimit+e.gasLimitPerByte*BigInt(t.length)}}},3217:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.gatherAllEvents=t.findEventsByFirstTopic=t.findEventsByIdentifier=t.findEventsByPredicate=t.SmartContractCallOutcome=t.TransactionOutcome=t.SmartContractResult=t.TransactionLogs=t.TransactionEvent=void 0;t.TransactionEvent=class{constructor(e){this.address="",this.identifier="",this.topics=[],this.dataItems=[],Object.assign(this,e)}};class r{constructor(e){this.address="",this.events=[],Object.assign(this,e)}}t.TransactionLogs=r;t.SmartContractResult=class{constructor(e){this.sender="",this.receiver="",this.data=new Uint8Array,this.logs=new r({}),Object.assign(this,e)}};t.TransactionOutcome=class{constructor(e){this.directSmartContractCallOutcome=new n({}),this.smartContractResults=[],this.logs=new r({}),Object.assign(this,e)}};class n{constructor(e){this.function="",this.returnDataParts=[],this.returnMessage="",this.returnCode="",Object.assign(this,e)}}function i(e,t){return s(e).filter(t)}function s(e){const t=[];t.push(...e.logs.events);for(const r of e.smartContractResults)t.push(...r.logs.events);return t}t.SmartContractCallOutcome=n,t.findEventsByPredicate=i,t.findEventsByIdentifier=function(e,t){return i(e,(e=>e.identifier==t))},t.findEventsByFirstTopic=function(e,t){return i(e,(e=>e.topics[0]?.toString()==t))},t.gatherAllEvents=s},9161:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.addressToHex=t.bigIntToHex=t.byteArrayToHex=t.boolToHex=t.utf8ToHex=t.zeroPadStringIfOddLength=t.isPaddedHex=t.numberToPaddedHex=void 0;const a=o(r(1594)),u=r(236),c=s(r(7553));function l(e){return(e=e||"").length%2==1?"0"+e:e}function f(e){return l(Buffer.from(e).toString("hex"))}t.numberToPaddedHex=function(e){let t;return t="bigint"==typeof e||"number"==typeof e?e:new a.default(e),l(t.toString(16))},t.isPaddedHex=function(e){e=e||"";let t=Buffer.from(e,"hex").toString("hex");return e.toUpperCase()==t.toUpperCase()},t.zeroPadStringIfOddLength=l,t.utf8ToHex=f,t.boolToHex=function(e){return f(e.toString())},t.byteArrayToHex=function(e){return l(Buffer.from(e).toString("hex"))},t.bigIntToHex=function(e){return 0==e?"":c.getHexMagnitudeOfBigInt(e)},t.addressToHex=function(e){return u.Address.fromBech32(e.toString()).pubkey().toString("hex")}},1069:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.isEmpty=t.guardEmpty=t.guardNotEmpty=t.guardLength=t.guardSameLength=t.guardValueIsSetWithMessage=t.guardValueIsSet=t.guardTrue=void 0;const o=s(r(2581));function a(e,t){if(null==t||void 0===t)throw new o.ErrInvariantFailed(e)}function u(e){return e.isEmpty?e.isEmpty():0===e.length}t.guardTrue=function(e,t){if(!e)throw new o.ErrInvariantFailed(`[<${t}>] isn't true`)},t.guardValueIsSet=function(e,t){a(`${e} isn't set (null or undefined)`,t)},t.guardValueIsSetWithMessage=a,t.guardSameLength=function(e,t){if(t=t||[],(e=e||[]).length!=t.length)throw new o.ErrInvariantFailed("arrays do not have the same length")},t.guardLength=function(e,t){let r=e.length||0;if(r!=t)throw new o.ErrInvariantFailed(`wrong length, expected: ${t}, actual: ${r}`)},t.guardNotEmpty=function(e,t){if(u(e))throw new o.ErrInvariantFailed(`${t} is empty`)},t.guardEmpty=function(e,t){if(!u(e))throw new o.ErrInvariantFailed(`${t} is not empty`)},t.isEmpty=u},84:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.GuardianData=t.AccountOnNetwork=void 0;const i=n(r(1594)),s=r(1466);class o{constructor(e){this.address=new s.Address(""),this.nonce=0,this.balance=new i.default(0),this.code="",this.userName="",Object.assign(this,e)}static fromHttpResponse(e){let t=new o;return t.address=new s.Address(e.address||""),t.nonce=Number(e.nonce||0),t.balance=new i.default(e.balance||0),t.code=e.code||"",t.userName=e.username||"",t}}t.AccountOnNetwork=o;class a{constructor(e){this.guarded=!1,Object.assign(this,e)}static fromHttpResponse(e){const t=new a;return t.guarded=e.guarded||!1,e.activeGuardian&&(t.activeGuardian=u.fromHttpResponse(e.activeGuardian)),e.pendingGuardian&&(t.pendingGuardian=u.fromHttpResponse(e.pendingGuardian)),t}getCurrentGuardianAddress(){var e;if(this.guarded)return null===(e=this.activeGuardian)||void 0===e?void 0:e.address}}t.GuardianData=a;class u{constructor(){this.activationEpoch=0,this.address=new s.Address(""),this.serviceUID=""}static fromHttpResponse(e){const t=new u;return t.activationEpoch=Number(e.activationEpoch||0),t.address=new s.Address(e.address||""),t.serviceUID=e.serviceUID||"",t}}},6482:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultPagination=t.defaultAxiosConfig=void 0;const n=r(1013)({constructorAction:"ignore"});t.defaultAxiosConfig={timeout:5e3,transformResponse:[function(e){return n.parse(e)}]},t.defaultPagination={from:0,size:100}},4027:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EsdtContractAddress=t.MaxUint64AsBigNumber=void 0;const i=n(r(1594)),s=r(1466);t.MaxUint64AsBigNumber=new i.default("18446744073709551615"),t.EsdtContractAddress=new s.Address("erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u")},8419:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContractQueryRequest=void 0;t.ContractQueryRequest=class{constructor(e){this.query=e}toHttpRequest(){var e;let t={},r=this.query;return t.scAddress=r.address.bech32(),t.caller=(null===(e=r.caller)||void 0===e?void 0:e.bech32())?r.caller.bech32():void 0,t.funcName=r.func.toString(),t.value=r.value?r.value.toString():void 0,t.args=r.getEncodedArguments(),t}}},3767:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractQueryResponse=void 0;const i=n(r(1594)),s=r(4027);class o{constructor(e){this.returnData=(null==e?void 0:e.returnData)||[],this.returnCode=(null==e?void 0:e.returnCode)||"",this.returnMessage=(null==e?void 0:e.returnMessage)||"",this.gasUsed=(null==e?void 0:e.gasUsed)||0}static fromHttpResponse(e){let t=e.returnData||e.ReturnData,r=e.returnCode||e.ReturnCode,n=e.returnMessage||e.ReturnMessage,a=new i.default(e.gasRemaining||e.GasRemaining||0),u=s.MaxUint64AsBigNumber.minus(a).toNumber();return new o({returnData:t,returnCode:r,returnMessage:n,gasUsed:u})}getReturnDataParts(){return this.returnData.map((e=>Buffer.from(e||"","base64")))}toJSON(){return{returnData:this.returnData,returnCode:this.returnCode,returnMessage:this.returnMessage,gasUsed:this.gasUsed.valueOf()}}}t.ContractQueryResponse=o},2286:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContractResultItem=t.ContractResults=void 0;const n=r(9857),i=r(1466);class s{constructor(e){this.items=e,this.items.sort((function(e,t){return e.nonce.valueOf()-t.nonce.valueOf()}))}static fromProxyHttpResponse(e){let t=e.map((e=>o.fromProxyHttpResponse(e)));return new s(t)}static fromApiHttpResponse(e){let t=e.map((e=>o.fromApiHttpResponse(e)));return new s(t)}}t.ContractResults=s;class o{constructor(e){this.hash="",this.nonce=0,this.value="",this.receiver=new i.Address(""),this.sender=new i.Address(""),this.data="",this.previousHash="",this.originalHash="",this.gasLimit=0,this.gasPrice=0,this.callType=0,this.returnMessage="",this.logs=new n.TransactionLogs,Object.assign(this,e)}static fromProxyHttpResponse(e){return o.fromHttpResponse(e)}static fromApiHttpResponse(e){let t=o.fromHttpResponse(e);return t.data=Buffer.from(t.data,"base64").toString(),t.callType=Number(t.callType),t}static fromHttpResponse(e){let t=new o;return t.hash=e.hash,t.nonce=Number(e.nonce||0),t.value=(e.value||0).toString(),t.receiver=new i.Address(e.receiver),t.sender=new i.Address(e.sender),t.previousHash=e.prevTxHash,t.originalHash=e.originalTxHash,t.gasLimit=Number(e.gasLimit||0),t.gasPrice=Number(e.gasPrice||0),t.data=e.data||"",t.callType=e.callType,t.returnMessage=e.returnMessage,t.logs=n.TransactionLogs.fromHttpResponse(e.logs||{}),t}}t.ContractResultItem=o},2591:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ErrContractQuery=t.ErrNetworkProvider=t.ErrUnexpectedCondition=t.Err=void 0;class r extends Error{constructor(e,t){super(e),this.inner=void 0,this.inner=t}}t.Err=r;t.ErrUnexpectedCondition=class extends r{constructor(e){super(`Unexpected condition: [${e}]`)}};t.ErrNetworkProvider=class extends r{constructor(e,t,r){super(`Request error on url [${e}]: [${t}]`,r)}};t.ErrContractQuery=class extends r{constructor(e){super(e.message.replace("executeQuery:",""))}}},3802:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkConfig=void 0;const i=n(r(1594));class s{constructor(){this.ChainID="T",this.GasPerDataByte=1500,this.TopUpFactor=0,this.RoundDuration=0,this.RoundsPerEpoch=0,this.TopUpRewardsGradientPoint=new i.default(0),this.MinGasLimit=5e4,this.MinGasPrice=1e9,this.GasPriceModifier=1,this.MinTransactionVersion=1}static fromHttpResponse(e){let t=new s;return t.ChainID=String(e.erd_chain_id),t.GasPerDataByte=Number(e.erd_gas_per_data_byte),t.TopUpFactor=Number(e.erd_top_up_factor),t.RoundDuration=Number(e.erd_round_duration),t.RoundsPerEpoch=Number(e.erd_rounds_per_epoch),t.TopUpRewardsGradientPoint=new i.default(e.erd_rewards_top_up_gradient_point),t.MinGasLimit=Number(e.erd_min_gas_limit),t.MinGasPrice=Number(e.erd_min_gas_price),t.MinTransactionVersion=Number(e.erd_min_transaction_version),t.GasPriceModifier=Number(e.erd_gas_price_modifier),t}}t.NetworkConfig=s},9358:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkStatus=void 0;class r{constructor(){this.CurrentRound=0,this.EpochNumber=0,this.HighestFinalNonce=0,this.Nonce=0,this.NonceAtEpochStart=0,this.NoncesPassedInCurrentEpoch=0,this.RoundAtEpochStart=0,this.RoundsPassedInCurrentEpoch=0,this.RoundsPerEpoch=0}static fromHttpResponse(e){let t=new r;return t.CurrentRound=Number(e.erd_current_round),t.EpochNumber=Number(e.erd_epoch_number),t.HighestFinalNonce=Number(e.erd_highest_final_nonce),t.Nonce=Number(e.erd_nonce),t.NonceAtEpochStart=Number(e.erd_nonce_at_epoch_start),t.NoncesPassedInCurrentEpoch=Number(e.erd_nonces_passed_in_current_epoch),t.RoundAtEpochStart=Number(e.erd_round_at_epoch_start),t.RoundsPassedInCurrentEpoch=Number(e.erd_rounds_passed_in_current_epoch),t.RoundsPerEpoch=Number(e.erd_rounds_per_epoch),t}}t.NetworkStatus=r},1466:function(e,t,r){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}),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)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.zeroPadStringIfOddLength=t.isPaddedHex=t.numberToPaddedHex=t.Nonce=t.Address=void 0;const o=s(r(9674));class a{constructor(e){this.value=e}static fromPubkey(e){let t=o.toWords(e),r=o.encode("erd",t);return new a(r)}bech32(){return this.value}toString(){return this.bech32()}}t.Address=a;function u(e){return c(e.toString(16))}function c(e){return(e=e||"").length%2==1?"0"+e:e}t.Nonce=class{constructor(e){this.value=e}valueOf(){return this.value}hex(){return u(this.value)}},t.numberToPaddedHex=u,t.isPaddedHex=function(e){e=e||"";let t=Buffer.from(e,"hex").toString("hex");return e.toUpperCase()==t.toUpperCase()},t.zeroPadStringIfOddLength=c},8403:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function o(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyNetworkProvider=void 0;const s=i(r(6425)),o=r(84),a=r(6482),u=r(4027),c=r(8419),l=r(3767),f=r(2591),d=r(3802),h=r(9358),g=r(8721),p=r(3962),m=r(6389),y=r(6188);t.ProxyNetworkProvider=class{constructor(e,t){this.url=e,this.config=Object.assign(Object.assign({},a.defaultAxiosConfig),t)}getNetworkConfig(){return n(this,void 0,void 0,(function*(){let e=yield this.doGetGeneric("network/config");return d.NetworkConfig.fromHttpResponse(e.config)}))}getNetworkStatus(){return n(this,void 0,void 0,(function*(){let e=yield this.doGetGeneric("network/status/4294967295");return h.NetworkStatus.fromHttpResponse(e.status)}))}getNetworkStakeStatistics(){return n(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}getNetworkGeneralStatistics(){return n(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}getAccount(e){return n(this,void 0,void 0,(function*(){let t=yield this.doGetGeneric(`address/${e.bech32()}`);return o.AccountOnNetwork.fromHttpResponse(t.account)}))}getGuardianData(e){return n(this,void 0,void 0,(function*(){const t=yield this.doGetGeneric(`address/${e.bech32()}/guardian-data`);return o.GuardianData.fromHttpResponse(t.guardianData)}))}getFungibleTokensOfAccount(e,t){return n(this,void 0,void 0,(function*(){let t=`address/${e.bech32()}/esdt`,r=yield this.doGetGeneric(t),n=Object.values(r.esdts).filter((e=>!e.nonce)).map((e=>p.FungibleTokenOfAccountOnNetwork.fromHttpResponse(e)));return n.sort(((e,t)=>e.identifier.localeCompare(t.identifier))),n}))}getNonFungibleTokensOfAccount(e,t){return n(this,void 0,void 0,(function*(){let t=`address/${e.bech32()}/esdt`,r=yield this.doGetGeneric(t),n=Object.values(r.esdts).filter((e=>e.nonce>=0)).map((e=>p.NonFungibleTokenOfAccountOnNetwork.fromProxyHttpResponse(e)));return n.sort(((e,t)=>e.identifier.localeCompare(t.identifier))),n}))}getFungibleTokenOfAccount(e,t){return n(this,void 0,void 0,(function*(){let r=yield this.doGetGeneric(`address/${e.bech32()}/esdt/${t}`);return p.FungibleTokenOfAccountOnNetwork.fromHttpResponse(r.tokenData)}))}getNonFungibleTokenOfAccount(e,t,r){return n(this,void 0,void 0,(function*(){let n=yield this.doGetGeneric(`address/${e.bech32()}/nft/${t}/nonce/${r.valueOf()}`);return p.NonFungibleTokenOfAccountOnNetwork.fromProxyHttpResponseByNonce(n.tokenData)}))}getTransaction(e,t){return n(this,void 0,void 0,(function*(){let r;!0===t&&(r=this.getTransactionStatus(e));let n=this.buildUrlWithQueryParameters(`transaction/${e}`,{withResults:"true"}),i=yield this.doGetGeneric(n);if(r){const t=yield r;return m.TransactionOnNetwork.fromProxyHttpResponse(e,i.transaction,t)}return m.TransactionOnNetwork.fromProxyHttpResponse(e,i.transaction)}))}getTransactionStatus(e){return n(this,void 0,void 0,(function*(){let t=yield this.doGetGeneric(`transaction/${e}/process-status`);return new y.TransactionStatus(t.status)}))}sendTransaction(e){return n(this,void 0,void 0,(function*(){const t=m.prepareTransactionForBroadcasting(e);return(yield this.doPostGeneric("transaction/send",t)).txHash}))}sendTransactions(e){return n(this,void 0,void 0,(function*(){const t=e.map((e=>m.prepareTransactionForBroadcasting(e))),r=yield this.doPostGeneric("transaction/send-multiple",t),n=Array(e.length).fill(null);for(let t=0;t<e.length;t++)n[t]=r.txsHashes[t.toString()]||null;return n}))}simulateTransaction(e){return n(this,void 0,void 0,(function*(){const t=m.prepareTransactionForBroadcasting(e);return yield this.doPostGeneric("transaction/simulate",t)}))}queryContract(e){return n(this,void 0,void 0,(function*(){try{let t=new c.ContractQueryRequest(e).toHttpRequest(),r=yield this.doPostGeneric("vm-values/query",t);return l.ContractQueryResponse.fromHttpResponse(r.data)}catch(e){throw new f.ErrContractQuery(e)}}))}getDefinitionOfFungibleToken(e){return n(this,void 0,void 0,(function*(){let t=yield this.getTokenProperties(e);return g.DefinitionOfFungibleTokenOnNetwork.fromResponseOfGetTokenProperties(e,t)}))}getTokenProperties(e){return n(this,void 0,void 0,(function*(){let t=Buffer.from(e).toString("hex");return(yield this.queryContract({address:u.EsdtContractAddress,func:"getTokenProperties",getEncodedArguments:()=>[t]})).getReturnDataParts()}))}getDefinitionOfTokenCollection(e){return n(this,void 0,void 0,(function*(){let t=yield this.getTokenProperties(e);return g.DefinitionOfTokenCollectionOnNetwork.fromResponseOfGetTokenProperties(e,t)}))}getNonFungibleToken(e,t){return n(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}doGetGeneric(e){return n(this,void 0,void 0,(function*(){return yield this.doGet(e)}))}doPostGeneric(e,t){return n(this,void 0,void 0,(function*(){return yield this.doPost(e,t)}))}doGet(e){return n(this,void 0,void 0,(function*(){let t=`${this.url}/${e}`;try{return(yield s.default.get(t,this.config)).data.data}catch(t){this.handleApiError(t,e)}}))}doPost(e,t){return n(this,void 0,void 0,(function*(){let r=`${this.url}/${e}`;try{return(yield s.default.post(r,t,Object.assign(Object.assign({},this.config),{headers:Object.assign({"Content-Type":"application/json"},this.config.headers)}))).data.data}catch(t){this.handleApiError(t,e)}}))}buildUrlWithQueryParameters(e,t){let r=new URLSearchParams;for(let[e,n]of Object.entries(t))n&&r.append(e,n);return`${e}?${r.toString()}`}handleApiError(e,t){if(!e.response)throw new f.ErrNetworkProvider(t,e.toString(),e);const r=e.response.data,n=r.message||r.error||JSON.stringify(r);throw new f.ErrNetworkProvider(t,n,e)}}},8721:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DefinitionOfTokenCollectionOnNetwork=t.DefinitionOfFungibleTokenOnNetwork=void 0;const i=n(r(1594)),s=r(1466);class o{constructor(){this.identifier="",this.name="",this.ticker="",this.owner=new s.Address(""),this.decimals=0,this.supply=new i.default(0),this.isPaused=!1,this.canUpgrade=!1,this.canMint=!1,this.canBurn=!1,this.canChangeOwner=!1,this.canPause=!1,this.canFreeze=!1,this.canWipe=!1,this.canAddSpecialRoles=!1,this.assets={}}static fromApiHttpResponse(e){let t=new o;return t.identifier=e.identifier||"",t.name=e.name||"",t.ticker=e.ticker||"",t.owner=new s.Address(e.owner||""),t.decimals=e.decimals||0,t.supply=new i.default(e.supply||"0"),t.isPaused=e.isPaused||!1,t.canUpgrade=e.canUpgrade||!1,t.canMint=e.canMint||!1,t.canBurn=e.canBurn||!1,t.canChangeOwner=e.canChangeOwner||!1,t.canPause=e.canPause||!1,t.canFreeze=e.canFreeze||!1,t.canWipe=e.canWipe||!1,t.assets=e.assets||{},t}static fromResponseOfGetTokenProperties(e,t){let r=new o,[n,a,c,l,...f]=t,d=u(f);return r.identifier=e,r.name=n.toString(),r.ticker=e,r.owner=s.Address.fromPubkey(c),r.decimals=d.NumDecimals.toNumber(),r.supply=new i.default(l.toString()).shiftedBy(-r.decimals),r.isPaused=d.IsPaused,r.canUpgrade=d.CanUpgrade,r.canMint=d.CanMint,r.canBurn=d.CanBurn,r.canChangeOwner=d.CanChangeOwner,r.canPause=d.CanPause,r.canFreeze=d.CanFreeze,r.canWipe=d.CanWipe,r}}t.DefinitionOfFungibleTokenOnNetwork=o;class a{constructor(){this.collection="",this.type="",this.name="",this.ticker="",this.owner=new s.Address(""),this.decimals=0,this.canPause=!1,this.canFreeze=!1,this.canWipe=!1,this.canUpgrade=!1,this.canChangeOwner=!1,this.canAddSpecialRoles=!1,this.canTransferNftCreateRole=!1,this.canCreateMultiShard=!1}static fromApiHttpResponse(e){let t=new a;return t.collection=e.collection||"",t.type=e.type||"",t.name=e.name||"",t.ticker=e.ticker||"",t.owner=new s.Address(e.owner||""),t.decimals=e.decimals||0,t.canPause=e.canPause||!1,t.canFreeze=e.canFreeze||!1,t.canWipe=e.canWipe||!1,t.canUpgrade=e.canUpgrade||!1,t.canAddSpecialRoles=e.canAddSpecialRoles||!1,t.canTransferNftCreateRole=e.canTransferNftCreateRole||!1,t}static fromResponseOfGetTokenProperties(e,t){var r;let n=new a,[i,o,c,l,f,...d]=t,h=u(d);return n.collection=e,n.type=o.toString(),n.name=i.toString(),n.ticker=e,n.owner=s.Address.fromPubkey(c),n.decimals=null!==(r=h.NumDecimals.toNumber())&&void 0!==r?r:0,n.canPause=h.CanPause||!1,n.canFreeze=h.CanFreeze||!1,n.canWipe=h.CanWipe||!1,n.canUpgrade=h.CanUpgrade||!1,n.canChangeOwner=h.CanChangeOwner||!1,n.canAddSpecialRoles=h.CanAddSpecialRoles||!1,n.canTransferNftCreateRole=h.CanTransferNFTCreateRole||!1,n.canCreateMultiShard=h.CanCreateMultiShard||!1,n}}function u(e){let t={};for(let r of e){let[e,n]=r.toString().split("-");t[e]=c(n)}return t}function c(e){switch(e){case"true":return!0;case"false":return!1;default:return new i.default(e)}}t.DefinitionOfTokenCollectionOnNetwork=a},3962:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonFungibleTokenOfAccountOnNetwork=t.FungibleTokenOfAccountOnNetwork=void 0;const n=r(1594),i=r(1466);class s{constructor(){this.identifier="",this.balance=new n.BigNumber(0),this.rawResponse={}}static fromHttpResponse(e){let t=new s;return t.identifier=e.tokenIdentifier||e.identifier||"",t.balance=new n.BigNumber(e.balance||0),t.rawResponse=e,t}}t.FungibleTokenOfAccountOnNetwork=s;class o{constructor(e){this.identifier="",this.collection="",this.timestamp=0,this.attributes=Buffer.from([]),this.nonce=0,this.type="",this.name="",this.creator=new i.Address(""),this.supply=new n.BigNumber(0),this.decimals=0,this.royalties=new n.BigNumber(0),this.assets=[],this.balance=new n.BigNumber(0),Object.assign(this,e)}static fromProxyHttpResponse(e){let t=o.fromHttpResponse(e);return t.identifier=e.tokenIdentifier||"",t.collection=o.parseCollectionFromIdentifier(t.identifier),t.royalties=new n.BigNumber(e.royalties||0).div(100),t}static fromProxyHttpResponseByNonce(e){let t=o.fromHttpResponse(e),r=new i.Nonce(t.nonce).hex();return t.identifier=`${e.tokenIdentifier}-${r}`,t.collection=e.tokenIdentifier||"",t.royalties=new n.BigNumber(e.royalties||0).div(100),t}static fromApiHttpResponse(e){let t=o.fromHttpResponse(e);return t.identifier=e.identifier||"",t.collection=e.collection||"",t}static fromHttpResponse(e){let t=new o;return t.timestamp=Number(e.timestamp||0),t.attributes=Buffer.from(e.attributes||"","base64"),t.nonce=e.nonce||0,t.type=e.type||"",t.name=e.name||"",t.creator=new i.Address(e.creator||""),t.decimals=Number(e.decimals||0),t.supply=new n.BigNumber(e.balance||1),t.royalties=new n.BigNumber(e.royalties||0),t.assets=e.assets||[],t.balance=new n.BigNumber(e.balance||1),t}static parseCollectionFromIdentifier(e){return e.split("-").slice(0,2).join("-")}}t.NonFungibleTokenOfAccountOnNetwork=o},8427:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionEventTopic=t.TransactionEventData=t.TransactionEvent=void 0;const n=r(1466);class i{constructor(e){this.address=new n.Address(""),this.identifier="",this.topics=[],this.data="",this.dataPayload=new s(Buffer.from("","utf8")),this.additionalData=[],Object.assign(this,e)}static fromHttpResponse(e){let t=new i;return t.address=new n.Address(e.address),t.identifier=e.identifier||"",t.topics=(e.topics||[]).map((e=>new o(e))),t.dataPayload=s.fromBase64(e.data),t.additionalData=(e.additionalData||[]).map(s.fromBase64),t.data=t.dataPayload.toString(),t}findFirstOrNoneTopic(e){return this.topics.filter((t=>e(t)))[0]}getLastTopic(){return this.topics[this.topics.length-1]}}t.TransactionEvent=i;class s{constructor(e){this.raw=e}static fromBase64(e){return new s(Buffer.from(e||"","base64"))}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}}t.TransactionEventData=s;class o{constructor(e){this.raw=Buffer.from(e||"","base64")}toString(){return this.raw.toString("utf8")}hex(){return this.raw.toString("hex")}valueOf(){return this.raw}}t.TransactionEventTopic=o},9857:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionLogs=void 0;const n=r(2591),i=r(1466),s=r(8427);class o{constructor(e){this.address=new i.Address(""),this.events=[],Object.assign(this,e)}static fromHttpResponse(e){let t=new o;return t.address=new i.Address(e.address),t.events=(e.events||[]).map((e=>s.TransactionEvent.fromHttpResponse(e))),t}findSingleOrNoneEvent(e,t){let r=this.findEvents(e,t);if(r.length>1)throw new n.ErrUnexpectedCondition(`more than one event of type ${e}`);return r[0]}findFirstOrNoneEvent(e,t){return this.findEvents(e,t)[0]}findEvents(e,t){let r=this.events.filter((t=>t.identifier==e));return t&&(r=r.filter((e=>t(e)))),r}}t.TransactionLogs=o},496:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionReceipt=void 0;const n=r(1466);class i{constructor(){this.value="",this.sender=new n.Address(""),this.data="",this.hash=""}static fromHttpResponse(e){let t=new i;return t.value=(e.value||0).toString(),t.sender=new n.Address(e.sender),t.data=e.data,t.hash=e.txHash,t}}t.TransactionReceipt=i},6188:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionStatus=void 0;class r{constructor(e){this.status=(e||"").toLowerCase()}static createUnknown(){return new r("unknown")}isPending(){return"received"==this.status||"pending"==this.status}isExecuted(){return this.isSuccessful()||this.isFailed()||this.isInvalid()}isSuccessful(){return"executed"==this.status||"success"==this.status||"successful"==this.status}isFailed(){return"fail"==this.status||"failed"==this.status||"unsuccessful"==this.status||this.isInvalid()}isInvalid(){return"invalid"==this.status}toString(){return this.status}valueOf(){return this.status}equals(e){return!!e&&this.status==e.status}}t.TransactionStatus=r},6389:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionOnNetwork=t.prepareTransactionForBroadcasting=void 0;const n=r(6188),i=r(2286),s=r(1466),o=r(9857),a=r(496);t.prepareTransactionForBroadcasting=function(e){return"toSendable"in e?e.toSendable():{nonce:Number(e.nonce),value:e.value.toString(),receiver:e.receiver,sender:e.sender,senderUsername:e.senderUsername?Buffer.from(e.senderUsername).toString("base64"):void 0,receiverUsername:e.receiverUsername?Buffer.from(e.receiverUsername).toString("base64"):void 0,gasPrice:Number(e.gasPrice),gasLimit:Number(e.gasLimit),data:0===e.data.length?void 0:Buffer.from(e.data).toString("base64"),chainID:e.chainID,version:e.version,options:e.options,guardian:e.guardian||void 0,signature:Buffer.from(e.signature).toString("hex"),guardianSignature:0===e.guardianSignature.length?void 0:Buffer.from(e.guardianSignature).toString("hex")}};class u{constructor(e){this.hash="",this.type="",this.nonce=0,this.round=0,this.epoch=0,this.value="",this.receiver=new s.Address(""),this.sender=new s.Address(""),this.gasLimit=0,this.gasPrice=0,this.function="",this.data=Buffer.from([]),this.signature="",this.status=n.TransactionStatus.createUnknown(),this.timestamp=0,this.blockNonce=0,this.hyperblockNonce=0,this.hyperblockHash="",this.receipt=new a.TransactionReceipt,this.contractResults=new i.ContractResults([]),this.logs=new o.TransactionLogs,Object.assign(this,e)}static fromProxyHttpResponse(e,t,r){let n=u.fromHttpResponse(e,t);return n.contractResults=i.ContractResults.fromProxyHttpResponse(t.smartContractResults||[]),r&&(n.status=r,n.isCompleted=n.status.isSuccessful()||n.status.isFailed()),n}static fromApiHttpResponse(e,t){let r=u.fromHttpResponse(e,t);return r.contractResults=i.ContractResults.fromApiHttpResponse(t.results||[]),r.isCompleted=!r.status.isPending(),r}static fromHttpResponse(e,t){let r=new u;return r.hash=e,r.type=t.type||"",r.nonce=t.nonce||0,r.round=t.round,r.epoch=t.epoch||0,r.value=(t.value||0).toString(),r.sender=new s.Address(t.sender),r.receiver=new s.Address(t.receiver),r.gasPrice=t.gasPrice||0,r.gasLimit=t.gasLimit||0,r.function=t.function||"",r.data=Buffer.from(t.data||"","base64"),r.status=new n.TransactionStatus(t.status),r.timestamp=t.timestamp||0,r.blockNonce=t.blockNonce||0,r.hyperblockNonce=t.hyperblockNonce||0,r.hyperblockHash=t.hyperblockHash||"",r.receipt=a.TransactionReceipt.fromHttpResponse(t.receipt||{}),r.logs=o.TransactionLogs.fromHttpResponse(t.logs||{}),r}getDateTime(){return new Date(1e3*this.timestamp)}}t.TransactionOnNetwork=u},2866:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TokenTransferProperties=t.TransactionMetadataTransfer=t.TransactionMetadata=t.TransactionToDecode=t.TransactionDecoder=void 0;const n=r(8603);t.TransactionDecoder=class{getTransactionMetadata(e){const t=this.getNormalTransactionMetadata(e),r=this.getEsdtTransactionMetadata(t);if(r)return r;const n=this.getNftTransferMetadata(t);if(n)return n;const i=this.getMultiTransferMetadata(t);return i||t}getNormalTransactionMetadata(e){const t=new s;if(t.sender=e.sender,t.receiver=e.receiver,t.value=BigInt(e.value),e.data){const r=this.base64Decode(e.data).split("@"),n=r.slice(1);if(n.every((e=>this.isSmartContractArgument(e)))&&(t.functionName=r[0],t.functionArgs=n),"relayedTx"===t.functionName&&t.functionArgs&&1===t.functionArgs.length)try{const e=JSON.parse(this.hexToString(t.functionArgs[0]));return e.value=e.value.toString(),e.sender=this.bech32Encode(this.base64ToHex(e.sender)),e.receiver=this.bech32Encode(this.base64ToHex(e.receiver)),this.getNormalTransactionMetadata(e)}catch(e){}if("relayedTxV2"===t.functionName&&t.functionArgs&&4===t.functionArgs.length)try{const r=new i;return r.sender=e.receiver,r.receiver=this.bech32Encode(t.functionArgs[0]),r.data=this.base64Encode(this.hexToString(t.functionArgs[2])),r.value="0",this.getNormalTransactionMetadata(r)}catch(e){}}return t}getMultiTransferMetadata(e){if(e.sender!==e.receiver)return;if("MultiESDTNFTTransfer"!==e.functionName)return;const t=e.functionArgs;if(!t)return;if(t.length<3)return;if(!this.isAddressValid(t[0]))return;const r=this.bech32Encode(t[0]),n=this.hexToNumber(t[1]),i=new s;i.transfers||(i.transfers=[]);let o=2;for(let e=0;e<n;e++){const e=this.hexToString(t[o++]),r=t[o++],n=this.hexToBigInt(t[o++]);r?i.transfers.push({value:n,properties:{collection:e,identifier:`${e}-${r}`}}):i.transfers.push({value:n,properties:{token:e}})}return i.sender=e.sender,i.receiver=r,t.length>o&&(i.functionName=this.hexToString(t[o++]),i.functionArgs=t.slice(o++)),i}getNftTransferMetadata(e){if(e.sender!==e.receiver)return;if("ESDTNFTTransfer"!==e.functionName)return;const t=e.functionArgs;if(!t)return;if(t.length<4)return;if(!this.isAddressValid(t[3]))return;const r=this.hexToString(t[0]),n=t[1],i=this.hexToBigInt(t[2]),o=this.bech32Encode(t[3]),a=new s;return a.sender=e.sender,a.receiver=o,a.value=i,t.length>4&&(a.functionName=this.hexToString(t[4]),a.functionArgs=t.slice(5)),a.transfers=[{value:i,properties:{collection:r,identifier:`${r}-${n}`}}],a}base64Encode(e){return Buffer.from(e).toString("base64")}base64Decode(e){return Buffer.from(e,"base64").toString("binary")}hexToNumber(e){return parseInt(e,16)}getEsdtTransactionMetadata(e){if("ESDTTransfer"!==e.functionName)return;const t=e.functionArgs;if(!t)return;if(t.length<2)return;const r=this.hexToString(t[0]),n=this.hexToBigInt(t[1]),i=new s;return i.sender=e.sender,i.receiver=e.receiver,t.length>2&&(i.functionName=this.hexToString(t[2]),i.functionArgs=t.slice(3)),i.transfers=[{value:n,properties:{identifier:r}}],i.value=n,i}bech32Encode(e){const t=Buffer.from(e,"hex"),r=n.bech32.toWords(t);return n.bech32.encode("erd",r)}isAddressValid(e){return 32==Buffer.from(e,"hex").length}isSmartContractArgument(e){return!!this.isHex(e)&&e.length%2==0}isHex(e){return!1===new RegExp(/[^a-f0-9]/gi).test(e)}base64ToHex(e){return Buffer.from(e,"base64").toString("hex")}hexToString(e){return Buffer.from(e,"hex").toString("ascii")}hexToBigInt(e){return e?BigInt("0x"+e):BigInt(0)}};class i{constructor(){this.sender="",this.receiver="",this.data="",this.value="0"}}t.TransactionToDecode=i;class s{constructor(){this.sender="",this.receiver="",this.value=BigInt(0)}}t.TransactionMetadata=s;t.TransactionMetadataTransfer=class{constructor(){this.value=BigInt(0)}};t.TokenTransferProperties=class{}},8603:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bech32m=t.bech32=void 0;const r="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={};for(let e=0;e<32;e++){const t=r.charAt(e);n[t]=e}function i(e){const t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){let t=1;for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=i(t)^n>>5}t=i(t);for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);t=i(t)^31&n}return t}function o(e,t,r,n){let i=0,s=0;const o=(1<<r)-1,a=[];for(let n=0;n<e.length;++n)for(i=i<<t|e[n],s+=t;s>=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<<r-s&o);else{if(s>=t)return"Excess padding";if(i<<r-s&o)return"Non-zero padding"}return a}function a(e){return o(e,8,5,!0)}function u(e){const t=o(e,5,8,!1);if(Array.isArray(t))return t}function c(e){const t=o(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function l(e){let t;function o(e,r){if(r=r||90,e.length<8)return e+" too short";if(e.length>r)return"Exceeds length limit";const o=e.toLowerCase(),a=e.toUpperCase();if(e!==o&&e!==a)return"Mixed-case string "+e;const u=(e=o).lastIndexOf("1");if(-1===u)return"No separator character for "+e;if(0===u)return"Missing prefix for "+e;const c=e.slice(0,u),l=e.slice(u+1);if(l.length<6)return"Data too short";let f=s(c);if("string"==typeof f)return f;const d=[];for(let e=0;e<l.length;++e){const t=l.charAt(e),r=n[t];if(void 0===r)return"Unknown character "+t;f=i(f)^r,e+6>=l.length||d.push(r)}return f!==t?"Invalid checksum for "+e:{prefix:c,words:d}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){const r=o(e,t);if("object"==typeof r)return r},decode:function(e,t){const r=o(e,t);if("object"==typeof r)return r;throw new Error(r)},encode:function(e,n,o){if(o=o||90,e.length+7+n.length>o)throw new TypeError("Exceeds length limit");let a=s(e=e.toLowerCase());if("string"==typeof a)throw new Error(a);let u=e+"1";for(let e=0;e<n.length;++e){const t=n[e];if(t>>5!=0)throw new Error("Non 5-bit word");a=i(a)^t,u+=r.charAt(t)}for(let e=0;e<6;++e)a=i(a);a^=t;for(let e=0;e<6;++e){u+=r.charAt(a>>5*(5-e)&31)}return u},toWords:a,fromWordsUnsafe:u,fromWords:c}}t.bech32=l("bech32"),t.bech32m=l("bech32m")},8045:e=>{e.exports=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,s=!0;for(;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,o){r[n]=function(e){if(s)if(s=!1,e)o(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){s&&(s=!1,o(e))}}))}},8839:(e,t)=>{var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),s=0;s<64;)i[n[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;r.encode=function(e,t,r){for(var i,s=null,o=[],a=0,u=0;t<r;){var c=e[t++];switch(u){case 0:o[a++]=n[c>>2],i=(3&c)<<4,u=1;break;case 1:o[a++]=n[i|c>>4],i=(15&c)<<2,u=2;break;case 2:o[a++]=n[i|c>>6],o[a++]=n[63&c],u=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return u&&(o[a++]=n[i],o[a++]=61,1===u&&(o[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};var o="invalid encoding";r.decode=function(e,t,r){for(var n,s=r,a=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&a>1)break;if(void 0===(c=i[c]))throw Error(o);switch(a){case 0:n=c,a=1;break;case 1:t[r++]=n<<2|(48&c)>>4,n=c,a=2;break;case 2:t[r++]=(15&n)<<4|(60&c)>>2,n=c,a=3;break;case 3:t[r++]=(3&n)<<6|c,a=0}}if(1===a)throw Error(o);return r-s},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},4358:e=>{function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},9410:e=>{function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function s(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function o(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function a(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:s,e.writeFloatBE=n?s:i,e.readFloatLE=n?o:a,e.readFloatBE=n?a:o}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var s=Math.floor(Math.log(t)/Math.LN2);e((i<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,r,n)}}function o(e,t,r){var n=e(t,r),i=2*(n>>31)+1,s=n>>>23&255,o=8388607&n;return 255===s?o?NaN:i*(1/0):0===s?1401298464324817e-60*i*o:i*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=o.bind(null,i),e.readFloatBE=o.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function s(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function o(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function a(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:s,e.writeDoubleBE=n?s:i,e.readDoubleLE=n?o:a,e.readDoubleBE=n?a:o}():function(){function t(e,t,r,n,i,s){var o=n<0?1:0;if(o&&(n=-n),0===n)e(0,i,s+t),e(1/n>0?0:2147483648,i,s+r);else if(isNaN(n))e(0,i,s+t),e(2146959360,i,s+r);else if(n>17976931348623157e292)e(0,i,s+t),e((o<<31|2146435072)>>>0,i,s+r);else{var a;if(n<22250738585072014e-324)e((a=n/5e-324)>>>0,i,s+t),e((o<<31|a/4294967296)>>>0,i,s+r);else{var u=Math.floor(Math.log(n)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=n*Math.pow(2,-u))>>>0,i,s+t),e((o<<31|u+1023<<20|1048576*a&1048575)>>>0,i,s+r)}}}function o(e,t,r,n,i){var s=e(n,i+t),o=e(n,i+r),a=2*(o>>31)+1,u=o>>>20&2047,c=4294967296*(1048575&o)+s;return 2047===u?c?NaN:a*(1/0):0===u?5e-324*a*c:a*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=o.bind(null,i,0,4),e.readDoubleBE=o.bind(null,s,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},4153:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},9390:e=>{e.exports=function(e,t,r){var n=r||8192,i=n>>>1,s=null,o=n;return function(r){if(r<1||r>i)return e(r);o+r>n&&(s=e(n),o=0);var a=t.call(s,o,o+=r);return 7&o&&(o=1+(7|o)),a}}},1447:(e,t)=>{var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,s=[],o=0;t<r;)(n=e[t++])<128?s[o++]=n:n>191&&n<224?s[o++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[o++]=55296+(n>>10),s[o++]=56320+(1023&n)):s[o++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0);return i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))},r.write=function(e,t,r){for(var n,i,s=r,o=0;o<e.length;++o)(n=e.charCodeAt(o))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(o+1)))?(n=65536+((1023&n)<<10)+(1023&i),++o,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-s}},7526:(e,t)=>{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,s=a(e),o=s[0],u=s[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,u)),l=0,f=u>0?o-4:o;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)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=16383,a=0,c=n-i;a<c;a+=o)s.push(u(e,a,a+o>c?c:a+o));1===i?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;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 u(e,t,n){for(var i,s,o=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(r[(s=i)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9674:e=>{for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<32;n++){var i=t.charAt(n);if(void 0!==r[i])throw new TypeError(i+" is ambiguous");r[i]=n}function s(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function o(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=s(t)^n>>5}for(t=s(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=s(t)^31&i}return t}function a(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var a=(e=n).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var u=e.slice(0,a),c=e.slice(a+1);if(c.length<6)return"Data too short";var l=o(u);if("string"==typeof l)return l;for(var f=[],d=0;d<c.length;++d){var h=c.charAt(d),g=r[h];if(void 0===g)return"Unknown character "+h;l=s(l)^g,d+6>=c.length||f.push(g)}return 1!==l?"Invalid checksum for "+e:{prefix:u,words:f}}function u(e,t,r,n){for(var i=0,s=0,o=(1<<r)-1,a=[],u=0;u<e.length;++u)for(i=i<<t|e[u],s+=t;s>=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<<r-s&o);else{if(s>=t)return"Excess padding";if(i<<r-s&o)return"Non-zero padding"}return a}e.exports={decodeUnsafe:function(){var e=a.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=a.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,r,n){if(n=n||90,e.length+7+r.length>n)throw new TypeError("Exceeds length limit");var i=o(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var a=e+"1",u=0;u<r.length;++u){var c=r[u];if(c>>5!=0)throw new Error("Non 5-bit word");i=s(i)^c,a+=t.charAt(c)}for(u=0;u<6;++u)i=s(i);for(i^=1,u=0;u<6;++u){a+=t.charAt(i>>5*(5-u)&31)}return a},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},1594:function(e,t,r){var n;!function(i){var s,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,u=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",f=1e14,d=14,h=9007199254740991,g=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,m=1e9;function y(e){var t=0|e;return e>0||e===t?t:t-1}function A(e){for(var t,r,n=1,i=e.length,s=e[0]+"";n<i;){for(t=e[n++]+"",r=d-t.length;r--;t="0"+t);s+=t}for(i=s.length;48===s.charCodeAt(--i););return s.slice(0,i+1||1)}function v(e,t){var r,n,i=e.c,s=t.c,o=e.s,a=t.s,u=e.e,c=t.e;if(!o||!a)return null;if(r=i&&!i[0],n=s&&!s[0],r||n)return r?n?0:-a:o;if(o!=a)return o;if(r=o<0,n=u==c,!i||!s)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(a=(u=i.length)<(c=s.length)?u:c,o=0;o<a;o++)if(i[o]!=s[o])return i[o]>s[o]^r?1:-1;return u==c?0:u>c^r?1:-1}function w(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function b(e){var t=e.c.length-1;return y(e.e/d)==t&&e.c[t]%2!=0}function I(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function T(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}s=function e(t){var r,n,i,s,C,S,E,B,N,O,_=Q.prototype={constructor:Q,toString:null,valueOf:null},P=new Q(1),D=20,R=4,x=-7,L=21,F=-1e7,U=1e7,M=!1,k=1,V=0,G={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},j="0123456789abcdefghijklmnopqrstuvwxyz";function Q(e,t){var r,s,a,c,f,g,p,m,y=this;if(!(y instanceof Q))return new Q(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>U?y.c=y.e=null:e.e<F?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((g="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,f=e;f>=10;f/=10,c++);return void(c>U?y.c=y.e=null:(y.e=c,y.c=[e]))}m=String(e)}else{if(!o.test(m=String(e)))return i(y,m,g);y.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(c=m.indexOf("."))>-1&&(m=m.replace(".","")),(f=m.search(/e/i))>0?(c<0&&(c=f),c+=+m.slice(f+1),m=m.substring(0,f)):c<0&&(c=m.length)}else{if(w(t,2,j.length,"Base"),10==t)return z(y=new Q(e),D+y.e+1,R);if(m=String(e),g="number"==typeof e){if(0*e!=0)return i(y,m,g,t);if(y.s=1/e<0?(m=m.slice(1),-1):1,Q.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else y.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(r=j.slice(0,t),c=f=0,p=m.length;f<p;f++)if(r.indexOf(s=m.charAt(f))<0){if("."==s){if(f>c){c=p;continue}}else if(!a&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){a=!0,f=-1,c=0;continue}return i(y,String(e),g,t)}g=!1,(c=(m=n(m,t,10,y.s)).indexOf("."))>-1?m=m.replace(".",""):c=m.length}for(f=0;48===m.charCodeAt(f);f++);for(p=m.length;48===m.charCodeAt(--p););if(m=m.slice(f,++p)){if(p-=f,g&&Q.DEBUG&&p>15&&(e>h||e!==u(e)))throw Error(l+y.s*e);if((c=c-f-1)>U)y.c=y.e=null;else if(c<F)y.c=[y.e=0];else{if(y.e=c,y.c=[],f=(c+1)%d,c<0&&(f+=d),f<p){for(f&&y.c.push(+m.slice(0,f)),p-=d;f<p;)y.c.push(+m.slice(f,f+=d));f=d-(m=m.slice(f)).length}else f-=p;for(;f--;m+="0");y.c.push(+m)}}else y.c=[y.e=0]}function H(e,t,r,n){var i,s,o,a,u;if(null==r?r=R:w(r,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)u=A(e.c),u=1==n||2==n&&(o<=x||o>=L)?I(u,o):T(u,o,"0");else if(s=(e=z(new Q(e),t,r)).e,a=(u=A(e.c)).length,1==n||2==n&&(t<=s||s<=x)){for(;a<t;u+="0",a++);u=I(u,s)}else if(t-=o,u=T(u,s,"0"),s+1>a){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=s-a)>0)for(s+1==a&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function q(e,t){for(var r,n=1,i=new Q(e[0]);n<e.length;n++){if(!(r=new Q(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}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*d-1)>U?e.c=e.e=null:r<F?e.c=[e.e=0]:(e.e=r,e.c=t),e}function z(e,t,r,n){var i,s,o,c,l,h,p,m=e.c,y=g;if(m){e:{for(i=1,c=m[0];c>=10;c/=10,i++);if((s=t-i)<0)s+=d,o=t,p=(l=m[h=0])/y[i-o-1]%10|0;else if((h=a((s+1)/d))>=m.length){if(!n)break e;for(;m.length<=h;m.push(0));l=p=0,i=1,o=(s%=d)-d+1}else{for(l=c=m[h],i=1;c>=10;c/=10,i++);p=(o=(s%=d)-d+i)<0?0:l/y[i-o-1]%10|0}if(n=n||t<0||null!=m[h+1]||(o<0?l:l%y[i-o-1]),n=r<4?(p||n)&&(0==r||r==(e.s<0?3:2)):p>5||5==p&&(4==r||n||6==r&&(s>0?o>0?l/y[i-o]:0:m[h-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=y[(d-t%d)%d],e.e=-t||0):m[0]=e.e=0,e;if(0==s?(m.length=h,c=1,h--):(m.length=h+1,c=y[d-s],m[h]=o>0?u(l/y[i-o]%y[o])*c:0),n)for(;;){if(0==h){for(s=1,o=m[0];o>=10;o/=10,s++);for(o=m[0]+=c,c=1;o>=10;o/=10,c++);s!=c&&(e.e++,m[0]==f&&(m[0]=1));break}if(m[h]+=c,m[h]!=f)break;m[h--]=0,c=1}for(s=m.length;0===m[--s];m.pop());}e.e>U?e.c=e.e=null:e.e<F&&(e.c=[e.e=0])}return e}function W(e){var t,r=e.e;return null===r?e.toString():(t=A(e.c),t=r<=x||r>=L?I(t,r):T(t,r,"0"),e.s<0?"-"+t:t)}return Q.clone=e,Q.ROUND_UP=0,Q.ROUND_DOWN=1,Q.ROUND_CEIL=2,Q.ROUND_FLOOR=3,Q.ROUND_HALF_UP=4,Q.ROUND_HALF_DOWN=5,Q.ROUND_HALF_EVEN=6,Q.ROUND_HALF_CEIL=7,Q.ROUND_HALF_FLOOR=8,Q.EUCLID=9,Q.config=Q.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(w(r=e[t],0,m,t),D=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],-m,0,t),w(r[1],0,m,t),x=r[0],L=r[1]):(w(r,-m,m,t),x=-(L=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)w(r[0],-m,-1,t),w(r[1],1,m,t),F=r[0],U=r[1];else{if(w(r,-m,m,t),!r)throw Error(c+t+" cannot be zero: "+r);F=-(U=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw M=!r,Error(c+"crypto unavailable");M=r}else M=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(w(r=e[t],0,9,t),k=r),e.hasOwnProperty(t="POW_PRECISION")&&(w(r=e[t],0,m,t),V=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);G=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);j=r}}return{DECIMAL_PLACES:D,ROUNDING_MODE:R,EXPONENTIAL_AT:[x,L],RANGE:[F,U],CRYPTO:M,MODULO_MODE:k,POW_PRECISION:V,FORMAT:G,ALPHABET:j}},Q.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!Q.DEBUG)return!0;var t,r,n=e.c,i=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===s||-1===s)&&i>=-m&&i<=m&&i===u(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!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===s||1===s||-1===s))return!0;throw Error(c+"Invalid BigNumber: "+e)},Q.maximum=Q.max=function(){return q(arguments,_.lt)},Q.minimum=Q.min=function(){return q(arguments,_.gt)},Q.random=(s=9007199254740992,C=Math.random()*s&2097151?function(){return u(Math.random()*s)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,s,o=0,l=[],f=new Q(P);if(null==e?e=D:w(e,0,m),i=a(e/d),M)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));o<i;)(s=131072*t[o]+(t[o+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(l.push(s%1e14),o+=2);o=i/2}else{if(!crypto.randomBytes)throw M=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);o<i;)(s=281474976710656*(31&t[o])+1099511627776*t[o+1]+4294967296*t[o+2]+16777216*t[o+3]+(t[o+4]<<16)+(t[o+5]<<8)+t[o+6])>=9e15?crypto.randomBytes(7).copy(t,o):(l.push(s%1e14),o+=7);o=i/7}if(!M)for(;o<i;)(s=C())<9e15&&(l[o++]=s%1e14);for(i=l[--o],e%=d,i&&e&&(s=g[d-e],l[o]=u(i/s)*s);0===l[o];l.pop(),o--);if(o<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=d);for(o=1,s=l[0];s>=10;s/=10,o++);o<d&&(n-=d-o)}return f.e=n,f.c=l,f}),Q.sum=function(){for(var e=1,t=arguments,r=new Q(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,s,o=[0],a=0,u=e.length;a<u;){for(s=o.length;s--;o[s]*=t);for(o[0]+=n.indexOf(e.charAt(a++)),i=0;i<o.length;i++)o[i]>r-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(n,i,s,o,a){var u,c,l,f,d,h,g,p,m=n.indexOf("."),y=D,v=R;for(m>=0&&(f=V,V=0,n=n.replace(".",""),h=(p=new Q(i)).pow(n.length-m),V=f,p.c=t(T(A(h.c),h.e,"0"),10,s,e),p.e=p.c.length),l=f=(g=t(n,i,s,a?(u=j,e):(u=e,j))).length;0==g[--f];g.pop());if(!g[0])return u.charAt(0);if(m<0?--l:(h.c=g,h.e=l,h.s=o,g=(h=r(h,p,y,v,s)).c,d=h.r,l=h.e),m=g[c=l+y+1],f=s/2,d=d||c<0||null!=g[c+1],d=v<4?(null!=m||d)&&(0==v||v==(h.s<0?3:2)):m>f||m==f&&(4==v||d||6==v&&1&g[c-1]||v==(h.s<0?8:7)),c<1||!g[0])n=d?T(u.charAt(1),-y,u.charAt(0)):u.charAt(0);else{if(g.length=c,d)for(--s;++g[--c]>s;)g[c]=0,c||(++l,g=[1].concat(g));for(f=g.length;!g[--f];);for(m=0,n="";m<=f;n+=u.charAt(g[m++]));n=T(n,l,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,s,o,a=0,u=e.length,c=t%p,l=t/p|0;for(e=e.slice();u--;)a=((i=c*(s=e[u]%p)+(n=l*s+(o=e[u]/p|0)*c)%p*p+a)/r|0)+(n/p|0)+l*o,e[u]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,s;if(r!=n)s=r>n?1:-1;else for(i=s=0;i<r;i++)if(e[i]!=t[i]){s=e[i]>t[i]?1:-1;break}return s}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,s,o,a){var c,l,h,g,p,m,A,v,w,b,I,T,C,S,E,B,N,O=n.s==i.s?1:-1,_=n.c,P=i.c;if(!(_&&_[0]&&P&&P[0]))return new Q(n.s&&i.s&&(_?!P||_[0]!=P[0]:P)?_&&0==_[0]||!P?0*O:O/0:NaN);for(w=(v=new Q(O)).c=[],O=s+(l=n.e-i.e)+1,a||(a=f,l=y(n.e/d)-y(i.e/d),O=O/d|0),h=0;P[h]==(_[h]||0);h++);if(P[h]>(_[h]||0)&&l--,O<0)w.push(1),g=!0;else{for(S=_.length,B=P.length,h=0,O+=2,(p=u(a/(P[0]+1)))>1&&(P=e(P,p,a),_=e(_,p,a),B=P.length,S=_.length),C=B,I=(b=_.slice(0,B)).length;I<B;b[I++]=0);N=P.slice(),N=[0].concat(N),E=P[0],P[1]>=a/2&&E++;do{if(p=0,(c=t(P,b,B,I))<0){if(T=b[0],B!=I&&(T=T*a+(b[1]||0)),(p=u(T/E))>1)for(p>=a&&(p=a-1),A=(m=e(P,p,a)).length,I=b.length;1==t(m,b,A,I);)p--,r(m,B<A?N:P,A,a),A=m.length,c=1;else 0==p&&(c=p=1),A=(m=P.slice()).length;if(A<I&&(m=[0].concat(m)),r(b,m,I,a),I=b.length,-1==c)for(;t(P,b,B,I)<1;)p++,r(b,B<I?N:P,I,a),I=b.length}else 0===c&&(p++,b=[0]);w[h++]=p,b[0]?b[I++]=_[C]||0:(b=[_[C]],I=1)}while((C++<S||null!=b[0])&&O--);g=null!=b[0],w[0]||w.splice(0,1)}if(a==f){for(h=1,O=w[0];O>=10;O/=10,h++);z(v,s+(v.e=h+l*d-1)+1,o,g)}else v.e=l,v.r=+g;return v}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,B=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,s=r?t:t.replace(O,"");if(N.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(S,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,s=s.replace(E,"$1").replace(B,"0.$1")),t!=s))return new Q(s,i);if(Q.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},_.absoluteValue=_.abs=function(){var e=new Q(this);return e.s<0&&(e.s=1),e},_.comparedTo=function(e,t){return v(this,new Q(e,t))},_.decimalPlaces=_.dp=function(e,t){var r,n,i,s=this;if(null!=e)return w(e,0,m),null==t?t=R:w(t,0,8),z(new Q(s),e+s.e+1,t);if(!(r=s.c))return null;if(n=((i=r.length-1)-y(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},_.dividedBy=_.div=function(e,t){return r(this,new Q(e,t),D,R)},_.dividedToIntegerBy=_.idiv=function(e,t){return r(this,new Q(e,t),0,1)},_.exponentiatedBy=_.pow=function(e,t){var r,n,i,s,o,l,f,h,g=this;if((e=new Q(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+W(e));if(null!=t&&(t=new Q(t)),o=e.e>14,!g.c||!g.c[0]||1==g.c[0]&&!g.e&&1==g.c.length||!e.c||!e.c[0])return h=new Q(Math.pow(+W(g),o?2-b(e):+W(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new Q(NaN);(n=!l&&g.isInteger()&&t.isInteger())&&(g=g.mod(t))}else{if(e.e>9&&(g.e>0||g.e<-1||(0==g.e?g.c[0]>1||o&&g.c[1]>=24e7:g.c[0]<8e13||o&&g.c[0]<=9999975e7)))return s=g.s<0&&b(e)?-0:0,g.e>-1&&(s=1/s),new Q(l?1/s:s);V&&(s=a(V/d+2))}for(o?(r=new Q(.5),l&&(e.s=1),f=b(e)):f=(i=Math.abs(+W(e)))%2,h=new Q(P);;){if(f){if(!(h=h.times(g)).c)break;s?h.c.length>s&&(h.c.length=s):n&&(h=h.mod(t))}if(i){if(0===(i=u(i/2)))break;f=i%2}else if(z(e=e.times(r),e.e+1,1),e.e>14)f=b(e);else{if(0===(i=+W(e)))break;f=i%2}g=g.times(g),s?g.c&&g.c.length>s&&(g.c.length=s):n&&(g=g.mod(t))}return n?h:(l&&(h=P.div(h)),t?h.mod(t):s?z(h,V,R,undefined):h)},_.integerValue=function(e){var t=new Q(this);return null==e?e=R:w(e,0,8),z(t,t.e+1,e)},_.isEqualTo=_.eq=function(e,t){return 0===v(this,new Q(e,t))},_.isFinite=function(){return!!this.c},_.isGreaterThan=_.gt=function(e,t){return v(this,new Q(e,t))>0},_.isGreaterThanOrEqualTo=_.gte=function(e,t){return 1===(t=v(this,new Q(e,t)))||0===t},_.isInteger=function(){return!!this.c&&y(this.e/d)>this.c.length-2},_.isLessThan=_.lt=function(e,t){return v(this,new Q(e,t))<0},_.isLessThanOrEqualTo=_.lte=function(e,t){return-1===(t=v(this,new Q(e,t)))||0===t},_.isNaN=function(){return!this.s},_.isNegative=function(){return this.s<0},_.isPositive=function(){return this.s>0},_.isZero=function(){return!!this.c&&0==this.c[0]},_.minus=function(e,t){var r,n,i,s,o=this,a=o.s;if(t=(e=new Q(e,t)).s,!a||!t)return new Q(NaN);if(a!=t)return e.s=-t,o.plus(e);var u=o.e/d,c=e.e/d,l=o.c,h=e.c;if(!u||!c){if(!l||!h)return l?(e.s=-t,e):new Q(h?o:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new Q(l[0]?o:3==R?-0:0)}if(u=y(u),c=y(c),l=l.slice(),a=u-c){for((s=a<0)?(a=-a,i=l):(c=u,i=h),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(s=(a=l.length)<(t=h.length))?a:t,a=t=0;t<n;t++)if(l[t]!=h[t]){s=l[t]<h[t];break}if(s&&(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),--c);return l[0]?K(e,l,c):(e.s=3==R?-1:1,e.c=[e.e=0],e)},_.modulo=_.mod=function(e,t){var n,i,s=this;return e=new Q(e,t),!s.c||!e.s||e.c&&!e.c[0]?new Q(NaN):!e.c||s.c&&!s.c[0]?new Q(s):(9==k?(i=e.s,e.s=1,n=r(s,e,0,3),e.s=i,n.s*=i):n=r(s,e,0,k),(e=s.minus(n.times(e))).c[0]||1!=k||(e.s=s.s),e)},_.multipliedBy=_.times=function(e,t){var r,n,i,s,o,a,u,c,l,h,g,m,A,v,w,b=this,I=b.c,T=(e=new Q(e,t)).c;if(!(I&&T&&I[0]&&T[0]))return!b.s||!e.s||I&&!I[0]&&!T||T&&!T[0]&&!I?e.c=e.e=e.s=null:(e.s*=b.s,I&&T?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=y(b.e/d)+y(e.e/d),e.s*=b.s,(u=I.length)<(h=T.length)&&(A=I,I=T,T=A,i=u,u=h,h=i),i=u+h,A=[];i--;A.push(0));for(v=f,w=p,i=h;--i>=0;){for(r=0,g=T[i]%w,m=T[i]/w|0,s=i+(o=u);s>i;)r=((c=g*(c=I[--o]%w)+(a=m*c+(l=I[o]/w|0)*g)%w*w+A[s]+r)/v|0)+(a/w|0)+m*l,A[s--]=c%v;A[s]=r}return r?++n:A.splice(0,1),K(e,A,n)},_.negated=function(){var e=new Q(this);return e.s=-e.s||null,e},_.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new Q(e,t)).s,!i||!t)return new Q(NaN);if(i!=t)return e.s=-t,n.minus(e);var s=n.e/d,o=e.e/d,a=n.c,u=e.c;if(!s||!o){if(!a||!u)return new Q(i/0);if(!a[0]||!u[0])return u[0]?e:new Q(a[0]?n:0*i)}if(s=y(s),o=y(o),a=a.slice(),i=s-o){for(i>0?(o=s,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+u[t]+i)/f|0,a[t]=f===a[t]?0:a[t]%f;return i&&(a=[i].concat(a),++o),K(e,a,o)},_.precision=_.sd=function(e,t){var r,n,i,s=this;if(null!=e&&e!==!!e)return w(e,1,m),null==t?t=R:w(t,0,8),z(new Q(s),e,t);if(!(r=s.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&&s.e+1>n&&(n=s.e+1),n},_.shiftedBy=function(e){return w(e,-9007199254740991,h),this.times("1e"+e)},_.squareRoot=_.sqrt=function(){var e,t,n,i,s,o=this,a=o.c,u=o.s,c=o.e,l=D+4,f=new Q("0.5");if(1!==u||!a||!a[0])return new Q(!u||u<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(u=Math.sqrt(+W(o)))||u==1/0?(((t=A(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=y((c+1)/2)-(c<0||c%2),n=new Q(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new Q(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(s=n,n=f.times(s.plus(r(o,s,l,1))),A(s.c).slice(0,u)===(t=A(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(z(n,n.e+D+2,1),e=!n.times(n).eq(o));break}if(!i&&(z(s,s.e+D+2,0),s.times(s).eq(o))){n=s;break}l+=4,u+=4,i=1}return z(n,n.e+D+1,R,e)},_.toExponential=function(e,t){return null!=e&&(w(e,0,m),e++),H(this,e,t,1)},_.toFixed=function(e,t){return null!=e&&(w(e,0,m),e=e+this.e+1),H(this,e,t)},_.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=G;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var s,o=n.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",f=o[0],d=o[1],h=i.s<0,g=h?f.slice(1):f,p=g.length;if(u&&(s=a,a=u,u=s,p-=s),a>0&&p>0){for(s=p%a||a,f=g.substr(0,s);s<p;s+=a)f+=l+g.substr(s,a);u>0&&(f+=l+g.slice(s)),h&&(f="-"+f)}n=d?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):f}return(r.prefix||"")+n+(r.suffix||"")},_.toFraction=function(e){var t,n,i,s,o,a,u,l,f,h,p,m,y=this,v=y.c;if(null!=e&&(!(u=new Q(e)).isInteger()&&(u.c||1!==u.s)||u.lt(P)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+W(u));if(!v)return new Q(y);for(t=new Q(P),f=n=new Q(P),i=l=new Q(P),m=A(v),o=t.e=m.length-y.e-1,t.c[0]=g[(a=o%d)<0?d+a:a],e=!e||u.comparedTo(t)>0?o>0?t:f:u,a=U,U=1/0,u=new Q(m),l.c[0]=0;h=r(u,t,0,1),1!=(s=n.plus(h.times(i))).comparedTo(e);)n=i,i=s,f=l.plus(h.times(s=f)),l=s,t=u.minus(h.times(s=t)),u=s;return s=r(e.minus(n),i,0,1),l=l.plus(s.times(f)),n=n.plus(s.times(i)),l.s=f.s=y.s,p=r(f,i,o*=2,R).minus(y).abs().comparedTo(r(l,n,o,R).minus(y).abs())<1?[f,i]:[l,n],U=a,p},_.toNumber=function(){return+W(this)},_.toPrecision=function(e,t){return null!=e&&w(e,1,m),H(this,e,t,2)},_.toString=function(e){var t,r=this,i=r.s,s=r.e;return null===s?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=s<=x||s>=L?I(A(r.c),s):T(A(r.c),s,"0"):10===e?t=T(A((r=z(new Q(r),D+s+1,R)).c),r.e,"0"):(w(e,2,j.length,"Base"),t=n(T(A(r.c),s,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},_.valueOf=_.toJSON=function(){return W(this)},_._isBigNumber=!0,null!=t&&Q.set(t),Q}(),s.default=s.BigNumber=s,void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},1892:(e,t,r)=>{function n(e){if(!n.supported)return null;var t,s=e&&e.imports,o=(t="AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMK00AElgMAIABCADcDACAAQQhqQgA3AwAgAEEQakIANwMAIABBGGpCADcDACAAQSBqQgA3AwAgAEEoakIANwMAIABBMGpCADcDACAAQThqQgA3AwAgAEHAAGpCADcDACAAQcgAakIANwMAIABB0ABqQgA3AwAgAEHYAGpCADcDACAAQeAAakIANwMAIABB6ABqQgA3AwAgAEHwAGpCADcDACAAQfgAakIANwMAIABBgAFqQoiS853/zPmE6gBBACkDAIU3AwAgAEGIAWpCu86qptjQ67O7f0EIKQMAhTcDACAAQZABakKr8NP0r+68tzxBECkDAIU3AwAgAEGYAWpC8e30+KWn/aelf0EYKQMAhTcDACAAQaABakLRhZrv+s+Uh9EAQSApAwCFNwMAIABBqAFqQp/Y+dnCkdqCm39BKCkDAIU3AwAgAEGwAWpC6/qG2r+19sEfQTApAwCFNwMAIABBuAFqQvnC+JuRo7Pw2wBBOCkDAIU3AwAgAEHAAWpCADcDACAAQcgBakIANwMAIABB0AFqQgA3AwALbQEDfyAAQcABaiEDIABByAFqIQQgBCkDAKchBQJAA0AgASACRg0BIAVBgAFGBEAgAyADKQMAIAWtfDcDAEEAIQUgABADCyAAIAVqIAEtAAA6AAAgBUEBaiEFIAFBAWohAQwACwsgBCAFrTcDAAtkAQN/IABBwAFqIQEgAEHIAWohAiABIAEpAwAgAikDAHw3AwAgAEHQAWpCfzcDACACKQMApyEDAkADQCADQYABRg0BIAAgA2pBADoAACADQQFqIQMMAAsLIAIgA603AwAgABADC+U7AiB+CX8gAEGAAWohISAAQYgBaiEiIABBkAFqISMgAEGYAWohJCAAQaABaiElIABBqAFqISYgAEGwAWohJyAAQbgBaiEoICEpAwAhASAiKQMAIQIgIykDACEDICQpAwAhBCAlKQMAIQUgJikDACEGICcpAwAhByAoKQMAIQhCiJLznf/M+YTqACEJQrvOqqbY0Ouzu38hCkKr8NP0r+68tzwhC0Lx7fT4paf9p6V/IQxC0YWa7/rPlIfRACENQp/Y+dnCkdqCm38hDkLr+obav7X2wR8hD0L5wvibkaOz8NsAIRAgACkDACERIABBCGopAwAhEiAAQRBqKQMAIRMgAEEYaikDACEUIABBIGopAwAhFSAAQShqKQMAIRYgAEEwaikDACEXIABBOGopAwAhGCAAQcAAaikDACEZIABByABqKQMAIRogAEHQAGopAwAhGyAAQdgAaikDACEcIABB4ABqKQMAIR0gAEHoAGopAwAhHiAAQfAAaikDACEfIABB+ABqKQMAISAgDSAAQcABaikDAIUhDSAPIABB0AFqKQMAhSEPIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBx8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAZfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgHXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBF8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAWfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgE3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIICB8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAefHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgG3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB98fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAUfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgF3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBh8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCASfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBV8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAYfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgGnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBR8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiASfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIB18fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAcfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggH3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBN8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAXfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgFnx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBt8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAVfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggEXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFICB8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAZfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgGnx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBF8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAWfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGHx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBN8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAVfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggG3x8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIICB8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAffHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgEnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBx8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAdfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggF3x8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBl8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAUfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgHnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBN8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAdfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgF3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBt8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByARfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBl8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAUfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgFXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB58fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAYfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFnx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIICB8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAffHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgEnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBp8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAdfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgFnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBJ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAgfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgH3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIB58fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAVfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggG3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBF8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAYfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgF3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBR8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAafHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggE3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBl8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAcfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHnx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBx8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAYfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgH3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIB18fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByASfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggFHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBp8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAWfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgEXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHICB8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAVfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGXx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBd8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSATfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgG3x8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBd8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAgfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgH3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBp8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAcfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBF8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAZfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgHXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBN8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAefHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgGHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBJ8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAVfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgG3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBZ8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAbfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgE3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBl8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAVfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGHx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBd8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCASfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggFnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGICB8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAcfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgGnx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB98fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAUfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB58fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSARfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgEXx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBJ8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiATfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgFHx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBV8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAWfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggF3x8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBh8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAZfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgGnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBt8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAcfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHXx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB58fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAffHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgIHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB98fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAbfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBl8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAafHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgIHx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIB58fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAXfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEnx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIB18fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByARfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgE3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBx8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAYfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgFnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBR8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFICEgISkDACABIAmFhTcDACAiICIpAwAgAiAKhYU3AwAgIyAjKQMAIAMgC4WFNwMAICQgJCkDACAEIAyFhTcDACAlICUpAwAgBSANhYU3AwAgJiAmKQMAIAYgDoWFNwMAICcgJykDACAHIA+FhTcDACAoICgpAwAgCCAQhYU3AwAL","function"==typeof atob?new Uint8Array(atob(t).split("").map(i)):new(r(8287).Buffer)(t,"base64")),a=null,u={buffer:o,memory:null,exports:null,realloc:function(e){u.exports.memory.grow(Math.ceil(Math.abs(e-u.memory.length)/65536)),u.memory=new Uint8Array(u.exports.memory.buffer)},onload:c};return c((function(){})),u;function c(t){if(u.exports)return t();if(a)a.then(t.bind(null,null)).catch(t);else{try{if(e&&e.async)throw new Error("async");l({instance:new WebAssembly.Instance(new WebAssembly.Module(o),s)})}catch(e){a=WebAssembly.instantiate(o,s).then(l)}c(t)}}function l(e){u.exports=e.instance.exports,u.memory=u.exports.memory&&u.exports.memory.buffer&&new Uint8Array(u.exports.memory.buffer)}}function i(e){return e.charCodeAt(0)}e.exports=n,n.supported="undefined"!=typeof WebAssembly},1685:(e,t,r)=>{var n=r(6889),i=r(1892)(),s=64,o=[];e.exports=h;var a=e.exports.BYTES_MIN=16,u=e.exports.BYTES_MAX=64,c=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),l=e.exports.KEYBYTES_MAX=64,f=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),d=e.exports.PERSONALBYTES=16;function h(e,t,r,g,p){if(!(this instanceof h))return new h(e,t,r,g,p);if(!i||!i.exports)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");e||(e=32),!0!==p&&(n(e>=a,"digestLength must be at least "+a+", was given "+e),n(e<=u,"digestLength must be at most "+u+", was given "+e),null!=t&&n(t.length>=c,"key must be at least "+c+", was given "+t.length),null!=t&&n(t.length<=l,"key must be at least "+l+", was given "+t.length),null!=r&&n(r.length===f,"salt must be exactly "+f+", was given "+r.length),null!=g&&n(g.length===d,"personal must be exactly "+d+", was given "+g.length)),o.length||(o.push(s),s+=216),this.digestLength=e,this.finalized=!1,this.pointer=o.pop(),i.memory.fill(0,0,64),i.memory[0]=this.digestLength,i.memory[1]=t?t.length:0,i.memory[2]=1,i.memory[3]=1,r&&i.memory.set(r,32),g&&i.memory.set(g,48),this.pointer+216>i.memory.length&&i.realloc(this.pointer+216),i.exports.blake2b_init(this.pointer,this.digestLength),t&&(this.update(t),i.memory.fill(0,s,s+t.length),i.memory[this.pointer+200]=128)}function g(){}function p(e){return e<16?"0"+e.toString(16):e.toString(16)}h.prototype.update=function(e){return n(!1===this.finalized,"Hash instance finalized"),n(e,"input must be TypedArray or Buffer"),s+e.length>i.memory.length&&i.realloc(s+e.length),i.memory.set(e,s),i.exports.blake2b_update(this.pointer,s,s+e.length),this},h.prototype.digest=function(e){if(n(!1===this.finalized,"Hash instance finalized"),this.finalized=!0,o.push(this.pointer),i.exports.blake2b_final(this.pointer),!e||"binary"===e)return i.memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if("hex"===e)return function(e,t,r){for(var n="",i=0;i<r;i++)n+=p(e[t+i]);return n}(i.memory,this.pointer+128,this.digestLength);n(e.length>=this.digestLength,"input must be TypedArray or Buffer");for(var t=0;t<this.digestLength;t++)e[t]=i.memory[this.pointer+128+t];return e},h.prototype.final=h.prototype.digest,h.WASM=i&&i.buffer,h.SUPPORTED="undefined"!=typeof WebAssembly,h.ready=function(e){return e||(e=g),i?new Promise((function(t,r){i.onload((function(n){n?r():t(),e(n)}))})):e(new Error("WebAssembly not supported"))},h.prototype.ready=h.ready},2206:(e,t,r)=>{var n=r(6889),i=r(1685);function s(e,t,r){var n=e[t]+e[r],i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function o(e,t,r,n){var i=e[t]+r;r<0&&(i+=4294967296);var s=e[t+1]+n;i>=4294967296&&s++,e[t]=i,e[t+1]=s}function a(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function u(e,t,r,n,i,a){var u=d[i],c=d[i+1],l=d[a],h=d[a+1];s(f,e,t),o(f,e,u,c);var g=f[n]^f[e],p=f[n+1]^f[e+1];f[n]=p,f[n+1]=g,s(f,r,n),g=f[t]^f[r],p=f[t+1]^f[r+1],f[t]=g>>>24^p<<8,f[t+1]=p>>>24^g<<8,s(f,e,t),o(f,e,l,h),g=f[n]^f[e],p=f[n+1]^f[e+1],f[n]=g>>>16^p<<16,f[n+1]=p>>>16^g<<16,s(f,r,n),g=f[t]^f[r],p=f[t+1]^f[r+1],f[t]=p>>>31^g<<1,f[t+1]=g>>>31^p<<1}var c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),l=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),f=new Uint32Array(32),d=new Uint32Array(32);function h(e,t){var r=0;for(r=0;r<16;r++)f[r]=e.h[r],f[r+16]=c[r];for(f[24]=f[24]^e.t,f[25]=f[25]^e.t/4294967296,t&&(f[28]=~f[28],f[29]=~f[29]),r=0;r<32;r++)d[r]=a(e.b,4*r);for(r=0;r<12;r++)u(0,8,16,24,l[16*r+0],l[16*r+1]),u(2,10,18,26,l[16*r+2],l[16*r+3]),u(4,12,20,28,l[16*r+4],l[16*r+5]),u(6,14,22,30,l[16*r+6],l[16*r+7]),u(0,10,20,30,l[16*r+8],l[16*r+9]),u(2,12,22,24,l[16*r+10],l[16*r+11]),u(4,14,16,26,l[16*r+12],l[16*r+13]),u(6,8,18,28,l[16*r+14],l[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^f[r]^f[r+16]}var g=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,t,r,n){g.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=e,g[0]=e,t&&(g[1]=t.length),g[2]=1,g[3]=1,r&&g.set(r,32),n&&g.set(n,48);for(var i=0;i<16;i++)this.h[i]=c[i]^a(g,4*i);t&&(m(this,t),this.c=128)}function m(e,t){for(var r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,h(e,!1),e.c=0),e.b[e.c++]=t[r]}function y(e){return e<16?"0"+e.toString(16):e.toString(16)}p.prototype.update=function(e){return n(null!=e,"input must be Uint8Array or Buffer"),m(this,e),this},p.prototype.digest=function(e){var t=e&&"binary"!==e&&"hex"!==e?e:new Uint8Array(this.outlen);return n(t.length>=this.outlen,"out must have at least outlen bytes of space"),function(e,t){e.t+=e.c;for(;e.c<128;)e.b[e.c++]=0;h(e,!0);for(var r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)}(this,t),"hex"===e?function(e){for(var t="",r=0;r<e.length;r++)t+=y(e[r]);return t}(t):t},p.prototype.final=p.prototype.digest,p.ready=function(e){i.ready((function(){e()}))};var A=p;e.exports=function(e,t,r,i,s){return!0!==s&&(n(e>=v,"outlen must be at least "+v+", was given "+e),n(e<=w,"outlen must be at most "+w+", was given "+e),null!=t&&n(t.length>=b,"key must be at least "+b+", was given "+t.length),null!=t&&n(t.length<=I,"key must be at most "+I+", was given "+t.length),null!=r&&n(r.length===T,"salt must be exactly "+T+", was given "+r.length),null!=i&&n(i.length===C,"personal must be exactly "+C+", was given "+i.length)),new A(e,t,r,i)},e.exports.ready=function(e){i.ready((function(){e()}))},e.exports.WASM_SUPPORTED=i.SUPPORTED,e.exports.WASM_LOADED=!1;var v=e.exports.BYTES_MIN=16,w=e.exports.BYTES_MAX=64,b=(e.exports.BYTES=32,e.exports.KEYBYTES_MIN=16),I=e.exports.KEYBYTES_MAX=64,T=(e.exports.KEYBYTES=32,e.exports.SALTBYTES=16),C=e.exports.PERSONALBYTES=16;i.ready((function(t){t||(e.exports.WASM_LOADED=!0,A=i)}))},8287:(e,t,r)=>{const n=r(7526),i=r(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|p(e,t);let n=a(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(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($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(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 u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|g(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?a(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function 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|g(e))}function d(e){const t=e.length<0?0:0|g(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,u.prototype),n}function g(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(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 K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function m(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 _(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return N(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function A(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),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let s,o=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(s=r;s<a;s++)if(c(e,s)===c(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===u)return n*o}else-1!==n&&(s-=s-n),n=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let n=0;n<u;n++)if(c(e,s+n)!==c(t,n)){r=!1;break}if(r)return s}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 s=t.length;let o;for(n>s/2&&(n=s/2),o=0;o<n;++o){const n=parseInt(t.substr(2*o,2),16);if(Y(n))return o;e[r+o]=n}return o}function b(e,t,r,n){return W(K(t,e.length-r),e,r,n)}function I(e,t,r,n){return W(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 T(e,t,r,n){return W(z(t),e,r,n)}function C(e,t,r,n){return W(function(e,t){let r,n,i;const s=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function E(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,u;switch(o){case 1:t<128&&(s=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(s=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return function(e){const t=e.length;if(t<=B)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=B));return r}(n)}t.kMaxLength=o,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return 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)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if($(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(u.prototype[s]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0);const a=Math.min(s,o),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==l[e]){s=c[e],o=l[e];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return A(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return A(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return b(this,e,t,r);case"ascii":case"latin1":case"binary":return I(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const B=4096;function N(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 O(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 _(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+=J[e[n]];return i}function P(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 D(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,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function x(e,t,r,n,i){j(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function L(e,t,r,n,i){j(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function F(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,s){return t=+t,r>>>=0,s||F(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,s){return t=+t,r>>>=0,s||F(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=X((function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=X((function(e){Q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},u.prototype.writeUint8=u.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},u.prototype.writeUint16LE=u.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},u.prototype.writeUint16BE=u.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},u.prototype.writeUint32LE=u.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},u.prototype.writeUint32BE=u.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},u.prototype.writeBigUInt64LE=X((function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s>>0)-o&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s>>0)-o&255;return t+r},u.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},u.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},u.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},u.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},u.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},u.prototype.writeBigInt64LE=X((function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const s=u.isBuffer(e)?e:u.from(e,n),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%o]}return this};const k={};function V(e,t,r){k[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 G(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 j(e,t,r,n,i,s){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new k.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){Q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,s)}function Q(e,t){if("number"!=typeof e)throw new k.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw Q(e,r),new k.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new k.ERR_BUFFER_OUT_OF_BOUNDS;throw new k.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}V("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),V("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),V("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=G(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=G(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let i=null;const s=[];for(let o=0;o<n;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function z(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(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 $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},7007:e=>{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 s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}p(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&p(e,"error",t,r)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,s,o,c;if(a(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,c=l,console&&console.warn&&console.warn(c)}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):g(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 g(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function p(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(s){n.once&&e.removeEventListener(t,i),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},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+".");o=e}}),s.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},s.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},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,l=g(u,c);for(r=0;r<c;++r)n(l[r],this,t)}return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,s,o;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,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;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,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.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,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[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},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},251:(e,t)=>{t.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,s=h&(1<<-l)-1,h>>=-l,l+=a;l>0;s=256*s+e[t+f],f+=d,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=d,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),s-=c}return(h?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var o,a,u,c=8*s-i-1,l=(1<<c)-1,f=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:s-1,g=n?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(a=0,o=l):o+f>=1?(a=(t*u-1)*Math.pow(2,i),o+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=255&a,h+=g,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[r+h]=255&o,h+=g,o/=256,c-=8);e[r+h-g]|=128*p}},6698: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}}},1013:(e,t,r)=>{var n=r(7372).stringify,i=r(8146);e.exports=function(e){return{parse:i(e),stringify:n}},e.exports.parse=i(),e.exports.stringify=n},8146:(e,t,r)=>{var n=null;const i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,s=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var o,a,u,c,l={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},f=function(e){throw{name:"SyntaxError",message:e,at:o,text:u}},d=function(e){return e&&e!==a&&f("Expected '"+e+"' instead of '"+a+"'"),a=u.charAt(o),o+=1,a},h=function(){var e,i="";for("-"===a&&(i="-",d("-"));a>="0"&&a<="9";)i+=a,d();if("."===a)for(i+=".";d()&&a>="0"&&a<="9";)i+=a;if("e"===a||"E"===a)for(i+=a,d(),"-"!==a&&"+"!==a||(i+=a,d());a>="0"&&a<="9";)i+=a,d();if(e=+i,isFinite(e))return null==n&&(n=r(1594)),i.length>15?t.storeAsString?i:t.useNativeBigInt?BigInt(i):new n(i):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new n(e):e;f("Bad number")},g=function(){var e,t,r,n="";if('"'===a)for(var i=o;d();){if('"'===a)return o-1>i&&(n+=u.substring(i,o-1)),d(),n;if("\\"===a){if(o-1>i&&(n+=u.substring(i,o-1)),d(),"u"===a){for(r=0,t=0;t<4&&(e=parseInt(d(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof l[a])break;n+=l[a]}i=o}}f("Bad string")},p=function(){for(;a&&a<=" ";)d()};return c=function(){switch(p(),a){case"{":return function(){var e,r=Object.create(null);if("{"===a){if(d("{"),p(),"}"===a)return d("}"),r;for(;a;){if(e=g(),p(),d(":"),!0===t.strict&&Object.hasOwnProperty.call(r,e)&&f('Duplicate key "'+e+'"'),!0===i.test(e)?"error"===t.protoAction?f("Object contains forbidden prototype property"):"ignore"===t.protoAction?c():r[e]=c():!0===s.test(e)?"error"===t.constructorAction?f("Object contains forbidden constructor property"):"ignore"===t.constructorAction?c():r[e]=c():r[e]=c(),p(),"}"===a)return d("}"),r;d(","),p()}}f("Bad object")}();case"[":return function(){var e=[];if("["===a){if(d("["),p(),"]"===a)return d("]"),e;for(;a;){if(e.push(c()),p(),"]"===a)return d("]"),e;d(","),p()}}f("Bad array")}();case'"':return g();case"-":return h();default:return a>="0"&&a<="9"?h():function(){switch(a){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}f("Unexpected '"+a+"'")}()}},function(e,t){var r;return u=e+"",o=0,a=" ",r=c(),p(),a&&f("Syntax error"),"function"==typeof t?function e(r,n){var i,s=r[n];return s&&"object"==typeof s&&Object.keys(s).forEach((function(t){void 0!==(i=e(s,t))?s[t]=i:delete s[t]})),t.call(r,n,s)}({"":r},""):r}}},7372:(e,t,r)=>{var n=r(1594),i=e.exports;!function(){var e,t,r,s=/[\\\"\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 a(e){return s.lastIndex=0,s.test(e)?'"'+e.replace(s,(function(e){var t=o[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function u(i,s){var o,c,l,f,d,h=e,g=s[i],p=null!=g&&(g instanceof n||n.isBigNumber(g));switch(g&&"object"==typeof g&&"function"==typeof g.toJSON&&(g=g.toJSON(i)),"function"==typeof r&&(g=r.call(s,i,g)),typeof g){case"string":return p?g:a(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":case"bigint":return String(g);case"object":if(!g)return"null";if(e+=t,d=[],"[object Array]"===Object.prototype.toString.apply(g)){for(f=g.length,o=0;o<f;o+=1)d[o]=u(o,g)||"null";return l=0===d.length?"[]":e?"[\n"+e+d.join(",\n"+e)+"\n"+h+"]":"["+d.join(",")+"]",e=h,l}if(r&&"object"==typeof r)for(f=r.length,o=0;o<f;o+=1)"string"==typeof r[o]&&(l=u(c=r[o],g))&&d.push(a(c)+(e?": ":":")+l);else Object.keys(g).forEach((function(t){var r=u(t,g);r&&d.push(a(t)+(e?": ":":")+r)}));return l=0===d.length?"{}":e?"{\n"+e+d.join(",\n"+e)+"\n"+h+"}":"{"+d.join(",")+"}",e=h,l}}"function"!=typeof i.stringify&&(i.stringify=function(n,i,s){var o;if(e="",t="","number"==typeof s)for(o=0;o<s;o+=1)t+=" ";else"string"==typeof s&&(t=s);if(r=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return u("",{"":n})})}()},5508:(e,t,r)=>{e.exports=r(9792)(r(4817))},9792:(e,t,r)=>{const n=r(212),i=r(4614);e.exports=function(e){const t=n(e),r=i(e);return function(e,n){switch("string"==typeof e?e.toLowerCase():e){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+e)}}}},212:(e,t,r)=>{const{Transform:n}=r(8399);e.exports=e=>class t extends n{constructor(t,r,n,i,s){super(s),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=s,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},4614:(e,t,r)=>{const{Transform:n}=r(8399);e.exports=e=>class t extends n{constructor(t,r,n,i){super(i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(e)||(e=Buffer.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},9078:(e,t)=>{const r=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];t.p1600=function(e){for(let t=0;t<24;++t){const n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49];let h=f^(s<<1|o>>>31),g=d^(o<<1|s>>>31);const p=e[0]^h,m=e[1]^g,y=e[10]^h,A=e[11]^g,v=e[20]^h,w=e[21]^g,b=e[30]^h,I=e[31]^g,T=e[40]^h,C=e[41]^g;h=n^(a<<1|u>>>31),g=i^(u<<1|a>>>31);const S=e[2]^h,E=e[3]^g,B=e[12]^h,N=e[13]^g,O=e[22]^h,_=e[23]^g,P=e[32]^h,D=e[33]^g,R=e[42]^h,x=e[43]^g;h=s^(c<<1|l>>>31),g=o^(l<<1|c>>>31);const L=e[4]^h,F=e[5]^g,U=e[14]^h,M=e[15]^g,k=e[24]^h,V=e[25]^g,G=e[34]^h,j=e[35]^g,Q=e[44]^h,H=e[45]^g;h=a^(f<<1|d>>>31),g=u^(d<<1|f>>>31);const q=e[6]^h,K=e[7]^g,z=e[16]^h,W=e[17]^g,$=e[26]^h,Y=e[27]^g,J=e[36]^h,X=e[37]^g,Z=e[46]^h,ee=e[47]^g;h=c^(n<<1|i>>>31),g=l^(i<<1|n>>>31);const te=e[8]^h,re=e[9]^g,ne=e[18]^h,ie=e[19]^g,se=e[28]^h,oe=e[29]^g,ae=e[38]^h,ue=e[39]^g,ce=e[48]^h,le=e[49]^g,fe=p,de=m,he=A<<4|y>>>28,ge=y<<4|A>>>28,pe=v<<3|w>>>29,me=w<<3|v>>>29,ye=I<<9|b>>>23,Ae=b<<9|I>>>23,ve=T<<18|C>>>14,we=C<<18|T>>>14,be=S<<1|E>>>31,Ie=E<<1|S>>>31,Te=N<<12|B>>>20,Ce=B<<12|N>>>20,Se=O<<10|_>>>22,Ee=_<<10|O>>>22,Be=D<<13|P>>>19,Ne=P<<13|D>>>19,Oe=R<<2|x>>>30,_e=x<<2|R>>>30,Pe=F<<30|L>>>2,De=L<<30|F>>>2,Re=U<<6|M>>>26,xe=M<<6|U>>>26,Le=V<<11|k>>>21,Fe=k<<11|V>>>21,Ue=G<<15|j>>>17,Me=j<<15|G>>>17,ke=H<<29|Q>>>3,Ve=Q<<29|H>>>3,Ge=q<<28|K>>>4,je=K<<28|q>>>4,Qe=W<<23|z>>>9,He=z<<23|W>>>9,qe=$<<25|Y>>>7,Ke=Y<<25|$>>>7,ze=J<<21|X>>>11,We=X<<21|J>>>11,$e=ee<<24|Z>>>8,Ye=Z<<24|ee>>>8,Je=te<<27|re>>>5,Xe=re<<27|te>>>5,Ze=ne<<20|ie>>>12,et=ie<<20|ne>>>12,tt=oe<<7|se>>>25,rt=se<<7|oe>>>25,nt=ae<<8|ue>>>24,it=ue<<8|ae>>>24,st=ce<<14|le>>>18,ot=le<<14|ce>>>18;e[0]=fe^~Te&Le,e[1]=de^~Ce&Fe,e[10]=Ge^~Ze&pe,e[11]=je^~et&me,e[20]=be^~Re&qe,e[21]=Ie^~xe&Ke,e[30]=Je^~he&Se,e[31]=Xe^~ge&Ee,e[40]=Pe^~Qe&tt,e[41]=De^~He&rt,e[2]=Te^~Le&ze,e[3]=Ce^~Fe&We,e[12]=Ze^~pe&Be,e[13]=et^~me&Ne,e[22]=Re^~qe&nt,e[23]=xe^~Ke&it,e[32]=he^~Se&Ue,e[33]=ge^~Ee&Me,e[42]=Qe^~tt&ye,e[43]=He^~rt&Ae,e[4]=Le^~ze&st,e[5]=Fe^~We&ot,e[14]=pe^~Be&ke,e[15]=me^~Ne&Ve,e[24]=qe^~nt&ve,e[25]=Ke^~it&we,e[34]=Se^~Ue&$e,e[35]=Ee^~Me&Ye,e[44]=tt^~ye&Oe,e[45]=rt^~Ae&_e,e[6]=ze^~st&fe,e[7]=We^~ot&de,e[16]=Be^~ke&Ge,e[17]=Ne^~Ve&je,e[26]=nt^~ve&be,e[27]=it^~we&Ie,e[36]=Ue^~$e&Je,e[37]=Me^~Ye&Xe,e[46]=ye^~Oe&Pe,e[47]=Ae^~_e&De,e[8]=st^~fe&Te,e[9]=ot^~de&Ce,e[18]=ke^~Ge&Ze,e[19]=Ve^~je&et,e[28]=ve^~be&Re,e[29]=we^~Ie&xe,e[38]=$e^~Je&he,e[39]=Ye^~Xe&ge,e[48]=Oe^~Pe&Qe,e[49]=_e^~De&He,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},4817:(e,t,r)=>{const n=r(9078);function i(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}i.prototype.initialize=function(e,t){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0)},i.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<this.count%4*8,0!=(128&e)&&this.count===this.blockSize-1&&n.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,n.p1600(this.state),this.count=0,this.squeezing=!0},i.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},i.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i},6889:e=>{function t(e,t){if(!e)throw new Error(t||"AssertionError")}t.notEqual=function(e,r,n){t(e!=r,n)},t.notOk=function(e,r){t(!e,r)},t.equal=function(e,r,n){t(e==r,n)},t.ok=t,e.exports=t},6946:(e,t,r)=>{e.exports=r(4394)},4394:(e,t,r)=>{var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(3449),n.BufferWriter=r(818),n.Reader=r(6237),n.BufferReader=r(3158),n.util=r(3610),n.rpc=r(5047),n.roots=r(4529),n.configure=i,i()},6237:(e,t,r)=>{e.exports=u;var n,i=r(3610),s=i.LongBits,o=i.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},f=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l};function d(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function g(){if(this.pos+8>this.len)throw a(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=f(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,r);if(t===r){var n=i.Buffer;return n?n.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){n=e,u.create=f(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return g.call(this)[t](!0)},sfixed64:function(){return g.call(this)[t](!1)}})}},3158:(e,t,r)=>{e.exports=s;var n=r(6237);(s.prototype=Object.create(n.prototype)).constructor=s;var i=r(3610);function s(e){n.call(this,e)}s._configure=function(){i.Buffer&&(s.prototype._slice=i.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},4529:e=>{e.exports={}},5047:(e,t,r)=>{t.Service=r(7595)},7595:(e,t,r)=>{e.exports=i;var n=r(3610);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,s,o){if(!s)throw TypeError("request must be specified");var a=this;if(!o)return n.asPromise(e,a,t,r,i,s);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,r){if(e)return a.emit("error",e,t),o(e);if(null!==r){if(!(r instanceof i))try{r=i[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",r,t),o(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},2239:(e,t,r)=>{e.exports=i;var n=r(3610);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=i.zero=new i(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):s},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===o?s:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},3610:function(e,t,r){var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function s(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}n.asPromise=r(8045),n.base64=r(8839),n.EventEmitter=r(4358),n.float=r(9410),n.inquire=r(4153),n.utf8=r(1447),n.pool=r(9390),n.LongBits=r(2239),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=s,n.ProtocolError=s("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},3449:(e,t,r)=>{e.exports=f;var n,i=r(3610),s=i.LongBits,o=i.base64,a=i.utf8;function u(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function f(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var d=function(){return i.Buffer?function(){return(f.create=function(){return new n})()}:function(){return new f}};function h(e,t,r){t[r]=255&e}function g(e,t){this.len=e,this.next=void 0,this.val=t}function p(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function m(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}f.create=d(),f.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(f.alloc=i.pool(f.alloc,i.Array.prototype.subarray)),f.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},g.prototype=Object.create(u.prototype),g.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},f.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new g((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},f.prototype.int32=function(e){return e<0?this._push(p,10,s.fromNumber(e)):this.uint32(e)},f.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},f.prototype.uint64=function(e){var t=s.from(e);return this._push(p,t.length(),t)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(p,t.length(),t)},f.prototype.bool=function(e){return this._push(h,1,e?1:0)},f.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(e){var t=s.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},f.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var y=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};f.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(i.isString(e)){var r=f.alloc(t=o.length(e));o.decode(e,r,0),e=r}return this.uint32(t)._push(y,t,e)},f.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},f.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},f.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},f.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},f._configure=function(e){n=e,f.create=d(),n._configure()}},818:(e,t,r)=>{e.exports=s;var n=r(3449);(s.prototype=Object.create(n.prototype)).constructor=s;var i=r(3610);function s(){n.call(this)}function o(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}s._configure=function(){s.alloc=i._Buffer_allocUnsafe,s.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},s.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},s._configure()},6048:e=>{var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,s,o,a;if("string"==typeof t&&(s="not ",t.substr(!o||o<0?0:+o,s.length)===s)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(u," ").concat(i," ").concat(n(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},5382:(e,t,r)=>{var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(5412),s=r(6708);r(6698)(c,i);for(var o=n(s.prototype),a=0;a<o.length;a++){var u=o[a];c.prototype[u]||(c.prototype[u]=s.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||process.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},3600:(e,t,r)=>{e.exports=i;var n=r(4610);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(6698)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},5412:(e,t,r)=>{var n;e.exports=C,C.ReadableState=T;r(7007).EventEmitter;var i=function(e,t){return e.listeners(t).length},s=r(345),o=r(8287).Buffer,a=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var u,c=r(9838);u=c&&c.debuglog?c.debuglog("stream"):function(){};var l,f,d,h=r(2726),g=r(5896),p=r(5291).getHighWaterMark,m=r(6048).F,y=m.ERR_INVALID_ARG_TYPE,A=m.ERR_STREAM_PUSH_AFTER_EOF,v=m.ERR_METHOD_NOT_IMPLEMENTED,w=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(C,s);var b=g.errorOrDestroy,I=["error","close","destroy","pause","resume"];function T(e,t,i){n=n||r(5382),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=p(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(3141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function C(e){if(n=n||r(5382),!(this instanceof C))return new C(e);var t=this instanceof n;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function S(e,t,r,n,i){u("readableAddChunk",t);var s,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,_(e)))}(e,c);else if(i||(s=function(e,t){var r;n=t,o.isBuffer(n)||n instanceof a||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(c,t)),s)b(e,s);else if(c.objectMode||t&&t.length>0)if("string"==typeof t||c.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),n)c.endEmitted?b(e,new w):E(e,c,t,!0);else if(c.ended)b(e,new A);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||0!==t.length?E(e,c,t,!1):P(e,c)):E(e,c,t,!1)}else n||(c.reading=!1,P(e,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function E(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&O(e)),P(e,t)}Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),C.prototype.destroy=g.destroy,C.prototype._undestroy=g.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=o.from(e,t),t=""),r=!0),S(this,e,t,!1,r)},C.prototype.unshift=function(e){return S(this,e,null,!0,!1)},C.prototype.isPaused=function(){return!1===this._readableState.flowing},C.prototype.setEncoding=function(e){l||(l=r(3141).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var B=1073741824;function N(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=B?e=B:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(_,e))}function _(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,F(e)}function P(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(D,e,t))}function D(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(u("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function R(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function x(e){u("readable nexttick read 0"),e.read(0)}function L(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),F(e),t.flowing&&!t.reading&&e.read(0)}function F(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function M(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(k,t,e))}function k(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}C.prototype.read=function(e){u("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):O(this),null;if(0===(e=N(e,t))&&t.ended)return 0===t.length&&M(this),null;var n,i=t.needReadable;return u("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&u("length less than watermark",i=!0),t.ended||t.reading?u("reading or ended",i=!1):i&&(u("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=N(r,t))),null===(n=e>0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&M(this)),null!==n&&this.emit("data",n),n},C.prototype._read=function(e){b(this,new v("_read()"))},C.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var s=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?a:p;function o(t,i){u("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,u("cleanup"),e.removeListener("close",h),e.removeListener("finish",g),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",p),r.removeListener("data",f),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function a(){u("onend"),e.end()}n.endEmitted?process.nextTick(s):r.once("end",s),e.on("unpipe",o);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,F(e))}}(r);e.on("drain",c);var l=!1;function f(t){u("ondata");var i=e.write(t);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!l&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){u("onerror",t),p(),e.removeListener("error",d),0===i(e,"error")&&b(e,t)}function h(){e.removeListener("finish",g),p()}function g(){u("onfinish"),e.removeListener("close",h),p()}function p(){u("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",h),e.once("finish",g),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},C.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=V(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},C.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?O(this):n.reading||process.nextTick(x,this))),r},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(R,this),r},C.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(R,this),t},C.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(L,e,t))}(this,e)),e.paused=!1,this},C.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(u("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<I.length;s++)e.on(I[s],this.emit.bind(this,I[s]));return this._read=function(t){u("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(C.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(2955)),f(this)}),Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(C.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(C.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),C._fromList=U,Object.defineProperty(C.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(C.from=function(e,t){return void 0===d&&(d=r(5157)),d(C,e,t)})},4610:(e,t,r)=>{e.exports=l;var n=r(6048).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,s=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(5382);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new o;return e.push(null)}r(6698)(l,u),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},6708:(e,t,r)=>{function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=C,C.WritableState=T;var s={deprecate:r(4643)},o=r(345),a=r(8287).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,l=r(5896),f=r(5291).getHighWaterMark,d=r(6048).F,h=d.ERR_INVALID_ARG_TYPE,g=d.ERR_METHOD_NOT_IMPLEMENTED,p=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,A=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,b=l.errorOrDestroy;function I(){}function T(e,t,s){i=i||r(5382),e=e||{},"boolean"!=typeof s&&(s=t instanceof i),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new p;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(_,e,t),e._writableState.errorEmitted=!0,b(e,n)):(i(n),e._writableState.errorEmitted=!0,b(e,n),_(e,t))}(e,r,n,t,i);else{var s=N(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||B(e,r),n?process.nextTick(E,e,r,s,i):E(e,r,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function C(e){var t=this instanceof(i=i||r(5382));if(!t&&!c.call(C,this))return new C(e);this._writableState=new T(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function S(e,t,r,n,i,s,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function E(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),_(e,t)}function B(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,s=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)s[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;s.allBuffers=u,S(e,t,!0,t.length,s,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(S(e,t,!1,t.objectMode?1:c.length,c,l,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function N(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(r){t.pendingcb--,r&&b(e,r),t.prefinished=!0,e.emit("prefinish"),_(e,t)}))}function _(e,t){var r=N(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(C,o),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===C&&(e&&e._writableState instanceof T)}})):c=function(e){return e instanceof this},C.prototype.pipe=function(){b(this,new m)},C.prototype.write=function(e,t,r){var n,i=this._writableState,s=!1,o=!i.objectMode&&(n=e,a.isBuffer(n)||n instanceof u);return o&&!a.isBuffer(e)&&(e=function(e){return a.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=I),i.ending?function(e,t){var r=new v;b(e,r),process.nextTick(t,r)}(this,r):(o||function(e,t,r,n){var i;return null===r?i=new A:"string"==typeof r||t.objectMode||(i=new h("chunk",["string","Buffer"],r)),!i||(b(e,i),process.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,s=function(e,t,r,n,i,s){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=a.from(t,r));return t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var u=t.objectMode?1:n.length;t.length+=u;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else S(e,t,!1,u,n,i,s);return c}(this,i,o,e,t,r)),s},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||B(this,e))},C.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(e,t,r){r(new g("_write()"))},C.prototype._writev=null,C.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,_(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),C.prototype.destroy=l.destroy,C.prototype._undestroy=l.undestroy,C.prototype._destroy=function(e,t){t(e)}},2955:(e,t,r)=>{var n;function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(6238),o=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function g(e){var t=e[o];if(null!==t){var r=e[d].read();null!==r&&(e[l]=null,e[o]=null,e[a]=null,t(h(r,!1)))}}function p(e){process.nextTick(g,e)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[u]?r(e[u]):t(h(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[f](r,n)}),n)}}(n,this));else{var i=this[d].read();if(null!==i)return Promise.resolve(h(i,!1));r=new Promise(this[f])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(y,(i(t={},d,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[d].read();n?(r[l]=null,r[o]=null,r[a]=null,e(h(n,!1))):(r[o]=e,r[a]=t)},writable:!0}),t));return r[l]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[a];return null!==t&&(r[l]=null,r[o]=null,r[a]=null,t(e)),void(r[u]=e)}var n=r[o];null!==n&&(r[l]=null,r[o]=null,r[a]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",p.bind(null,r)),r}},2726:(e,t,r)=>{function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var u=r(8287).Buffer,c=r(5340).inspect,l=c&&c.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,r,n,i=u.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=s.data,r=i,n=o,u.prototype.copy.call(t,r,n),o+=s.data.length,s=s.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,s=e>i.length?i.length:e;if(s===i.length?n+=i:n+=i.slice(0,e),0==(e-=s)){s===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(s));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return c(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5896:e=>{function t(e,t){n(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var s=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,e)):process.nextTick(n,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?s._writableState?s._writableState.errorEmitted?process.nextTick(r,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,e)):process.nextTick(t,s,e):i?(process.nextTick(r,s),i(e)):process.nextTick(r,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},6238:(e,t,r)=>{var n=r(6048).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,s){if("function"==typeof r)return e(t,null,r);r||(r={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(s||i);var o=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||l()},c=t._writableState&&t._writableState.finished,l=function(){a=!1,c=!0,o||s.call(t)},f=t._readableState&&t._readableState.endEmitted,d=function(){o=!1,f=!0,a||s.call(t)},h=function(e){s.call(t,e)},g=function(){var e;return o&&!f?(t._readableState&&t._readableState.ended||(e=new n),s.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),s.call(t,e)):void 0},p=function(){t.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",l),t.on("abort",g),t.req?p():t.on("request",p)),t.on("end",d),t.on("finish",l),!1!==r.error&&t.on("error",h),t.on("close",g),function(){t.removeListener("complete",l),t.removeListener("abort",g),t.removeListener("request",p),t.req&&t.req.removeListener("finish",l),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",l),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",g)}}},5157:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},7758:(e,t,r)=>{var n;var i=r(6048).F,s=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var l,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new s("streams");var d=t.map((function(e,i){var s=i<t.length-1;return function(e,t,i,s){s=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(s);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=r(6238)),n(e,{readable:t,writable:i},(function(e){if(e)return s(e);a=!0,s()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new o("pipe"))}}(e,s,i>0,(function(e){l||(l=e),e&&d.forEach(u),s||(d.forEach(u),f(l))}))}));return t.reduce(c)}},5291:(e,t,r)=>{var n=r(6048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(i?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},345:(e,t,r)=>{e.exports=r(7007).EventEmitter},8399:(e,t,r)=>{(t=e.exports=r(5412)).Stream=t,t.Readable=t,t.Writable=r(6708),t.Duplex=r(5382),t.Transform=r(4610),t.PassThrough=r(3600),t.finished=r(6238),t.pipeline=r(7758)},2861:(e,t,r)=>{var n=r(8287),i=n.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(s(n,t),t.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.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},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},3141:(e,t,r)=>{var n=r(2861).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 s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=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 o(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 u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function 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.I=s,s.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||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.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}},4643:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},6425:(e,t,r)=>{function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:s}=Object,o=(a=Object.create(null),e=>{const t=i.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const u=e=>(e=e.toLowerCase(),t=>o(t)===e),c=e=>t=>typeof t===e,{isArray:l}=Array,f=c("undefined");const d=u("ArrayBuffer");const h=c("string"),g=c("function"),p=c("number"),m=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==o(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},A=u("Date"),v=u("File"),w=u("Blob"),b=u("FileList"),I=u("URLSearchParams");function T(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),l(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let o;for(n=0;n<s;n++)o=i[n],t.call(null,e[o],o,e)}}function C(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,E=e=>!f(e)&&e!==S;const B=(N="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>N&&e instanceof N);var N;const O=u("HTMLFormElement"),_=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),P=u("RegExp"),D=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};T(r,((r,i)=>{let s;!1!==(s=t(r,i,e))&&(n[i]=s||r)})),Object.defineProperties(e,n)},R="abcdefghijklmnopqrstuvwxyz",x="0123456789",L={DIGIT:x,ALPHA:R,ALPHA_DIGIT:R+R.toUpperCase()+x};const F=u("AsyncFunction");var U={isArray:l,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=o(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:h,isNumber:p,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:y,isUndefined:f,isDate:A,isFile:v,isBlob:w,isRegExp:P,isFunction:g,isStream:e=>m(e)&&g(e.pipe),isURLSearchParams:I,isTypedArray:B,isFileList:b,forEach:T,merge:function e(){const{caseless:t}=E(this)&&this||{},r={},n=(n,i)=>{const s=t&&C(r,i)||i;y(r[s])&&y(n)?r[s]=e(r[s],n):y(n)?r[s]=e({},n):l(n)?r[s]=n.slice():r[s]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&T(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:i}={})=>(T(t,((t,i)=>{r&&g(t)?e[i]=n(t,r):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,o,a;const u={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],n&&!n(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==r&&s(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:u,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!p(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:O,hasOwnProperty:_,hasOwnProp:_,reduceDescriptors:D,freezeMethods:e=>{D(e,((t,r)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];g(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return l(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:C,global:S,isContextDefined:E,ALPHABET:L,generateString:(e=16,t=L.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=l(e)?[]:{};return T(e,((e,t)=>{const s=r(e,n+1);!f(s)&&(i[t]=s)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:F,isThenable:e=>e&&(m(e)||g(e))&&g(e.then)&&g(e.catch)};function M(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}U.inherits(M,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const k=M.prototype,V={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{V[e]={value:e}})),Object.defineProperties(M,V),Object.defineProperty(k,"isAxiosError",{value:!0}),M.from=(e,t,r,n,i,s)=>{const o=Object.create(k);return U.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),M.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};function G(e){return U.isPlainObject(e)||U.isArray(e)}function j(e){return U.endsWith(e,"[]")?e.slice(0,-2):e}function Q(e,t,r){return e?e.concat(t).map((function(e,t){return e=j(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const H=U.toFlatObject(U,{},null,(function(e){return/^is[A-Z]/.test(e)}));function q(e,t,r){if(!U.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=U.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!U.isUndefined(t[e])}))).metaTokens,i=r.visitor||c,s=r.dots,o=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&U.isSpecCompliantForm(t);if(!U.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(U.isDate(e))return e.toISOString();if(!a&&U.isBlob(e))throw new M("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(e)||U.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,i){let a=e;if(e&&!i&&"object"==typeof e)if(U.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(U.isArray(e)&&function(e){return U.isArray(e)&&!e.some(G)}(e)||(U.isFileList(e)||U.endsWith(r,"[]"))&&(a=U.toArray(e)))return r=j(r),a.forEach((function(e,n){!U.isUndefined(e)&&null!==e&&t.append(!0===o?Q([r],n,s):null===o?r:r+"[]",u(e))})),!1;return!!G(e)||(t.append(Q(i,r,s),u(e)),!1)}const l=[],f=Object.assign(H,{defaultVisitor:c,convertValue:u,isVisitable:G});if(!U.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!U.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),U.forEach(r,(function(r,s){!0===(!(U.isUndefined(r)||null===r)&&i.call(t,r,U.isString(s)?s.trim():s,n,f))&&e(r,n?n.concat(s):[s])})),l.pop()}}(e),t}function K(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function z(e,t){this._pairs=[],e&&q(e,this,t)}const W=z.prototype;function $(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y(e,t,r){if(!t)return e;const n=r&&r.encode||$,i=r&&r.serialize;let s;if(s=i?i(t,r):U.isURLSearchParams(t)?t.toString():new z(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}W.append=function(e,t){this._pairs.push([e,t])},W.toString=function(e){const t=e?function(t){return e.call(this,t,K)}:K;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var J=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){U.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},X={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Z={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:z,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ee="undefined"!=typeof window&&"undefined"!=typeof document,te=(re="undefined"!=typeof navigator&&navigator.product,ee&&["ReactNative","NativeScript","NS"].indexOf(re)<0);var re;const ne="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var ie={...Object.freeze({__proto__:null,hasBrowserEnv:ee,hasStandardBrowserWebWorkerEnv:ne,hasStandardBrowserEnv:te}),...Z};function se(e){function t(e,r,n,i){let s=e[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=e.length;if(s=!s&&U.isArray(n)?n.length:s,a)return U.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!o;n[s]&&U.isObject(n[s])||(n[s]=[]);return t(e,r,n[s],i)&&U.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],t[s]=e[s];return t}(n[s])),!o}if(U.isFormData(e)&&U.isFunction(e.entries)){const r={};return U.forEachEntry(e,((e,n)=>{t(function(e){return U.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const oe={transitional:X,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=U.isObject(e);i&&U.isHTMLForm(e)&&(e=new FormData(e));if(U.isFormData(e))return n?JSON.stringify(se(e)):e;if(U.isArrayBuffer(e)||U.isBuffer(e)||U.isStream(e)||U.isFile(e)||U.isBlob(e))return e;if(U.isArrayBufferView(e))return e.buffer;if(U.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return q(e,new ie.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return ie.isNode&&U.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=U.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return q(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(U.isString(e))try{return(t||JSON.parse)(e),U.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||oe.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&U.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw M.from(e,M.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],(e=>{oe.headers[e]={}}));var ae=oe;const ue=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ce=Symbol("internals");function le(e){return e&&String(e).trim().toLowerCase()}function fe(e){return!1===e||null==e?e:U.isArray(e)?e.map(fe):String(e)}function de(e,t,r,n,i){return U.isFunction(n)?n.call(this,t,r):(i&&(t=r),U.isString(t)?U.isString(n)?-1!==t.indexOf(n):U.isRegExp(n)?n.test(t):void 0:void 0)}class he{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=le(t);if(!i)throw new Error("header name must be a non-empty string");const s=U.findKey(n,i);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||t]=fe(e))}const s=(e,t)=>U.forEach(e,((e,r)=>i(e,r,t)));return U.isPlainObject(e)||e instanceof this.constructor?s(e,t):U.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&ue[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=le(e)){const r=U.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(U.isFunction(t))return t.call(this,e,r);if(U.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=le(e)){const r=U.findKey(this,e);return!(!r||void 0===this[r]||t&&!de(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=le(e)){const i=U.findKey(r,e);!i||t&&!de(0,r[i],i,t)||(delete r[i],n=!0)}}return U.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!de(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return U.forEach(this,((n,i)=>{const s=U.findKey(r,i);if(s)return t[s]=fe(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=fe(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return U.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&U.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ce]=this[ce]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=le(e);t[n]||(!function(e,t){const r=U.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return U.isArray(e)?e.forEach(n):n(e),this}}he.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(he.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),U.freezeMethods(he);var ge=he;function pe(e,t){const r=this||ae,n=t||r,i=ge.from(n.headers);let s=n.data;return U.forEach(e,(function(e){s=e.call(r,s,i.normalize(),t?t.status:void 0)})),i.normalize(),s}function me(e){return!(!e||!e.__CANCEL__)}function ye(e,t,r){M.call(this,null==e?"canceled":e,M.ERR_CANCELED,t,r),this.name="CanceledError"}U.inherits(ye,M,{__CANCEL__:!0});var Ae=ie.hasStandardBrowserEnv?{write(e,t,r,n,i,s){const o=[e+"="+encodeURIComponent(t)];U.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),U.isString(n)&&o.push("path="+n),U.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ve(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var we=ie.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=U.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function be(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,s=0,o=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=n[o];i||(i=u),r[s]=a,n[s]=u;let l=o,f=0;for(;l!==s;)f+=r[l++],l%=e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const d=c&&u-c;return d?Math.round(1e3*f/d):void 0}}(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-r,u=n(a);r=s;const c={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:u||void 0,estimated:u&&o&&s<=o?(o-s)/u:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}const Ie={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=ge.from(e.headers).normalize();let s,o,{responseType:a,withXSRFToken:u}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(U.isFormData(n))if(ie.hasStandardBrowserEnv||ie.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(o=i.getContentType())){const[e,...t]=o?o.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const f=ve(e.baseURL,e.url);function d(){if(!l)return;const n=ge.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new M("Request failed with status code "+r.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),c()}),(function(e){r(e),c()}),{data:a&&"text"!==a&&"json"!==a?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),Y(f,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(d)},l.onabort=function(){l&&(r(new M("Request aborted",M.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new M("Network Error",M.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||X;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new M(t,n.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,e,l)),l=null},ie.hasStandardBrowserEnv&&(u&&U.isFunction(u)&&(u=u(e)),u||!1!==u&&we(f))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&Ae.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in l&&U.forEach(i.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),U.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&"json"!==a&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",be(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",be(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{l&&(r(!t||t.type?new ye(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const h=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);h&&-1===ie.protocols.indexOf(h)?r(new M("Unsupported protocol "+h+":",M.ERR_BAD_REQUEST,e)):l.send(n||null)}))}};U.forEach(Ie,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Te=e=>`- ${e}`,Ce=e=>U.isFunction(e)||null===e||!1===e;var Se=e=>{e=U.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let s=0;s<t;s++){let t;if(r=e[s],n=r,!Ce(r)&&(n=Ie[(t=String(r)).toLowerCase()],void 0===n))throw new M(`Unknown adapter '${t}'`);if(n)break;i[t||"#"+s]=n}if(!n){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new M("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Te).join("\n"):" "+Te(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ye(null,e)}function Be(e){Ee(e),e.headers=ge.from(e.headers),e.data=pe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Se(e.adapter||ae.adapter)(e).then((function(t){return Ee(e),t.data=pe.call(e,e.transformResponse,t),t.headers=ge.from(t.headers),t}),(function(t){return me(t)||(Ee(e),t&&t.response&&(t.response.data=pe.call(e,e.transformResponse,t.response),t.response.headers=ge.from(t.response.headers))),Promise.reject(t)}))}const Ne=e=>e instanceof ge?{...e}:e;function Oe(e,t){t=t||{};const r={};function n(e,t,r){return U.isPlainObject(e)&&U.isPlainObject(t)?U.merge.call({caseless:r},e,t):U.isPlainObject(t)?U.merge({},t):U.isArray(t)?t.slice():t}function i(e,t,r){return U.isUndefined(t)?U.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function s(e,t){if(!U.isUndefined(t))return n(void 0,t)}function o(e,t){return U.isUndefined(t)?U.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,i,s){return s in t?n(r,i):s in e?n(void 0,r):void 0}const u={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t)=>i(Ne(e),Ne(t),!0)};return U.forEach(Object.keys(Object.assign({},e,t)),(function(n){const s=u[n]||i,o=s(e[n],t[n],n);U.isUndefined(o)&&s!==a||(r[n]=o)})),r}const _e="1.6.8",Pe={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Pe[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const De={};Pe.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,s)=>{if(!1===e)throw new M(n(i," has been removed"+(t?" in "+t:"")),M.ERR_DEPRECATED);return t&&!De[i]&&(De[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,s)}};var Re={assertOptions:function(e,t,r){if("object"!=typeof e)throw new M("options must be an object",M.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const s=n[i],o=t[s];if(o){const t=e[s],r=void 0===t||o(t,s,e);if(!0!==r)throw new M("option "+s+" must be "+r,M.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new M("Unknown option "+s,M.ERR_BAD_OPTION)}},validators:Pe};const xe=Re.validators;class Le{constructor(e){this.defaults=e,this.interceptors={request:new J,response:new J}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Oe(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&Re.assertOptions(r,{silentJSONParsing:xe.transitional(xe.boolean),forcedJSONParsing:xe.transitional(xe.boolean),clarifyTimeoutError:xe.transitional(xe.boolean)},!1),null!=n&&(U.isFunction(n)?t.paramsSerializer={serialize:n}:Re.assertOptions(n,{encode:xe.function,serialize:xe.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=i&&U.merge(i.common,i[t.method]);i&&U.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=ge.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[Be.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),l=e.length,c=Promise.resolve(t);f<l;)c=c.then(e[f++],e[f++]);return c}l=o.length;let d=t;for(f=0;f<l;){const e=o[f++],t=o[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{c=Be.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=u.length;f<l;)c=c.then(u[f++],u[f++]);return c}getUri(e){return Y(ve((e=Oe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}U.forEach(["delete","get","head","options"],(function(e){Le.prototype[e]=function(t,r){return this.request(Oe(r||{},{method:e,url:t,data:(r||{}).data}))}})),U.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(Oe(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Le.prototype[e]=t(),Le.prototype[e+"Form"]=t(!0)}));var Fe=Le;class Ue{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new ye(e,n,i),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ue((function(t){e=t})),cancel:e}}}var Me=Ue;const ke={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ke).forEach((([e,t])=>{ke[t]=e}));var Ve=ke;const Ge=function e(t){const r=new Fe(t),i=n(Fe.prototype.request,r);return U.extend(i,Fe.prototype,r,{allOwnKeys:!0}),U.extend(i,r,null,{allOwnKeys:!0}),i.create=function(r){return e(Oe(t,r))},i}(ae);Ge.Axios=Fe,Ge.CanceledError=ye,Ge.CancelToken=Me,Ge.isCancel=me,Ge.VERSION=_e,Ge.toFormData=q,Ge.AxiosError=M,Ge.Cancel=Ge.CanceledError,Ge.all=function(e){return Promise.all(e)},Ge.spread=function(e){return function(t){return e.apply(null,t)}},Ge.isAxiosError=function(e){return U.isObject(e)&&!0===e.isAxiosError},Ge.mergeConfig=Oe,Ge.AxiosHeaders=ge,Ge.formToJSON=e=>se(U.isHTMLForm(e)?new FormData(e):e),Ge.getAdapter=Se,Ge.HttpStatusCode=Ve,Ge.default=Ge,e.exports=Ge}}]);