@1money/protocol-ts-sdk 2.1.0-beta.0 → 2.1.0-beta.1

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/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import {hexToBytes as hexToBytes$1,stringToBytes,keccak256,bytesToHex as bytesToHex$1,numberToHex,stringToHex,boolToHex,isAddress}from'viem';import {encode,decode}from'@ethereumjs/rlp';import axios from'axios';/**
1
+ import {hexToBytes as hexToBytes$1,stringToBytes,keccak256,bytesToHex as bytesToHex$1,numberToHex,stringToHex,boolToHex,isAddress,encodeAbiParameters,parseAbiParameters,encodeFunctionData}from'viem';import {encode,decode}from'@ethereumjs/rlp';import axios from'axios';/**
2
2
  * Derives the token account address given the wallet address and mint address.
3
3
  *
4
4
  * Address is 20 byte, 160 bits. Let's say if we want to support 50 billion
@@ -2098,6 +2098,81 @@ function createPrivateKeySigner(privateKey) {
2098
2098
  };
2099
2099
  },
2100
2100
  };
2101
+ }const EIP712_VERIFYING_CONTRACT = '0xfffffffffffffffffffffffffffffffffffffffe';
2102
+ const EIP712_DOMAIN_NAME = '1Money Network';
2103
+ const EIP712_DOMAIN_VERSION = '1';
2104
+ const SOL_MEMO_FIELDS = [
2105
+ { name: 'memoType', type: 'string' },
2106
+ { name: 'memoFormat', type: 'string' },
2107
+ { name: 'memoData', type: 'string' },
2108
+ ];
2109
+ // One entry per Eip712PayloadKind. Only payment populated today; append more later.
2110
+ // Mirrors l1client erc20_abi.rs (ABI TransferV1) + eip712_typed.rs (EIP-712 PaymentV1).
2111
+ const PAYMENT_KIND = {
2112
+ abiName: 'TransferV1',
2113
+ discriminant: 0,
2114
+ primaryType: 'PaymentV1',
2115
+ eip712Fields: [
2116
+ { name: 'chainId', type: 'uint64' },
2117
+ { name: 'nonce', type: 'uint64' },
2118
+ { name: 'recipient', type: 'address' },
2119
+ { name: 'value', type: 'uint256' },
2120
+ { name: 'token', type: 'address' },
2121
+ { name: 'memo', type: 'SolMemo' },
2122
+ ],
2123
+ abiParams: '(uint64,uint64,address,uint256,address,(string,string,string))',
2124
+ };// Parse a 0x 65-byte secp256k1 sig (eth_signTypedData_v4 output) into {v,r,s}.
2125
+ // l1client requires v ∈ {27,28} and rejects 0/1 at ingest; normalize 0→27,1→28.
2126
+ function parseSig(hex65) {
2127
+ const stripped = hex65.startsWith('0x') ? hex65.slice(2) : hex65;
2128
+ if (stripped.length !== 130) {
2129
+ throw new Error(`[1Money SDK]: expected 65-byte signature, got ${stripped.length / 2} bytes`);
2130
+ }
2131
+ const r = `0x${stripped.slice(0, 64)}`;
2132
+ const s = `0x${stripped.slice(64, 128)}`;
2133
+ const vByte = parseInt(stripped.slice(128, 130), 16);
2134
+ let v;
2135
+ if (vByte === 27 || vByte === 0)
2136
+ v = 27;
2137
+ else if (vByte === 28 || vByte === 1)
2138
+ v = 28;
2139
+ else
2140
+ throw new Error(`[1Money SDK]: unexpected signature v byte: 0x${vByte.toString(16)}`);
2141
+ return { v, r, s };
2142
+ }const SUBMIT_TYPED_DATA_ABI = [{
2143
+ type: 'function', name: 'submitTypedData',
2144
+ inputs: [{ name: 'envelope', type: 'tuple', components: [
2145
+ { name: 'kind', type: 'uint8' }, { name: 'payload', type: 'bytes' },
2146
+ { name: 'v', type: 'uint8' }, { name: 'r', type: 'bytes32' }, { name: 's', type: 'bytes32' },
2147
+ ] }], outputs: [],
2148
+ }];
2149
+ function buildPaymentEip712TypedData(input) {
2150
+ if (input.memo)
2151
+ validateMemo(input.memo);
2152
+ return {
2153
+ domain: { name: EIP712_DOMAIN_NAME, version: EIP712_DOMAIN_VERSION, chainId: input.chain_id, verifyingContract: EIP712_VERIFYING_CONTRACT },
2154
+ types: { PaymentV1: PAYMENT_KIND.eip712Fields, SolMemo: SOL_MEMO_FIELDS },
2155
+ primaryType: 'PaymentV1',
2156
+ message: {
2157
+ chainId: input.chain_id, nonce: input.nonce, recipient: input.recipient, value: input.value, token: input.token,
2158
+ memo: { memoType: input.memo?.type ?? '', memoFormat: input.memo?.format ?? '', memoData: input.memo?.data ?? '' },
2159
+ },
2160
+ };
2161
+ }
2162
+ function preparePaymentTypedTx(input) {
2163
+ const typedData = buildPaymentEip712TypedData(input);
2164
+ const memo = typedData.message.memo;
2165
+ const encodeCalldata = (sig) => {
2166
+ if (sig.v !== 27 && sig.v !== 28)
2167
+ throw new Error(`[1Money SDK]: EIP-712 v must be 27 or 28, got ${sig.v}`);
2168
+ const payload = encodeAbiParameters(parseAbiParameters(PAYMENT_KIND.abiParams), [[
2169
+ BigInt(input.chain_id), BigInt(input.nonce), input.recipient, BigInt(input.value), input.token,
2170
+ [memo.memoType, memo.memoFormat, memo.memoData],
2171
+ ]]);
2172
+ const data = encodeFunctionData({ abi: SUBMIT_TYPED_DATA_ABI, functionName: 'submitTypedData', args: [{ kind: PAYMENT_KIND.discriminant, payload, v: sig.v, r: sig.r, s: sig.s }] });
2173
+ return { to: input.token, data, value: 0n, gas: 21000n, gasPrice: 0n, type: 'legacy' };
2174
+ };
2175
+ return { kind: PAYMENT_KIND.abiName, primaryType: PAYMENT_KIND.primaryType, typedData, encodeCalldata };
2101
2176
  }const TransactionBuilder = {
2102
2177
  payment: preparePaymentTx,
2103
2178
  tokenManageList: prepareTokenManageListTx,
@@ -2113,4 +2188,4 @@ function createPrivateKeySigner(privateKey) {
2113
2188
  };var index = {
2114
2189
  api,
2115
2190
  client: client$1,
2116
- };export{MEMO_DATA_MAX_BYTES,MEMO_FORMAT_MAX_BYTES,MEMO_RLP_HEADER_ALLOWANCE,MEMO_TOTAL_MAX_BYTES,MEMO_TYPE_MAX_BYTES,MemoValidationError,TransactionBuilder,_typeof,api,calcSignedTxHash,calcTxHash,client$1 as client,createPreparedTx,createPrivateKeySigner,index as default,deriveTokenAddress,encodePayload,encodeRlpPayload,memoRlpList,preparePaymentTx,prepareTokenAuthorityTx,prepareTokenBridgeAndMintTx,prepareTokenBurnAndBridgeTx,prepareTokenBurnTx,prepareTokenClawbackTx,prepareTokenIssueTx,prepareTokenManageListTx,prepareTokenMetadataTx,prepareTokenMintTx,prepareTokenPauseTx,rlpValue,safePromiseAll,safePromiseLine,signMessage,toHex,validateMemo};
2191
+ };export{EIP712_DOMAIN_NAME,EIP712_DOMAIN_VERSION,EIP712_VERIFYING_CONTRACT,MEMO_DATA_MAX_BYTES,MEMO_FORMAT_MAX_BYTES,MEMO_RLP_HEADER_ALLOWANCE,MEMO_TOTAL_MAX_BYTES,MEMO_TYPE_MAX_BYTES,MemoValidationError,PAYMENT_KIND,SOL_MEMO_FIELDS,TransactionBuilder,_typeof,api,buildPaymentEip712TypedData,calcSignedTxHash,calcTxHash,client$1 as client,createPreparedTx,createPrivateKeySigner,index as default,deriveTokenAddress,encodePayload,encodeRlpPayload,memoRlpList,parseSig,preparePaymentTx,preparePaymentTypedTx,prepareTokenAuthorityTx,prepareTokenBridgeAndMintTx,prepareTokenBurnAndBridgeTx,prepareTokenBurnTx,prepareTokenClawbackTx,prepareTokenIssueTx,prepareTokenManageListTx,prepareTokenMetadataTx,prepareTokenMintTx,prepareTokenPauseTx,rlpValue,safePromiseAll,safePromiseLine,signMessage,toHex,validateMemo};
@@ -0,0 +1,3 @@
1
+ export * from './registry';
2
+ export * from './parseSig';
3
+ export * from './preparePaymentTypedTx';
@@ -0,0 +1,2 @@
1
+ import type { Eip712Signature } from './registry';
2
+ export declare function parseSig(hex65: string): Eip712Signature;
@@ -0,0 +1,51 @@
1
+ import { PAYMENT_KIND, SOL_MEMO_FIELDS } from './registry';
2
+ import type { Memo, ZeroXString } from '../../utils/index.js';
3
+ import type { Eip712Signature } from './registry';
4
+ export interface PaymentTypedTxInput {
5
+ chain_id: number;
6
+ nonce: number;
7
+ recipient: string;
8
+ value: string;
9
+ token: string;
10
+ memo?: Memo;
11
+ }
12
+ export interface PaymentEip712TypedData {
13
+ domain: {
14
+ name: string;
15
+ version: string;
16
+ chainId: number;
17
+ verifyingContract: string;
18
+ };
19
+ types: {
20
+ PaymentV1: typeof PAYMENT_KIND.eip712Fields;
21
+ SolMemo: typeof SOL_MEMO_FIELDS;
22
+ };
23
+ primaryType: 'PaymentV1';
24
+ message: {
25
+ chainId: number;
26
+ nonce: number;
27
+ recipient: string;
28
+ value: string;
29
+ token: string;
30
+ memo: {
31
+ memoType: string;
32
+ memoFormat: string;
33
+ memoData: string;
34
+ };
35
+ };
36
+ }
37
+ export interface PreparedTypedTx {
38
+ kind: string;
39
+ primaryType: string;
40
+ typedData: PaymentEip712TypedData;
41
+ encodeCalldata: (sig: Eip712Signature) => {
42
+ to: string;
43
+ data: ZeroXString;
44
+ value: bigint;
45
+ gas: bigint;
46
+ gasPrice: bigint;
47
+ type: 'legacy';
48
+ };
49
+ }
50
+ export declare function buildPaymentEip712TypedData(input: PaymentTypedTxInput): PaymentEip712TypedData;
51
+ export declare function preparePaymentTypedTx(input: PaymentTypedTxInput): PreparedTypedTx;
@@ -0,0 +1,22 @@
1
+ import type { ZeroXString } from '../../utils/index.js';
2
+ export declare const EIP712_VERIFYING_CONTRACT: "0xfffffffffffffffffffffffffffffffffffffffe";
3
+ export declare const EIP712_DOMAIN_NAME = "1Money Network";
4
+ export declare const EIP712_DOMAIN_VERSION = "1";
5
+ export interface Eip712Signature {
6
+ v: 27 | 28;
7
+ r: ZeroXString;
8
+ s: ZeroXString;
9
+ }
10
+ export interface Eip712TypeField {
11
+ name: string;
12
+ type: string;
13
+ }
14
+ export interface KindSpec {
15
+ abiName: string;
16
+ discriminant: number;
17
+ primaryType: string;
18
+ eip712Fields: Eip712TypeField[];
19
+ abiParams: string;
20
+ }
21
+ export declare const SOL_MEMO_FIELDS: Eip712TypeField[];
22
+ export declare const PAYMENT_KIND: KindSpec;
@@ -2,6 +2,7 @@ import { preparePaymentTx, prepareTokenAuthorityTx, prepareTokenBridgeAndMintTx,
2
2
  export * from './builders';
3
3
  export * from './core';
4
4
  export * from './signer';
5
+ export * from './eip712';
5
6
  export declare const TransactionBuilder: {
6
7
  payment: typeof preparePaymentTx;
7
8
  tokenManageList: typeof prepareTokenManageListTx;
package/lib/index.js CHANGED
@@ -2210,6 +2210,82 @@ function createPrivateKeySigner(privateKey) {
2210
2210
  });
2211
2211
  }); },
2212
2212
  };
2213
+ }var EIP712_VERIFYING_CONTRACT = '0xfffffffffffffffffffffffffffffffffffffffe';
2214
+ var EIP712_DOMAIN_NAME = '1Money Network';
2215
+ var EIP712_DOMAIN_VERSION = '1';
2216
+ var SOL_MEMO_FIELDS = [
2217
+ { name: 'memoType', type: 'string' },
2218
+ { name: 'memoFormat', type: 'string' },
2219
+ { name: 'memoData', type: 'string' },
2220
+ ];
2221
+ // One entry per Eip712PayloadKind. Only payment populated today; append more later.
2222
+ // Mirrors l1client erc20_abi.rs (ABI TransferV1) + eip712_typed.rs (EIP-712 PaymentV1).
2223
+ var PAYMENT_KIND = {
2224
+ abiName: 'TransferV1',
2225
+ discriminant: 0,
2226
+ primaryType: 'PaymentV1',
2227
+ eip712Fields: [
2228
+ { name: 'chainId', type: 'uint64' },
2229
+ { name: 'nonce', type: 'uint64' },
2230
+ { name: 'recipient', type: 'address' },
2231
+ { name: 'value', type: 'uint256' },
2232
+ { name: 'token', type: 'address' },
2233
+ { name: 'memo', type: 'SolMemo' },
2234
+ ],
2235
+ abiParams: '(uint64,uint64,address,uint256,address,(string,string,string))',
2236
+ };// Parse a 0x 65-byte secp256k1 sig (eth_signTypedData_v4 output) into {v,r,s}.
2237
+ // l1client requires v ∈ {27,28} and rejects 0/1 at ingest; normalize 0→27,1→28.
2238
+ function parseSig(hex65) {
2239
+ var stripped = hex65.startsWith('0x') ? hex65.slice(2) : hex65;
2240
+ if (stripped.length !== 130) {
2241
+ throw new Error("[1Money SDK]: expected 65-byte signature, got ".concat(stripped.length / 2, " bytes"));
2242
+ }
2243
+ var r = "0x".concat(stripped.slice(0, 64));
2244
+ var s = "0x".concat(stripped.slice(64, 128));
2245
+ var vByte = parseInt(stripped.slice(128, 130), 16);
2246
+ var v;
2247
+ if (vByte === 27 || vByte === 0)
2248
+ v = 27;
2249
+ else if (vByte === 28 || vByte === 1)
2250
+ v = 28;
2251
+ else
2252
+ throw new Error("[1Money SDK]: unexpected signature v byte: 0x".concat(vByte.toString(16)));
2253
+ return { v: v, r: r, s: s };
2254
+ }var SUBMIT_TYPED_DATA_ABI = [{
2255
+ type: 'function', name: 'submitTypedData',
2256
+ inputs: [{ name: 'envelope', type: 'tuple', components: [
2257
+ { name: 'kind', type: 'uint8' }, { name: 'payload', type: 'bytes' },
2258
+ { name: 'v', type: 'uint8' }, { name: 'r', type: 'bytes32' }, { name: 's', type: 'bytes32' },
2259
+ ] }], outputs: [],
2260
+ }];
2261
+ function buildPaymentEip712TypedData(input) {
2262
+ var _a, _b, _c, _d, _e, _f;
2263
+ if (input.memo)
2264
+ validateMemo(input.memo);
2265
+ return {
2266
+ domain: { name: EIP712_DOMAIN_NAME, version: EIP712_DOMAIN_VERSION, chainId: input.chain_id, verifyingContract: EIP712_VERIFYING_CONTRACT },
2267
+ types: { PaymentV1: PAYMENT_KIND.eip712Fields, SolMemo: SOL_MEMO_FIELDS },
2268
+ primaryType: 'PaymentV1',
2269
+ message: {
2270
+ chainId: input.chain_id, nonce: input.nonce, recipient: input.recipient, value: input.value, token: input.token,
2271
+ memo: { memoType: (_b = (_a = input.memo) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : '', memoFormat: (_d = (_c = input.memo) === null || _c === void 0 ? void 0 : _c.format) !== null && _d !== void 0 ? _d : '', memoData: (_f = (_e = input.memo) === null || _e === void 0 ? void 0 : _e.data) !== null && _f !== void 0 ? _f : '' },
2272
+ },
2273
+ };
2274
+ }
2275
+ function preparePaymentTypedTx(input) {
2276
+ var typedData = buildPaymentEip712TypedData(input);
2277
+ var memo = typedData.message.memo;
2278
+ var encodeCalldata = function (sig) {
2279
+ if (sig.v !== 27 && sig.v !== 28)
2280
+ throw new Error("[1Money SDK]: EIP-712 v must be 27 or 28, got ".concat(sig.v));
2281
+ var payload = viem.encodeAbiParameters(viem.parseAbiParameters(PAYMENT_KIND.abiParams), [[
2282
+ BigInt(input.chain_id), BigInt(input.nonce), input.recipient, BigInt(input.value), input.token,
2283
+ [memo.memoType, memo.memoFormat, memo.memoData],
2284
+ ]]);
2285
+ var data = viem.encodeFunctionData({ abi: SUBMIT_TYPED_DATA_ABI, functionName: 'submitTypedData', args: [{ kind: PAYMENT_KIND.discriminant, payload: payload, v: sig.v, r: sig.r, s: sig.s }] });
2286
+ return { to: input.token, data: data, value: 0n, gas: 21000n, gasPrice: 0n, type: 'legacy' };
2287
+ };
2288
+ return { kind: PAYMENT_KIND.abiName, primaryType: PAYMENT_KIND.primaryType, typedData: typedData, encodeCalldata: encodeCalldata };
2213
2289
  }var TransactionBuilder = {
2214
2290
  payment: preparePaymentTx,
2215
2291
  tokenManageList: prepareTokenManageListTx,
@@ -2225,4 +2301,4 @@ function createPrivateKeySigner(privateKey) {
2225
2301
  };var index = {
2226
2302
  api: api,
2227
2303
  client: client$1,
2228
- };exports.MEMO_DATA_MAX_BYTES=MEMO_DATA_MAX_BYTES;exports.MEMO_FORMAT_MAX_BYTES=MEMO_FORMAT_MAX_BYTES;exports.MEMO_RLP_HEADER_ALLOWANCE=MEMO_RLP_HEADER_ALLOWANCE;exports.MEMO_TOTAL_MAX_BYTES=MEMO_TOTAL_MAX_BYTES;exports.MEMO_TYPE_MAX_BYTES=MEMO_TYPE_MAX_BYTES;exports.MemoValidationError=MemoValidationError;exports.TransactionBuilder=TransactionBuilder;exports._typeof=_typeof;exports.api=api;exports.calcSignedTxHash=calcSignedTxHash;exports.calcTxHash=calcTxHash;exports.client=client$1;exports.createPreparedTx=createPreparedTx;exports.createPrivateKeySigner=createPrivateKeySigner;exports.default=index;exports.deriveTokenAddress=deriveTokenAddress;exports.encodePayload=encodePayload;exports.encodeRlpPayload=encodeRlpPayload;exports.memoRlpList=memoRlpList;exports.preparePaymentTx=preparePaymentTx;exports.prepareTokenAuthorityTx=prepareTokenAuthorityTx;exports.prepareTokenBridgeAndMintTx=prepareTokenBridgeAndMintTx;exports.prepareTokenBurnAndBridgeTx=prepareTokenBurnAndBridgeTx;exports.prepareTokenBurnTx=prepareTokenBurnTx;exports.prepareTokenClawbackTx=prepareTokenClawbackTx;exports.prepareTokenIssueTx=prepareTokenIssueTx;exports.prepareTokenManageListTx=prepareTokenManageListTx;exports.prepareTokenMetadataTx=prepareTokenMetadataTx;exports.prepareTokenMintTx=prepareTokenMintTx;exports.prepareTokenPauseTx=prepareTokenPauseTx;exports.rlpValue=rlpValue;exports.safePromiseAll=safePromiseAll;exports.safePromiseLine=safePromiseLine;exports.signMessage=signMessage;exports.toHex=toHex;exports.validateMemo=validateMemo;
2304
+ };exports.EIP712_DOMAIN_NAME=EIP712_DOMAIN_NAME;exports.EIP712_DOMAIN_VERSION=EIP712_DOMAIN_VERSION;exports.EIP712_VERIFYING_CONTRACT=EIP712_VERIFYING_CONTRACT;exports.MEMO_DATA_MAX_BYTES=MEMO_DATA_MAX_BYTES;exports.MEMO_FORMAT_MAX_BYTES=MEMO_FORMAT_MAX_BYTES;exports.MEMO_RLP_HEADER_ALLOWANCE=MEMO_RLP_HEADER_ALLOWANCE;exports.MEMO_TOTAL_MAX_BYTES=MEMO_TOTAL_MAX_BYTES;exports.MEMO_TYPE_MAX_BYTES=MEMO_TYPE_MAX_BYTES;exports.MemoValidationError=MemoValidationError;exports.PAYMENT_KIND=PAYMENT_KIND;exports.SOL_MEMO_FIELDS=SOL_MEMO_FIELDS;exports.TransactionBuilder=TransactionBuilder;exports._typeof=_typeof;exports.api=api;exports.buildPaymentEip712TypedData=buildPaymentEip712TypedData;exports.calcSignedTxHash=calcSignedTxHash;exports.calcTxHash=calcTxHash;exports.client=client$1;exports.createPreparedTx=createPreparedTx;exports.createPrivateKeySigner=createPrivateKeySigner;exports.default=index;exports.deriveTokenAddress=deriveTokenAddress;exports.encodePayload=encodePayload;exports.encodeRlpPayload=encodeRlpPayload;exports.memoRlpList=memoRlpList;exports.parseSig=parseSig;exports.preparePaymentTx=preparePaymentTx;exports.preparePaymentTypedTx=preparePaymentTypedTx;exports.prepareTokenAuthorityTx=prepareTokenAuthorityTx;exports.prepareTokenBridgeAndMintTx=prepareTokenBridgeAndMintTx;exports.prepareTokenBurnAndBridgeTx=prepareTokenBurnAndBridgeTx;exports.prepareTokenBurnTx=prepareTokenBurnTx;exports.prepareTokenClawbackTx=prepareTokenClawbackTx;exports.prepareTokenIssueTx=prepareTokenIssueTx;exports.prepareTokenManageListTx=prepareTokenManageListTx;exports.prepareTokenMetadataTx=prepareTokenMetadataTx;exports.prepareTokenMintTx=prepareTokenMintTx;exports.prepareTokenPauseTx=prepareTokenPauseTx;exports.rlpValue=rlpValue;exports.safePromiseAll=safePromiseAll;exports.safePromiseLine=safePromiseLine;exports.signMessage=signMessage;exports.toHex=toHex;exports.validateMemo=validateMemo;
@@ -0,0 +1,3 @@
1
+ export * from './registry';
2
+ export * from './parseSig';
3
+ export * from './preparePaymentTypedTx';
@@ -0,0 +1,2 @@
1
+ import type { Eip712Signature } from './registry';
2
+ export declare function parseSig(hex65: string): Eip712Signature;
@@ -0,0 +1,51 @@
1
+ import { PAYMENT_KIND, SOL_MEMO_FIELDS } from './registry';
2
+ import type { Memo, ZeroXString } from '../../utils/index.js';
3
+ import type { Eip712Signature } from './registry';
4
+ export interface PaymentTypedTxInput {
5
+ chain_id: number;
6
+ nonce: number;
7
+ recipient: string;
8
+ value: string;
9
+ token: string;
10
+ memo?: Memo;
11
+ }
12
+ export interface PaymentEip712TypedData {
13
+ domain: {
14
+ name: string;
15
+ version: string;
16
+ chainId: number;
17
+ verifyingContract: string;
18
+ };
19
+ types: {
20
+ PaymentV1: typeof PAYMENT_KIND.eip712Fields;
21
+ SolMemo: typeof SOL_MEMO_FIELDS;
22
+ };
23
+ primaryType: 'PaymentV1';
24
+ message: {
25
+ chainId: number;
26
+ nonce: number;
27
+ recipient: string;
28
+ value: string;
29
+ token: string;
30
+ memo: {
31
+ memoType: string;
32
+ memoFormat: string;
33
+ memoData: string;
34
+ };
35
+ };
36
+ }
37
+ export interface PreparedTypedTx {
38
+ kind: string;
39
+ primaryType: string;
40
+ typedData: PaymentEip712TypedData;
41
+ encodeCalldata: (sig: Eip712Signature) => {
42
+ to: string;
43
+ data: ZeroXString;
44
+ value: bigint;
45
+ gas: bigint;
46
+ gasPrice: bigint;
47
+ type: 'legacy';
48
+ };
49
+ }
50
+ export declare function buildPaymentEip712TypedData(input: PaymentTypedTxInput): PaymentEip712TypedData;
51
+ export declare function preparePaymentTypedTx(input: PaymentTypedTxInput): PreparedTypedTx;
@@ -0,0 +1,22 @@
1
+ import type { ZeroXString } from '../../utils/index.js';
2
+ export declare const EIP712_VERIFYING_CONTRACT: "0xfffffffffffffffffffffffffffffffffffffffe";
3
+ export declare const EIP712_DOMAIN_NAME = "1Money Network";
4
+ export declare const EIP712_DOMAIN_VERSION = "1";
5
+ export interface Eip712Signature {
6
+ v: 27 | 28;
7
+ r: ZeroXString;
8
+ s: ZeroXString;
9
+ }
10
+ export interface Eip712TypeField {
11
+ name: string;
12
+ type: string;
13
+ }
14
+ export interface KindSpec {
15
+ abiName: string;
16
+ discriminant: number;
17
+ primaryType: string;
18
+ eip712Fields: Eip712TypeField[];
19
+ abiParams: string;
20
+ }
21
+ export declare const SOL_MEMO_FIELDS: Eip712TypeField[];
22
+ export declare const PAYMENT_KIND: KindSpec;
@@ -2,6 +2,7 @@ import { preparePaymentTx, prepareTokenAuthorityTx, prepareTokenBridgeAndMintTx,
2
2
  export * from './builders';
3
3
  export * from './core';
4
4
  export * from './signer';
5
+ export * from './eip712';
5
6
  export declare const TransactionBuilder: {
6
7
  payment: typeof preparePaymentTx;
7
8
  tokenManageList: typeof prepareTokenManageListTx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1money/protocol-ts-sdk",
3
- "version": "2.1.0-beta.0",
3
+ "version": "2.1.0-beta.1",
4
4
  "description": "ts sdk for 1Money protocol network",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).$1money={})}(this,function(e){"use strict";function t(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})}function n(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function r(e){return n(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}"function"==typeof SuppressedError&&SuppressedError;const i="2.30.0";let o=({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,s=`viem@${i}`;class a extends Error{constructor(e,t={}){const n=t.cause instanceof a?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof a&&t.cause.docsPath||t.docsPath,u=o?.({...t,docsPath:r});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...u?[`Docs: ${u}`]:[],...n?[`Details: ${n}`]:[],...s?[`Version: ${s}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=i}walk(e){return u(this,e)}}function u(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?u(e.cause,t):t?null:e}class c extends a{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function l(e,{dir:t,size:n=32}={}){return"string"==typeof e?function(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new c({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new c({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const o="right"===t;r[o?i:n-i-1]=e[o?i:e.length-i-1]}return r}(e,{dir:t,size:n})}class f extends a{constructor({max:e,min:t,signed:n,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class d extends a{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function h(e,{size:t}){if(r(e)>t)throw new d({givenSize:r(e),maxSize:t})}const p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function g(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(h(n,{size:t.size}),l(n,{size:t.size})):n}function y(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=p[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(h(r,{size:t.size}),l(r,{dir:"right",size:t.size})):r}function m(e,t={}){const{signed:n,size:r}=t,i=BigInt(e);let o;r?o=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(o=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof o&&n?-o-1n:0;if(o&&i>o||i<s){const t="bigint"==typeof e?"n":"";throw new f({max:o?`${o}${t}`:void 0,min:`${s}${t}`,signed:n,size:r,value:`${e}${t}`})}const a=`0x${(n&&i<0?(1n<<BigInt(8*r))+BigInt(i):i).toString(16)}`;return r?l(a,{size:r}):a}const b=new TextEncoder;function w(e,t={}){return y(b.encode(e),t)}const v=new TextEncoder;function E(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=m(e,t);return O(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return h(n,{size:t.size}),l(n,{size:t.size});return n}(e,t):n(e)?O(e,t):R(e,t)}const A={zero:48,nine:57,A:65,F:70,a:97,f:102};function _(e){return e>=A.zero&&e<=A.nine?e-A.zero:e>=A.A&&e<=A.F?e-(A.A-10):e>=A.a&&e<=A.f?e-(A.a-10):void 0}function O(e,t={}){let n=e;t.size&&(h(n,{size:t.size}),n=l(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,o=new Uint8Array(i);for(let e=0,t=0;e<i;e++){const n=_(r.charCodeAt(t++)),i=_(r.charCodeAt(t++));if(void 0===n||void 0===i)throw new a(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);o[e]=16*n+i}return o}function R(e,t={}){const n=v.encode(e);return"number"==typeof t.size?(h(n,{size:t.size}),l(n,{dir:"right",size:t.size})):n}function S(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function T(e,...t){if(!((n=e)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function x(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const k=BigInt(2**32-1),P=BigInt(32);function U(e,t=!1){return t?{h:Number(e&k),l:Number(e>>P&k)}:{h:0|Number(e>>P&k),l:0|Number(e&k)}}function B(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=U(e[i],t);[n[i],r[i]]=[o,s]}return[n,r]}const C=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function j(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function L(e){for(let t=0;t<e.length;t++)e[t]=j(e[t])}function M(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),T(e),e}"function"==typeof Uint8Array.from([]).toHex&&Uint8Array.fromHex;class F{clone(){return this._cloneInto()}}const N=[],I=[],$=[],D=BigInt(0),z=BigInt(1),q=BigInt(2),H=BigInt(7),Y=BigInt(256),K=BigInt(113);for(let e=0,t=z,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],N.push(2*(5*r+n)),I.push((e+1)*(e+2)/2%64);let i=D;for(let e=0;e<7;e++)t=(t<<z^(t>>H)*K)%Y,t&q&&(i^=z<<(z<<BigInt(e))-z);$.push(i)}const[V,W]=B($,!0),J=(e,t,n)=>n>32?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),X=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class G extends F{constructor(e,t,n,r=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,S(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).$1money={})}(this,function(e){"use strict";function t(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;let n=class e extends Error{constructor(t,n={}){const r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,i=n.cause instanceof e&&n.cause.docsPath||n.docsPath;super([t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...r?[`Details: ${r}`]:[],"Version: abitype@1.0.8"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=t}};function r(e,t){const n=e.exec(t);return n?.groups}const i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,o=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,s=/^\(.+?\).*?$/,a=/^tuple(?<array>(\[(\d*)\])*)$/;function u(e){let t=e.type;if(a.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){t+=u(e.components[r]),r<n-1&&(t+=", ")}const i=r(a,e.type);return t+=`)${i?.array??""}`,u({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function c(e){let t="";const n=e.length;for(let r=0;r<n;r++){t+=u(e[r]),r!==n-1&&(t+=", ")}return t}const l=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function f(e){return l.test(e)}function d(e){return r(l,e)}const h=new Set(["memory","indexed","storage","calldata"]),p=new Set(["calldata","memory","storage"]);class g extends n{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class y extends n{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class m extends n{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class b extends n{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class w extends n{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class v extends n{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class E extends n{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class A extends n{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class O extends n{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class _ extends n{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class x extends n{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class R extends n{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}const S=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),T=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,P=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,k=/^u?int$/;function $(e,t){const n=function(e,t,n){let r="";if(n)for(const e of Object.entries(n)){if(!e)continue;let t="";for(const n of e[1])t+=`[${n.type}${n.name?`:${n.name}`:""}]`;r+=`(${e[0]}{${t}})`}return t?`${t}:${e}${r}`:e}(e,t?.type,t?.structs);if(S.has(n))return S.get(n);const a=s.test(e),u=r(a?P:T,e);if(!u)throw new b({param:e});if(u.name&&function(e){return"address"===e||"bool"===e||"function"===e||"string"===e||"tuple"===e||i.test(e)||o.test(e)||C.test(e)}(u.name))throw new w({param:e,name:u.name});const c=u.name?{name:u.name}:{},l="indexed"===u.modifier?{indexed:!0}:{},f=t?.structs??{};let d,h={};if(a){d="tuple";const e=B(u.type),t=[],n=e.length;for(let r=0;r<n;r++)t.push($(e[r],{structs:f}));h={components:t}}else if(u.type in f)d="tuple",h={components:f[u.type]};else if(k.test(u.type))d=`${u.type}256`;else if(d=u.type,"struct"!==t?.type&&!U(d))throw new y({type:d});if(u.modifier){if(!t?.modifiers?.has?.(u.modifier))throw new v({param:e,type:t?.type,modifier:u.modifier});if(p.has(u.modifier)&&!function(e,t){return t||"bytes"===e||"string"===e||"tuple"===e}(d,!!u.array))throw new E({param:e,type:t?.type,modifier:u.modifier})}const g={type:`${d}${u.array??""}`,...c,...l,...h};return S.set(n,g),g}function B(e,t=[],n="",r=0){const i=e.trim().length;for(let o=0;o<i;o++){const i=e[o],s=e.slice(o+1);switch(i){case",":return 0===r?B(s,[...t,n.trim()]):B(s,t,`${n}${i}`,r);case"(":return B(s,t,`${n}${i}`,r+1);case")":return B(s,t,`${n}${i}`,r-1);default:return B(s,t,`${n}${i}`,r)}}if(""===n)return t;if(0!==r)throw new R({current:n,depth:r});return t.push(n.trim()),t}function U(e){return"address"===e||"bool"===e||"function"===e||"string"===e||i.test(e)||o.test(e)}const C=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;const I=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function j(e,t,n=new Set){const i=[],o=e.length;for(let a=0;a<o;a++){const o=e[a];if(s.test(o.type))i.push(o);else{const e=r(I,o.type);if(!e?.type)throw new A({abiParameter:o});const{array:s,type:a}=e;if(a in t){if(n.has(a))throw new x({type:a});i.push({...o,type:`tuple${s??""}`,components:j(t[a]??[],t,new Set([...n,a]))})}else{if(!U(a))throw new g({type:a});i.push(o)}}}return i}function M(e){const t=[];if("string"==typeof e){const n=B(e),r=n.length;for(let e=0;e<r;e++)t.push($(n[e],{modifiers:h}))}else{const n=function(e){const t={},n=e.length;for(let r=0;r<n;r++){const n=e[r];if(!f(n))continue;const i=d(n);if(!i)throw new O({signature:n,type:"struct"});const o=i.properties.split(";"),s=[],a=o.length;for(let e=0;e<a;e++){const t=o[e].trim();if(!t)continue;const n=$(t,{type:"struct"});s.push(n)}if(!s.length)throw new _({signature:n});t[i.name]=s}const r={},i=Object.entries(t),o=i.length;for(let e=0;e<o;e++){const[n,o]=i[e];r[n]=j(o,t)}return r}(e),r=e.length;for(let i=0;i<r;i++){const r=e[i];if(f(r))continue;const o=B(r),s=o.length;for(let e=0;e<s;e++)t.push($(o[e],{modifiers:h,structs:n}))}}if(0===t.length)throw new m({params:e});return t}function N(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new ee(e.type);return`${e.name}(${L(e.inputs,{includeName:t})})`}function L(e,{includeName:t=!1}={}){return e?e.map(e=>function(e,{includeName:t}){if(e.type.startsWith("tuple"))return`(${L(e.components,{includeName:t})})${e.type.slice(5)}`;return e.type+(t&&e.name?` ${e.name}`:"")}(e,{includeName:t})).join(t?", ":","):""}function F(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function D(e){return F(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const z="2.30.0";let q=({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,H=`viem@${z}`;class Y extends Error{constructor(e,t={}){const n=t.cause instanceof Y?t.cause.details:t.cause?.message?t.cause.message:t.details,r=t.cause instanceof Y&&t.cause.docsPath||t.docsPath,i=q?.({...t,docsPath:r});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...n?[`Details: ${n}`]:[],...H?[`Version: ${H}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=r,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=z}walk(e){return V(this,e)}}function V(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?V(e.cause,t):t?null:e}class W extends Y{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join("\n"),{name:"AbiEncodingArrayLengthMismatchError"})}}class K extends Y{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${D(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class J extends Y{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join("\n"),{name:"AbiEncodingLengthMismatchError"})}}class X extends Y{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join("\n"),{docsPath:t,name:"AbiFunctionNotFoundError"})}}class G extends Y{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${N(e.abiItem)}\`, and`,`\`${t.type}\` in \`${N(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class Z extends Y{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join("\n"),{docsPath:t,name:"InvalidAbiEncodingType"})}}class Q extends Y{constructor(e){super([`Value "${e}" is not a valid array.`].join("\n"),{name:"InvalidArrayError"})}}class ee extends Y{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join("\n"),{name:"InvalidDefinitionTypeError"})}}class te extends Y{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class ne extends Y{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function re(e,{dir:t,size:n=32}={}){return"string"==typeof e?ie(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new ne({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const o="right"===t;r[o?i:n-i-1]=e[o?i:e.length-i-1]}return r}(e,{dir:t,size:n})}function ie(e,{dir:t,size:n=32}={}){if(null===n)return e;const r=e.replace("0x","");if(r.length>2*n)throw new ne({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}class oe extends Y{constructor({max:e,min:t,signed:n,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class se extends Y{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function ae(e,{size:t}){if(D(e)>t)throw new se({givenSize:D(e),maxSize:t})}const ue=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ce(e,t={}){const n=`0x${Number(e)}`;return"number"==typeof t.size?(ae(n,{size:t.size}),re(n,{size:t.size})):n}function le(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=ue[e[t]];const r=`0x${n}`;return"number"==typeof t.size?(ae(r,{size:t.size}),re(r,{dir:"right",size:t.size})):r}function fe(e,t={}){const{signed:n,size:r}=t,i=BigInt(e);let o;r?o=n?(1n<<8n*BigInt(r)-1n)-1n:2n**(8n*BigInt(r))-1n:"number"==typeof e&&(o=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof o&&n?-o-1n:0;if(o&&i>o||i<s){const t="bigint"==typeof e?"n":"";throw new oe({max:o?`${o}${t}`:void 0,min:`${s}${t}`,signed:n,size:r,value:`${e}${t}`})}const a=`0x${(n&&i<0?(1n<<BigInt(8*r))+BigInt(i):i).toString(16)}`;return r?re(a,{size:r}):a}const de=new TextEncoder;function he(e,t={}){return le(de.encode(e),t)}const pe=new TextEncoder;function ge(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=fe(e,t);return be(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return ae(n,{size:t.size}),re(n,{size:t.size});return n}(e,t):F(e)?be(e,t):we(e,t)}const ye={zero:48,nine:57,A:65,F:70,a:97,f:102};function me(e){return e>=ye.zero&&e<=ye.nine?e-ye.zero:e>=ye.A&&e<=ye.F?e-(ye.A-10):e>=ye.a&&e<=ye.f?e-(ye.a-10):void 0}function be(e,t={}){let n=e;t.size&&(ae(n,{size:t.size}),n=re(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,o=new Uint8Array(i);for(let e=0,t=0;e<i;e++){const n=me(r.charCodeAt(t++)),i=me(r.charCodeAt(t++));if(void 0===n||void 0===i)throw new Y(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);o[e]=16*n+i}return o}function we(e,t={}){const n=pe.encode(e);return"number"==typeof t.size?(ae(n,{size:t.size}),re(n,{dir:"right",size:t.size})):n}function ve(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ee(e,...t){if(!((n=e)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name))throw new Error("Uint8Array expected");var n;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Ae(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const Oe=BigInt(2**32-1),_e=BigInt(32);function xe(e,t=!1){return t?{h:Number(e&Oe),l:Number(e>>_e&Oe)}:{h:0|Number(e>>_e&Oe),l:0|Number(e&Oe)}}function Re(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=xe(e[i],t);[n[i],r[i]]=[o,s]}return[n,r]}const Se=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function Te(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Pe(e){for(let t=0;t<e.length;t++)e[t]=Te(e[t])}function ke(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),Ee(e),e}"function"==typeof Uint8Array.from([]).toHex&&Uint8Array.fromHex;class $e{clone(){return this._cloneInto()}}const Be=[],Ue=[],Ce=[],Ie=BigInt(0),je=BigInt(1),Me=BigInt(2),Ne=BigInt(7),Le=BigInt(256),Fe=BigInt(113);for(let e=0,t=je,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Be.push(2*(5*r+n)),Ue.push((e+1)*(e+2)/2%64);let i=Ie;for(let e=0;e<7;e++)t=(t<<je^(t>>Ne)*Fe)%Le,t&Me&&(i^=je<<(je<<BigInt(e))-je);Ce.push(i)}const[De,ze]=Re(Ce,!0),qe=(e,t,n)=>n>32?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),He=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class Ye extends $e{constructor(e,t,n,r=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=i,ve(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");
2
2
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
3
- var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}keccak(){C||L(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,i=(t+2)%10,o=n[i],s=n[i+1],a=J(o,s,1)^n[r],u=X(o,s,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=a,e[t+n+1]^=u}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=I[n],o=J(t,i,r),s=X(t,i,r),a=N[n];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=V[r],e[1]^=W[r]}n.fill(0)}(this.state32,this.rounds),C||L(this.state32),this.posOut=0,this.pos=0}update(e){x(this);const{blockLen:t,state:n}=this,r=(e=M(e)).length;for(let i=0;i<r;){const o=Math.min(t-this.pos,r-i);for(let t=0;t<o;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){x(this,!1),T(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return S(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(function(e,t){T(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new G(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Z=((e,t,n)=>function(e){const t=t=>e().update(M(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}(()=>new G(t,e,n)))(1,136,32);function Q(e,t){const r=t||"hex",i=Z(n(e,{strict:!1})?E(e):e);return"bytes"===r?i:function(e,t={}){return"number"==typeof e||"bigint"==typeof e?m(e,t):"string"==typeof e?w(e,t):"boolean"==typeof e?g(e,t):y(e,t)}(i)}class ee extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const te=new ee(8192);const ne=/^0x[a-fA-F0-9]{40}$/,re=new ee(8192);function ie(e,t){const{strict:n=!0}={},r=`${e}.${n}`;if(re.has(r))return re.get(r);const i=!(!ne.test(e)||e.toLowerCase()!==e&&n&&function(e,t){if(te.has(`${e}.${t}`))return te.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Q(R(n),"bytes"),i=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&r[e>>1])>=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());const o=`0x${i.join("")}`;return te.set(`${e}.${t}`,o),o}(e)!==e);return re.set(r,i),i}class oe extends Error{constructor(e,t,n){super(t??e.code),this.type=e,void 0!==n&&(this.stack=n)}getMetadata(){return this.type}toObject(){return{type:this.getMetadata(),message:this.message??"",stack:this.stack??"",className:this.constructor.name}}}function se(e,t){return new oe({code:"ETHEREUMJS_DEFAULT_ERROR_CODE"},e,t)}function ae(e){if(0===e[0])throw se("invalid RLP: extra zeros");return function(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw se("Invalid byte sequence");return t}(function(e){let t="";for(let n=0;n<e.length;n++)t+=fe[e[n]];return t}(e))}function ue(e,t){if(e<56)return Uint8Array.from([e+t]);const n=ye(e),r=ye(t+55+n.length/2);return Uint8Array.from(pe(r+n))}function ce(e,t,n){if(n>e.length)throw se("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,n)}function le(e){let t,n,r,i,o;const s=[],a=e[0];if(a<=127)return{data:e.slice(0,1),remainder:e.subarray(1)};if(a<=183){if(t=a-127,r=128===a?Uint8Array.from([]):ce(e,1,t),2===t&&r[0]<128)throw se("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:r,remainder:e.subarray(t)}}if(a<=191){if(n=a-182,e.length-1<n)throw se("invalid RLP: not enough bytes for string length");if(t=ae(ce(e,1,n)),t<=55)throw se("invalid RLP: expected string length to be greater than 55");return r=ce(e,n,t+n),{data:r,remainder:e.subarray(t+n)}}if(a<=247){for(t=a-191,i=ce(e,1,t);i.length;)o=le(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.subarray(t)}}{if(n=a-246,t=ae(ce(e,1,n)),t<56)throw se("invalid RLP: encoded list too short");const r=n+t;if(r>e.length)throw se("invalid RLP: total length is larger than the data");for(i=ce(e,n,r);i.length;)o=le(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.subarray(r)}}}const fe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const de={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function he(e){return e>=de._0&&e<=de._9?e-de._0:e>=de._A&&e<=de._F?e-(de._A-10):e>=de._a&&e<=de._f?e-(de._a-10):void 0}function pe(e){if("0x"===e.slice(0,2)&&(e=e.slice(0,2)),"string"!=typeof e)throw se("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw se("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=he(e.charCodeAt(i)),o=he(e.charCodeAt(i+1));if(void 0===n||void 0===o){throw se('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i)}r[t]=16*n+o}return r}function ge(...e){if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}function ye(e){if(e<0)throw se("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function me(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function be(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return me(e)?pe((n="string"!=typeof(r=e)?r:me(r)?r.slice(2):r).length%2?`0${n}`:n):(t=e,(new TextEncoder).encode(t));var t,n,r;if("number"==typeof e||"bigint"==typeof e)return e?pe(ye(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw se("toBytes: received unsupported type "+typeof e)}function we(e){if(Array.isArray(e)){const t=[];let n=0;for(let r=0;r<e.length;r++){const i=we(e[r]);t.push(i),n+=i.length}return ge(ue(n,192),...t)}const t=be(e);return 1===t.length&&t[0]<128?t:ge(ue(t.length,128),t)}function ve(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);const n=le(be(e));if(t)return{data:n.data,remainder:n.remainder.slice()};if(0!==n.remainder.length)throw se("invalid RLP: remainder must be zero");return n.data}const Ee=/^0x[0-9a-fA-F]{40}$/,Ae=/^0x([0-9a-fA-F]{2})*$/;function _e(e){if(null==e)return new Uint8Array([]);switch(e.kind){case"string":return(new TextEncoder).encode(e.value);case"uint":{if("string"==typeof e.value&&!/^\d+$/.test(e.value))throw new Error(`[1Money SDK]: Invalid uint string: ${e.value}`);const t="bigint"==typeof e.value?e.value:BigInt(e.value);return t===BigInt(0)?new Uint8Array([]):O(m(t))}case"bool":return e.value?Uint8Array.from([1]):new Uint8Array([]);case"bytes":return e.value;case"list":return e.value.map(e=>_e(e));case"address":case"hex":if(!Ae.test(e.value))throw new Error(`[1Money SDK]: Invalid hex value: ${e.value}`);if("address"===e.kind&&!Ee.test(e.value))throw new Error(`[1Money SDK]: Invalid address value: ${e.value}`);return"0x"===e.value?new Uint8Array([]):O(e.value)}}const Oe={address:e=>({kind:"address",value:e}),hex:e=>({kind:"hex",value:e}),string:e=>({kind:"string",value:e}),uint:e=>({kind:"uint",value:e}),bool:e=>({kind:"bool",value:e}),bytes:e=>({kind:"bytes",value:e}),list:e=>({kind:"list",value:e})};function Re(e){return we(_e(e))}class Se extends Error{constructor(e,t){super(t),this.code=e,this.name="MemoValidationError"}}const Te=new TextEncoder,xe=/^[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]*$/;function ke(e){return Te.encode(e).length}function Pe(e){var t,n,r;const i=null!==(t=e.type)&&void 0!==t?t:"";if(i.length>0){const e=ke(i);if(e>128)throw new Se("MEMO_TYPE_TOO_LONG",`memo.type exceeds 128 bytes (got ${e})`);if(!xe.test(i))throw new Se("MEMO_TYPE_INVALID_CHARS","memo.type contains non-URL-safe characters")}const o=null!==(n=e.format)&&void 0!==n?n:"";if(o.length>0){const e=ke(o);if(e>64)throw new Se("MEMO_FORMAT_TOO_LONG",`memo.format exceeds 64 bytes (got ${e})`);if(!xe.test(o))throw new Se("MEMO_FORMAT_INVALID_CHARS","memo.format contains non-URL-safe characters")}const s=null!==(r=e.data)&&void 0!==r?r:"";if(s.length>0){const e=ke(s);if(e>256)throw new Se("MEMO_DATA_TOO_LONG",`memo.data exceeds 256 bytes (got ${e})`);for(const e of s){const t=e.codePointAt(0);if(0===t||t<=31||t>=127&&t<=159||t>=55296&&t<=57343)throw new Se("MEMO_DATA_CONTROL_CHARS","memo.data contains null bytes or Unicode control/surrogate codepoints")}}const a=function(e){var t,n,r;return ke(null!==(t=e.type)&&void 0!==t?t:"")+ke(null!==(n=e.format)&&void 0!==n?n:"")+ke(null!==(r=e.data)&&void 0!==r?r:"")+16}(e);if(a>512)throw new Se("MEMO_TOO_LARGE",`memo object exceeds 512 bytes (got ${a})`)}function Ue(e){var t,n,r;return Oe.list([Oe.string(null!==(t=e.type)&&void 0!==t?t:""),Oe.string(null!==(n=e.format)&&void 0!==n?n:""),Oe.string(null!==(r=e.data)&&void 0!==r?r:"")])}/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
4
- const{p:Be,n:Ce,Gx:je,Gy:Le,b:Me}={p:0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,n:0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,b:7n,Gx:0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Gy:0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n},Fe=32,Ne=64,Ie=(e="")=>{throw new Error(e)},$e=e=>"bigint"==typeof e,De=e=>"string"==typeof e,ze=(e,t)=>!(e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name)(e)||"number"==typeof t&&t>0&&e.length!==t?Ie("Uint8Array expected"):e,qe=e=>new Uint8Array(e),He=(e,t)=>e.toString(16).padStart(t,"0"),Ye=e=>Array.from(ze(e)).map(e=>He(e,2)).join(""),Ke=48,Ve=57,We=65,Je=70,Xe=97,Ge=102,Ze=e=>e>=Ke&&e<=Ve?e-Ke:e>=We&&e<=Je?e-(We-10):e>=Xe&&e<=Ge?e-(Xe-10):void 0,Qe=e=>{const t="hex invalid";if(!De(e))return Ie(t);const n=e.length,r=n/2;if(n%2)return Ie(t);const i=qe(r);for(let n=0,o=0;n<r;n++,o+=2){const r=Ze(e.charCodeAt(o)),s=Ze(e.charCodeAt(o+1));if(void 0===r||void 0===s)return Ie(t);i[n]=16*r+s}return i},et=(e,t)=>{return ze(De(e)?Qe(e):(n=ze(e),Uint8Array.from(n)),t);var n},tt=()=>globalThis?.crypto,nt=(...e)=>{const t=qe(e.reduce((e,t)=>e+ze(t).length,0));let n=0;return e.forEach(e=>{t.set(e,n),n+=e.length}),t},rt=(e=Fe)=>tt().getRandomValues(qe(e)),it=BigInt,ot=(e,t,n,r="bad number: out of range")=>$e(e)&&t<=e&&e<n?e:Ie(r),st=(e,t=Be)=>{const n=e%t;return n>=0n?n:t+n},at=e=>st(e,Ce),ut=(e,t)=>{(0n===e||t<=0n)&&Ie("no inverse n="+e+" mod="+t);let n=st(e,t),r=t,i=0n,o=1n;for(;0n!==n;){const e=r%n,t=i-o*(r/n);r=n,n=e,i=o,o=t}return 1n===r?st(i,t):Ie("no inverse")},ct=e=>e instanceof mt?e:Ie("Point expected"),lt=e=>st(st(e*e)*e+Me),ft=e=>ot(e,0n,Be),dt=e=>ot(e,1n,Be),ht=e=>ot(e,1n,Ce),pt=e=>0n==(1n&e),gt=e=>Uint8Array.of(e),yt=e=>gt(pt(e)?2:3);class mt{static BASE;static ZERO;px;py;pz;constructor(e,t,n){this.px=ft(e),this.py=dt(t),this.pz=ft(n),Object.freeze(this)}static fromBytes(e){let t;ze(e);const n=e[0],r=e.subarray(1),i=Et(r,0,Fe),o=e.length;if(33===o&&[2,3].includes(n)){let e=(e=>{const t=lt(dt(e));let n=1n;for(let e=t,r=(Be+1n)/4n;r>0n;r>>=1n)1n&r&&(n=n*e%Be),e=e*e%Be;return st(n*n)===t?n:Ie("sqrt invalid")})(i);const r=pt(e);pt(it(n))!==r&&(e=st(-e)),t=new mt(i,e,1n)}return 65===o&&4===n&&(t=new mt(i,Et(r,Fe,Ne),1n)),t?t.assertValidity():Ie("bad point: not on curve")}equals(e){const{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=ct(e),a=st(t*s),u=st(i*r),c=st(n*s),l=st(o*r);return a===u&&c===l}is0(){return this.equals(wt)}negate(){return new mt(this.px,st(-this.py),this.pz)}double(){return this.add(this)}add(e){const{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=ct(e);let a=0n,u=0n,c=0n;const l=st(3n*Me);let f=st(t*i),d=st(n*o),h=st(r*s),p=st(t+n),g=st(i+o);p=st(p*g),g=st(f+d),p=st(p-g),g=st(t+r);let y=st(i+s);return g=st(g*y),y=st(f+h),g=st(g-y),y=st(n+r),a=st(o+s),y=st(y*a),a=st(d+h),y=st(y-a),c=st(0n*g),a=st(l*h),c=st(a+c),a=st(d-c),c=st(d+c),u=st(a*c),d=st(f+f),d=st(d+f),h=st(0n*h),g=st(l*g),d=st(d+h),h=st(f-h),h=st(0n*h),g=st(g+h),f=st(d*g),u=st(u+f),f=st(y*g),a=st(p*a),a=st(a-f),f=st(p*d),c=st(y*c),c=st(c+f),new mt(a,u,c)}multiply(e,t=!0){if(!t&&0n===e)return wt;if(ht(e),1n===e)return this;if(this.equals(bt))return Mt(e).p;let n=wt,r=bt;for(let i=this;e>0n;i=i.double(),e>>=1n)1n&e?n=n.add(i):t&&(r=r.add(i));return n}toAffine(){const{px:e,py:t,pz:n}=this;if(this.equals(wt))return{x:0n,y:0n};if(1n===n)return{x:e,y:t};const r=ut(n,Be);return 1n!==st(n*r)&&Ie("inverse invalid"),{x:st(e*r),y:st(t*r)}}assertValidity(){const{x:e,y:t}=this.toAffine();return dt(e),dt(t),st(t*t)===lt(e)?this:Ie("bad point: not on curve")}toBytes(e=!0){const{x:t,y:n}=this.assertValidity().toAffine(),r=_t(t);return e?nt(yt(n),r):nt(gt(4),r,_t(n))}static fromAffine(e){const{x:t,y:n}=e;return 0n===t&&0n===n?wt:new mt(t,n,1n)}toHex(e){return Ye(this.toBytes(e))}static fromPrivateKey(e){return bt.multiply(Ot(e))}static fromHex(e){return mt.fromBytes(et(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}toRawBytes(e){return this.toBytes(e)}}const bt=new mt(je,Le,1n),wt=new mt(0n,1n,0n);mt.BASE=bt,mt.ZERO=wt;const vt=e=>it("0x"+(Ye(e)||"0")),Et=(e,t,n)=>vt(e.subarray(t,n)),At=2n**256n,_t=e=>Qe(He(ot(e,0n,At),Ne)),Ot=e=>{const t=$e(e)?e:vt(et(e,Fe));return ot(t,1n,Ce,"private key invalid 3")},Rt=e=>e>Ce>>1n;class St{r;s;recovery;constructor(e,t,n){this.r=ht(e),this.s=ht(t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e){ze(e,Ne);const t=Et(e,0,Fe),n=Et(e,Fe,Ne);return new St(t,n)}toBytes(){const{r:e,s:t}=this;return nt(_t(e),_t(t))}addRecoveryBit(e){return new St(this.r,this.s,e)}hasHighS(){return Rt(this.s)}toCompactRawBytes(){return this.toBytes()}toCompactHex(){return Ye(this.toBytes())}recoverPublicKey(e){return Ut(this,e)}static fromCompact(e){return St.fromBytes(et(e,Ne))}assertValidity(){return this}normalizeS(){const{r:e,s:t,recovery:n}=this;return Rt(t)?new St(e,at(-t),n):this}}const Tt=e=>{const t=8*e.length-256;t>1024&&Ie("msg invalid");const n=vt(e);return t>0?n>>it(t):n},xt=e=>at(Tt(ze(e))),kt={lowS:!0},Pt=async(e,t,n=kt)=>{const{seed:r,k2sig:i}=((e,t,n=kt)=>{["der","recovered","canonical"].some(e=>e in n)&&Ie("option not supported");let{lowS:r,extraEntropy:i}=n;null==r&&(r=!0);const o=_t,s=xt(et(e)),a=o(s),u=Ot(t),c=[o(u),a];i&&c.push(!0===i?rt(Fe):et(i));const l=s;return{seed:nt(...c),k2sig:e=>{const t=Tt(e);if(!(1n<=t&&t<Ce))return;const n=bt.multiply(t).toAffine(),i=at(n.x);if(0n===i)return;const o=ut(t,Ce),s=at(o*at(l+at(u*i)));if(0n===s)return;let a=s,c=(n.x===i?0:2)|Number(1n&n.y);return r&&Rt(s)&&(a=at(-s),c^=1),new St(i,a,c)}}})(e,t,n),o=await(()=>{let e=qe(Fe),t=qe(Fe),n=0;const r=qe(0),i=()=>{e.fill(1),t.fill(0),n=0};{const o=(...n)=>Bt.hmacSha256Async(t,e,...n),s=async(n=r)=>{t=await o(gt(0),n),e=await o(),0!==n.length&&(t=await o(gt(1),n),e=await o())},a=async()=>(n++>=1e3&&Ie("drbg: tried 1000 values"),e=await o(),e);return async(e,t)=>{let n;for(i(),await s(e);!(n=t(await a()));)await s();return i(),n}}})()(r,i);return o},Ut=(e,t)=>{const{r:n,s:r,recovery:i}=e;[0,1,2,3].includes(i)||Ie("recovery id invalid");const o=xt(et(t,Fe)),s=2===i||3===i?n+Ce:n;dt(s);const a=yt(it(i)),u=nt(a,_t(s)),c=mt.fromBytes(u),l=ut(s,Ce);return((e,t,n)=>bt.multiply(t,!1).add(e.multiply(n,!1)).assertValidity())(c,at(-o*l),at(r*l))},Bt={hexToBytes:Qe,bytesToHex:Ye,concatBytes:nt,bytesToNumberBE:vt,numberToBytesBE:_t,mod:st,invert:ut,hmacSha256Async:async(e,...t)=>{const n=tt()?.subtle??Ie("crypto.subtle must be defined"),r="HMAC",i=await n.importKey("raw",e,{name:r,hash:{name:"SHA-256"}},!1,["sign"]);return qe(await n.sign(r,i,nt(...t)))},hmacSha256Sync:void 0,hashToPrivateKey:e=>{((e=et(e)).length<40||e.length>1024)&&Ie("expected 40-1024b");const t=st(vt(e),Ce-1n);return _t(t+1n)},randomBytes:rt},Ct=Math.ceil(32)+1;let jt;const Lt=(e,t)=>{const n=t.negate();return e?n:t},Mt=e=>{const t=jt||(jt=(()=>{const e=[];let t=bt,n=t;for(let r=0;r<Ct;r++){n=t,e.push(n);for(let r=1;r<128;r++)n=n.add(t),e.push(n);t=n.double()}return e})());let n=wt,r=bt;const i=it(255),o=it(8);for(let s=0;s<Ct;s++){let a=Number(e&i);e>>=o,a>128&&(a-=256,e+=1n);const u=128*s,c=u,l=u+Math.abs(a)-1,f=s%2!=0,d=a<0;0===a?r=r.add(Lt(f,t[c])):n=n.add(Lt(d,t[l]))}return{p:n,f:r}};function Ft(e){if("object"!=typeof e)return(typeof e).toLowerCase();const t=Object.prototype.toString.call(e);return t.slice(8,t.length-1).toLowerCase()}function Nt(e){if("array"===Ft(e)){return we(e.map(e=>"string"===Ft(e)?/^0x([0-9a-fA-F]{2})*$/.test(e)?"0x"===e?new Uint8Array([]):O(e):/^\d+$/.test(e)?"0"===e?new Uint8Array([]):O(m(BigInt(e))):(new TextEncoder).encode(e):"number"===Ft(e)||"bigint"===Ft(e)?0===e||e===BigInt(0)?new Uint8Array([]):O(m(e)):"boolean"===Ft(e)?e?Uint8Array.from([1]):new Uint8Array([]):e))}return"boolean"===Ft(e)?we(e?Uint8Array.from([1]):new Uint8Array([])):we(e)}var It="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function $t(){throw new Error("setTimeout has not been defined")}function Dt(){throw new Error("clearTimeout has not been defined")}var zt=$t,qt=Dt;function Ht(e){if(zt===setTimeout)return setTimeout(e,0);if((zt===$t||!zt)&&setTimeout)return zt=setTimeout,setTimeout(e,0);try{return zt(e,0)}catch(t){try{return zt.call(null,e,0)}catch(t){return zt.call(this,e,0)}}}"function"==typeof It.setTimeout&&(zt=setTimeout),"function"==typeof It.clearTimeout&&(qt=clearTimeout);var Yt,Kt=[],Vt=!1,Wt=-1;function Jt(){Vt&&Yt&&(Vt=!1,Yt.length?Kt=Yt.concat(Kt):Wt=-1,Kt.length&&Xt())}function Xt(){if(!Vt){var e=Ht(Jt);Vt=!0;for(var t=Kt.length;t;){for(Yt=Kt,Kt=[];++Wt<t;)Yt&&Yt[Wt].run();Wt=-1,t=Kt.length}Yt=null,Vt=!1,function(e){if(qt===clearTimeout)return clearTimeout(e);if((qt===Dt||!qt)&&clearTimeout)return qt=clearTimeout,clearTimeout(e);try{return qt(e)}catch(t){try{return qt.call(null,e)}catch(t){return qt.call(this,e)}}}(e)}}function Gt(e,t){this.fun=e,this.array=t}Gt.prototype.run=function(){this.fun.apply(null,this.array)};var Zt=It.performance||{};Zt.now||Zt.mozNow||Zt.msNow||Zt.oNow||Zt.webkitNow;var Qt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Kt.push(new Gt(e,t)),1!==Kt.length||Vt||Ht(Xt)}};function en(e,t){return function(){return e.apply(t,arguments)}}const{toString:tn}=Object.prototype,{getPrototypeOf:nn}=Object,{iterator:rn,toStringTag:on}=Symbol,sn=(an=Object.create(null),e=>{const t=tn.call(e);return an[t]||(an[t]=t.slice(8,-1).toLowerCase())});var an;const un=e=>(e=e.toLowerCase(),t=>sn(t)===e),cn=e=>t=>typeof t===e,{isArray:ln}=Array,fn=cn("undefined");function dn(e){return null!==e&&!fn(e)&&null!==e.constructor&&!fn(e.constructor)&&gn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const hn=un("ArrayBuffer");const pn=cn("string"),gn=cn("function"),yn=cn("number"),mn=e=>null!==e&&"object"==typeof e,bn=e=>{if("object"!==sn(e))return!1;const t=nn(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||on in e||rn in e)},wn=un("Date"),vn=un("File"),En=un("Blob"),An=un("FileList");const _n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==It?It:{},On=void 0!==_n.FormData?_n.FormData:void 0,Rn=un("URLSearchParams"),[Sn,Tn,xn,kn]=["ReadableStream","Request","Response","Headers"].map(un);function Pn(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),ln(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(dn(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function Un(e,t){if(dn(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const Bn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:It,Cn=e=>!fn(e)&&e!==Bn;const jn=(Ln="undefined"!=typeof Uint8Array&&nn(Uint8Array),e=>Ln&&e instanceof Ln);var Ln;const Mn=un("HTMLFormElement"),Fn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nn=un("RegExp"),In=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Pn(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)};const $n=un("AsyncFunction"),Dn=(zn="function"==typeof setImmediate,qn=gn(Bn.postMessage),zn?setImmediate:qn?(Hn=`axios@${Math.random()}`,Yn=[],Bn.addEventListener("message",({source:e,data:t})=>{e===Bn&&t===Hn&&Yn.length&&Yn.shift()()},!1),e=>{Yn.push(e),Bn.postMessage(Hn,"*")}):e=>setTimeout(e));var zn,qn,Hn,Yn;const Kn="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Bn):Qt.nextTick||Dn;var Vn={isArray:ln,isArrayBuffer:hn,isBuffer:dn,isFormData:e=>{if(!e)return!1;if(On&&e instanceof On)return!0;const t=nn(e);if(!t||t===Object.prototype)return!1;if(!gn(e.append))return!1;const n=sn(e);return"formdata"===n||"object"===n&&gn(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&hn(e.buffer),t},isString:pn,isNumber:yn,isBoolean:e=>!0===e||!1===e,isObject:mn,isPlainObject:bn,isEmptyObject:e=>{if(!mn(e)||dn(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Sn,isRequest:Tn,isResponse:xn,isHeaders:kn,isUndefined:fn,isDate:wn,isFile:vn,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:En,isRegExp:Nn,isFunction:gn,isStream:e=>mn(e)&&gn(e.pipe),isURLSearchParams:Rn,isTypedArray:jn,isFileList:An,forEach:Pn,merge:function e(){const{caseless:t,skipUndefined:n}=Cn(this)&&this||{},r={},i=(i,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const s=t&&Un(r,o)||o;bn(r[s])&&bn(i)?r[s]=e(r[s],i):bn(i)?r[s]=e({},i):ln(i)?r[s]=i.slice():n&&fn(i)||(r[s]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Pn(arguments[e],i);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(Pn(t,(t,r)=>{n&&gn(t)?Object.defineProperty(e,r,{value:en(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),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,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&nn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:sn,kindOfTest:un,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(ln(e))return e;let t=e.length;if(!yn(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[rn]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Mn,hasOwnProperty:Fn,hasOwnProp:Fn,reduceDescriptors:In,freezeMethods:e=>{In(e,(t,n)=>{if(gn(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];gn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return ln(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Un,global:Bn,isContextDefined:Cn,isSpecCompliantForm:function(e){return!!(e&&gn(e.append)&&"FormData"===e[on]&&e[rn])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(mn(e)){if(t.indexOf(e)>=0)return;if(dn(e))return e;if(!("toJSON"in e)){t[r]=e;const i=ln(e)?[]:{};return Pn(e,(e,t)=>{const o=n(e,r+1);!fn(o)&&(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:$n,isThenable:e=>e&&(mn(e)||gn(e))&&gn(e.then)&&gn(e.catch),setImmediate:Dn,asap:Kn,isIterable:e=>null!=e&&gn(e[rn])},Wn=[],Jn=[],Xn="undefined"!=typeof Uint8Array?Uint8Array:Array,Gn=!1;function Zn(){Gn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Wn[t]=e[t],Jn[e.charCodeAt(t)]=t;Jn["-".charCodeAt(0)]=62,Jn["_".charCodeAt(0)]=63}function Qn(e){return Wn[e>>18&63]+Wn[e>>12&63]+Wn[e>>6&63]+Wn[63&e]}function er(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(Qn(r));return i.join("")}function tr(e){var t;Gn||Zn();for(var n=e.length,r=n%3,i="",o=[],s=16383,a=0,u=n-r;a<u;a+=s)o.push(er(e,a,a+s>u?u:a+s));return 1===r?(t=e[n-1],i+=Wn[t>>2],i+=Wn[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=Wn[t>>10],i+=Wn[t>>4&63],i+=Wn[t<<2&63],i+="="),o.push(i),o.join("")}function nr(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,f=n?i-1:0,d=n?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+f],f+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),o-=c}return(h?-1:1)*s*Math.pow(2,o-r)}function rr(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[n+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+h]=255&s,h+=p,s/=256,c-=8);e[n+h-p]|=128*g}var ir={}.toString,or=Array.isArray||function(e){return"[object Array]"==ir.call(e)};function sr(){return ur.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ar(e,t){if(sr()<t)throw new RangeError("Invalid typed array length");return ur.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=ur.prototype:(null===e&&(e=new ur(t)),e.length=t),e}function ur(e,t,n){if(!(ur.TYPED_ARRAY_SUPPORT||this instanceof ur))return new ur(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return fr(this,e)}return cr(this,e,t,n)}function cr(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);ur.TYPED_ARRAY_SUPPORT?(e=t).__proto__=ur.prototype:e=dr(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!ur.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|gr(t,n);e=ar(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(pr(t)){var n=0|hr(t.length);return 0===(e=ar(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?ar(e,0):dr(e,t);if("Buffer"===t.type&&or(t.data))return dr(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function lr(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function fr(e,t){if(lr(t),e=ar(e,t<0?0:0|hr(t)),!ur.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function dr(e,t){var n=t.length<0?0:0|hr(t.length);e=ar(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function hr(e){if(e>=sr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+sr().toString(16)+" bytes");return 0|e}function pr(e){return!(null==e||!e._isBuffer)}function gr(e,t){if(pr(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return zr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return qr(e).length;default:if(r)return zr(e).length;t=(""+t).toLowerCase(),r=!0}}function yr(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ur(this,t,n);case"utf8":case"utf-8":return Tr(this,t,n);case"ascii":return kr(this,t,n);case"latin1":case"binary":return Pr(this,t,n);case"base64":return Sr(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Br(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function mr(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function br(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=ur.from(t,r)),pr(t))return 0===t.length?-1:wr(e,t,n,r,i);if("number"==typeof t)return t&=255,ur.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):wr(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function wr(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var f=!0,d=0;d<u;d++)if(c(e,o+d)!==c(t,d)){f=!1;break}if(f)return o}return-1}function vr(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function Er(e,t,n,r){return Hr(zr(t,e.length-n),e,n,r)}function Ar(e,t,n,r){return Hr(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function _r(e,t,n,r){return Ar(e,t,n,r)}function Or(e,t,n,r){return Hr(qr(t),e,n,r)}function Rr(e,t,n,r){return Hr(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function Sr(e,t,n){return 0===t&&n===e.length?tr(e):tr(e.slice(t,n))}function Tr(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=xr)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=xr));return n}(r)}ur.TYPED_ARRAY_SUPPORT=void 0===It.TYPED_ARRAY_SUPPORT||It.TYPED_ARRAY_SUPPORT,sr(),ur.poolSize=8192,ur._augment=function(e){return e.__proto__=ur.prototype,e},ur.from=function(e,t,n){return cr(null,e,t,n)},ur.TYPED_ARRAY_SUPPORT&&(ur.prototype.__proto__=Uint8Array.prototype,ur.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&ur[Symbol.species]),ur.alloc=function(e,t,n){return function(e,t,n,r){return lr(t),t<=0?ar(e,t):void 0!==n?"string"==typeof r?ar(e,t).fill(n,r):ar(e,t).fill(n):ar(e,t)}(null,e,t,n)},ur.allocUnsafe=function(e){return fr(null,e)},ur.allocUnsafeSlow=function(e){return fr(null,e)},ur.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Yr(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Yr(e.slice(0,0))}(e))},ur.compare=function(e,t){if(!pr(e)||!pr(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},ur.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}},ur.concat=function(e,t){if(!or(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return ur.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=ur.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!pr(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},ur.byteLength=gr,ur.prototype._isBuffer=!0,ur.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)mr(this,t,t+1);return this},ur.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)mr(this,t,t+3),mr(this,t+1,t+2);return this},ur.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)mr(this,t,t+7),mr(this,t+1,t+6),mr(this,t+2,t+5),mr(this,t+3,t+4);return this},ur.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Tr(this,0,e):yr.apply(this,arguments)},ur.prototype.equals=function(e){if(!pr(e))throw new TypeError("Argument must be a Buffer");return this===e||0===ur.compare(this,e)},ur.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},ur.prototype.compare=function(e,t,n,r,i){if(!pr(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),c=e.slice(t,n),l=0;l<a;++l)if(u[l]!==c[l]){o=u[l],s=c[l];break}return o<s?-1:s<o?1:0},ur.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},ur.prototype.indexOf=function(e,t,n){return br(this,e,t,n,!0)},ur.prototype.lastIndexOf=function(e,t,n){return br(this,e,t,n,!1)},ur.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return vr(this,e,t,n);case"utf8":case"utf-8":return Er(this,e,t,n);case"ascii":return Ar(this,e,t,n);case"latin1":case"binary":return _r(this,e,t,n);case"base64":return Or(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rr(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},ur.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var xr=4096;function kr(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function Pr(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Ur(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=Dr(e[o]);return i}function Br(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Cr(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function jr(e,t,n,r,i,o){if(!pr(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Lr(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Mr(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function Fr(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Nr(e,t,n,r,i){return i||Fr(e,0,n,4),rr(e,t,n,r,23,4),n+4}function Ir(e,t,n,r,i){return i||Fr(e,0,n,8),rr(e,t,n,r,52,8),n+8}ur.prototype.slice=function(e,t){var n,r=this.length;if((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),ur.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=ur.prototype;else{var i=t-e;n=new ur(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},ur.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Cr(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},ur.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Cr(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},ur.prototype.readUInt8=function(e,t){return t||Cr(e,1,this.length),this[e]},ur.prototype.readUInt16LE=function(e,t){return t||Cr(e,2,this.length),this[e]|this[e+1]<<8},ur.prototype.readUInt16BE=function(e,t){return t||Cr(e,2,this.length),this[e]<<8|this[e+1]},ur.prototype.readUInt32LE=function(e,t){return t||Cr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},ur.prototype.readUInt32BE=function(e,t){return t||Cr(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},ur.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Cr(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},ur.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Cr(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},ur.prototype.readInt8=function(e,t){return t||Cr(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},ur.prototype.readInt16LE=function(e,t){t||Cr(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},ur.prototype.readInt16BE=function(e,t){t||Cr(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},ur.prototype.readInt32LE=function(e,t){return t||Cr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},ur.prototype.readInt32BE=function(e,t){return t||Cr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},ur.prototype.readFloatLE=function(e,t){return t||Cr(e,4,this.length),nr(this,e,!0,23,4)},ur.prototype.readFloatBE=function(e,t){return t||Cr(e,4,this.length),nr(this,e,!1,23,4)},ur.prototype.readDoubleLE=function(e,t){return t||Cr(e,8,this.length),nr(this,e,!0,52,8)},ur.prototype.readDoubleBE=function(e,t){return t||Cr(e,8,this.length),nr(this,e,!1,52,8)},ur.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||jr(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},ur.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||jr(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},ur.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||jr(this,e,t,1,255,0),ur.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},ur.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||jr(this,e,t,2,65535,0),ur.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Lr(this,e,t,!0),t+2},ur.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||jr(this,e,t,2,65535,0),ur.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Lr(this,e,t,!1),t+2},ur.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||jr(this,e,t,4,4294967295,0),ur.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Mr(this,e,t,!0),t+4},ur.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||jr(this,e,t,4,4294967295,0),ur.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Mr(this,e,t,!1),t+4},ur.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);jr(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},ur.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);jr(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},ur.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||jr(this,e,t,1,127,-128),ur.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},ur.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||jr(this,e,t,2,32767,-32768),ur.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Lr(this,e,t,!0),t+2},ur.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||jr(this,e,t,2,32767,-32768),ur.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Lr(this,e,t,!1),t+2},ur.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||jr(this,e,t,4,2147483647,-2147483648),ur.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Mr(this,e,t,!0),t+4},ur.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||jr(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),ur.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Mr(this,e,t,!1),t+4},ur.prototype.writeFloatLE=function(e,t,n){return Nr(this,e,t,!0,n)},ur.prototype.writeFloatBE=function(e,t,n){return Nr(this,e,t,!1,n)},ur.prototype.writeDoubleLE=function(e,t,n){return Ir(this,e,t,!0,n)},ur.prototype.writeDoubleBE=function(e,t,n){return Ir(this,e,t,!1,n)},ur.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!ur.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},ur.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!ur.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=pr(e)?e:zr(new ur(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var $r=/[^+\/0-9A-Za-z-_]/g;function Dr(e){return e<16?"0"+e.toString(16):e.toString(16)}function zr(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function qr(e){return function(e){var t,n,r,i,o,s;Gn||Zn();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[a-2]?2:"="===e[a-1]?1:0,s=new Xn(3*a/4-o),r=o>0?a-4:a;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=Jn[e.charCodeAt(t)]<<18|Jn[e.charCodeAt(t+1)]<<12|Jn[e.charCodeAt(t+2)]<<6|Jn[e.charCodeAt(t+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=Jn[e.charCodeAt(t)]<<2|Jn[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=Jn[e.charCodeAt(t)]<<10|Jn[e.charCodeAt(t+1)]<<4|Jn[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace($r,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Hr(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Yr(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}let Kr=class e extends Error{static from(t,n,r,i,o,s){const a=new e(t.message,n||t.code,r,i,o);return a.cause=t,a.name=t.name,null!=t.status&&null==a.status&&(a.status=t.status),s&&Object.assign(a,s),a}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){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:Vn.toJSONObject(this.config),code:this.code,status:this.status}}};Kr.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Kr.ERR_BAD_OPTION="ERR_BAD_OPTION",Kr.ECONNABORTED="ECONNABORTED",Kr.ETIMEDOUT="ETIMEDOUT",Kr.ERR_NETWORK="ERR_NETWORK",Kr.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Kr.ERR_DEPRECATED="ERR_DEPRECATED",Kr.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Kr.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Kr.ERR_CANCELED="ERR_CANCELED",Kr.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Kr.ERR_INVALID_URL="ERR_INVALID_URL",Kr.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";function Vr(e){return Vn.isPlainObject(e)||Vn.isArray(e)}function Wr(e){return Vn.endsWith(e,"[]")?e.slice(0,-2):e}function Jr(e,t,n){return e?e.concat(t).map(function(e,t){return e=Wr(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Xr=Vn.toFlatObject(Vn,{},null,function(e){return/^is[A-Z]/.test(e)});function Gr(e,t,n){if(!Vn.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Vn.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Vn.isUndefined(t[e])})).metaTokens,i=n.visitor||f,o=n.dots,s=n.indexes,a=n.Blob||"undefined"!=typeof Blob&&Blob,u=void 0===n.maxDepth?100:n.maxDepth,c=a&&Vn.isSpecCompliantForm(t);if(!Vn.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Vn.isDate(e))return e.toISOString();if(Vn.isBoolean(e))return e.toString();if(!c&&Vn.isBlob(e))throw new Kr("Blob is not supported. Use a Buffer instead.");return Vn.isArrayBuffer(e)||Vn.isTypedArray(e)?c&&"function"==typeof Blob?new Blob([e]):ur.from(e):e}function f(e,n,i){let a=e;if(Vn.isReactNative(t)&&Vn.isReactNativeBlob(e))return t.append(Jr(i,n,o),l(e)),!1;if(e&&!i&&"object"==typeof e)if(Vn.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Vn.isArray(e)&&function(e){return Vn.isArray(e)&&!e.some(Vr)}(e)||(Vn.isFileList(e)||Vn.endsWith(n,"[]"))&&(a=Vn.toArray(e)))return n=Wr(n),a.forEach(function(e,r){!Vn.isUndefined(e)&&null!==e&&t.append(!0===s?Jr([n],r,o):null===s?n:n+"[]",l(e))}),!1;return!!Vr(e)||(t.append(Jr(i,n,o),l(e)),!1)}const d=[],h=Object.assign(Xr,{defaultVisitor:f,convertValue:l,isVisitable:Vr});if(!Vn.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!Vn.isUndefined(n)){if(o>u)throw new Kr("Object is too deeply nested ("+o+" levels). Max depth: "+u,Kr.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+r.join("."));d.push(n),Vn.forEach(n,function(n,s){!0===(!(Vn.isUndefined(n)||null===n)&&i.call(t,n,Vn.isString(s)?s.trim():s,r,h))&&e(n,r?r.concat(s):[s],o+1)}),d.pop()}}(e),t}function Zr(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Qr(e,t){this._pairs=[],e&&Gr(e,this,t)}const ei=Qr.prototype;function ti(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ni(e,t,n){if(!t)return e;const r=n&&n.encode||ti,i=Vn.isFunction(n)?{serialize:n}:n,o=i&&i.serialize;let s;if(s=o?o(t,i):Vn.isURLSearchParams(t)?t.toString():new Qr(t,i).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}ei.append=function(e,t){this._pairs.push([e,t])},ei.toString=function(e){const t=e?function(t){return e.call(this,t,Zr)}:Zr;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ri{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Vn.forEach(this.handlers,function(t){null!==t&&e(t)})}}var ii={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},oi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Qr,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const si="undefined"!=typeof window&&"undefined"!=typeof document,ai="object"==typeof navigator&&navigator||void 0,ui=si&&(!ai||["ReactNative","NativeScript","NS"].indexOf(ai.product)<0),ci="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,li=si&&window.location.href||"http://localhost";var fi={...Object.freeze({__proto__:null,hasBrowserEnv:si,hasStandardBrowserEnv:ui,hasStandardBrowserWebWorkerEnv:ci,navigator:ai,origin:li}),...oi};function di(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=e.length;if(o=!o&&Vn.isArray(r)?r.length:o,a)return Vn.hasOwnProp(r,o)?r[o]=Vn.isArray(r[o])?r[o].concat(n):[r[o],n]:r[o]=n,!s;r[o]&&Vn.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],i)&&Vn.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!s}if(Vn.isFormData(e)&&Vn.isFunction(e.entries)){const n={};return Vn.forEachEntry(e,(e,r)=>{t(function(e){return Vn.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const hi=(e,t)=>null!=e&&Vn.hasOwnProp(e,t)?e[t]:void 0;const pi={transitional:ii,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=Vn.isObject(e);i&&Vn.isHTMLForm(e)&&(e=new FormData(e));if(Vn.isFormData(e))return r?JSON.stringify(di(e)):e;if(Vn.isArrayBuffer(e)||Vn.isBuffer(e)||Vn.isStream(e)||Vn.isFile(e)||Vn.isBlob(e)||Vn.isReadableStream(e))return e;if(Vn.isArrayBufferView(e))return e.buffer;if(Vn.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){const t=hi(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Gr(e,new fi.classes.URLSearchParams,{visitor:function(e,t,n,r){return fi.isNode&&Vn.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((o=Vn.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=hi(this,"env"),r=n&&n.FormData;return Gr(o?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(Vn.isString(e))try{return(t||JSON.parse)(e),Vn.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=hi(this,"transitional")||pi.transitional,n=t&&t.forcedJSONParsing,r=hi(this,"responseType"),i="json"===r;if(Vn.isResponse(e)||Vn.isReadableStream(e))return e;if(e&&Vn.isString(e)&&(n&&!r||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,hi(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Kr.from(e,Kr.ERR_BAD_RESPONSE,this,null,hi(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fi.classes.FormData,Blob:fi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Vn.forEach(["delete","get","head","post","put","patch"],e=>{pi.headers[e]={}});const gi=Vn.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 yi=Symbol("internals"),mi=/[^\x09\x20-\x7E\x80-\xFF]/g;function bi(e){return e&&String(e).trim().toLowerCase()}function wi(e){return!1===e||null==e?e:Vn.isArray(e)?e.map(wi):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(mi,""))}function vi(e,t,n,r,i){return Vn.isFunction(r)?r.call(this,t,n):(i&&(t=n),Vn.isString(t)?Vn.isString(r)?-1!==t.indexOf(r):Vn.isRegExp(r)?r.test(t):void 0:void 0)}let Ei=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=bi(t);if(!i)throw new Error("header name must be a non-empty string");const o=Vn.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=wi(e))}const o=(e,t)=>Vn.forEach(e,(e,n)=>i(e,n,t));if(Vn.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Vn.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&gi[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Vn.isObject(e)&&Vn.isIterable(e)){let n,r,i={};for(const t of e){if(!Vn.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?Vn.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=bi(e)){const n=Vn.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Vn.isFunction(t))return t.call(this,e,n);if(Vn.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=bi(e)){const n=Vn.findKey(this,e);return!(!n||void 0===this[n]||t&&!vi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=bi(e)){const i=Vn.findKey(n,e);!i||t&&!vi(0,n[i],i,t)||(delete n[i],r=!0)}}return Vn.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!vi(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return Vn.forEach(this,(r,i)=>{const o=Vn.findKey(n,i);if(o)return t[o]=wi(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=wi(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Vn.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Vn.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[yi]=this[yi]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=bi(e);t[r]||(!function(e,t){const n=Vn.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return Vn.isArray(e)?e.forEach(r):r(e),this}};function Ai(e,t){const n=this||pi,r=t||n,i=Ei.from(r.headers);let o=r.data;return Vn.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function _i(e){return!(!e||!e.__CANCEL__)}Ei.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Vn.reduceDescriptors(Ei.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Vn.freezeMethods(Ei);let Oi=class extends Kr{constructor(e,t,n){super(null==e?"canceled":e,Kr.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ri(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Kr("Request failed with status code "+n.status,[Kr.ERR_BAD_REQUEST,Kr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Si=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=r[s];i||(i=u),n[o]=a,r[o]=u;let l=s,f=0;for(;l!==o;)f+=n[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-i<t)return;const d=c&&u-c;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,i=0,o=1e3/t;const s=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=o?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},o-a)))},()=>n&&s(n)]}(n=>{const o=n.loaded,s=n.lengthComputable?n.total:void 0,a=null!=s?Math.min(o,s):o,u=Math.max(0,a-r),c=i(u);r=Math.max(r,a);e({loaded:a,total:s,progress:s?a/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s?(s-a)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},Ti=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},xi=e=>(...t)=>Vn.asap(()=>e(...t));var ki=fi.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,fi.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(fi.origin),fi.navigator&&/(msie|trident)/i.test(fi.navigator.userAgent)):()=>!0,Pi=fi.hasStandardBrowserEnv?{write(e,t,n,r,i,o,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Vn.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Vn.isString(r)&&a.push(`path=${r}`),Vn.isString(i)&&a.push(`domain=${i}`),!0===o&&a.push("secure"),Vn.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Ui(e,t,n){let r=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));var i;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Bi=e=>e instanceof Ei?{...e}:e;function Ci(e,t){t=t||{};const n={};function r(e,t,n,r){return Vn.isPlainObject(e)&&Vn.isPlainObject(t)?Vn.merge.call({caseless:r},e,t):Vn.isPlainObject(t)?Vn.merge({},t):Vn.isArray(t)?t.slice():t}function i(e,t,n,i){return Vn.isUndefined(t)?Vn.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!Vn.isUndefined(t))return r(void 0,t)}function s(e,t){return Vn.isUndefined(t)?Vn.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return Vn.hasOwnProp(t,o)?r(n,i):Vn.hasOwnProp(e,o)?r(void 0,n):void 0}const u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>i(Bi(e),Bi(t),0,!0)};return Vn.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=Vn.hasOwnProp(u,r)?u[r]:i,s=o(Vn.hasOwnProp(e,r)?e[r]:void 0,Vn.hasOwnProp(t,r)?t[r]:void 0,r);Vn.isUndefined(s)&&o!==a||(n[r]=s)}),n}var ji=e=>{const t=Ci({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=Ei.from(s),t.url=ni(Ui(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Vn.isFormData(n))if(fi.hasStandardBrowserEnv||fi.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Vn.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(fi.hasStandardBrowserEnv){Vn.isFunction(r)&&(r=r(t));if(!0===r||null==r&&ki(t.url)){const e=i&&o&&Pi.read(o);e&&s.set(i,e)}}return t};var Li="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=ji(e);let i=r.data;const o=Ei.from(r.headers).normalize();let s,a,u,c,l,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=r;function p(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function y(){if(!g)return;const r=Ei.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Ri(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(y)},g.onabort=function(){g&&(n(new Kr("Request aborted",Kr.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",i=new Kr(r,Kr.ERR_NETWORK,e,g);i.event=t||null,n(i),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||ii;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Kr(t,i.clarifyTimeoutError?Kr.ETIMEDOUT:Kr.ECONNABORTED,e,g)),g=null},void 0===i&&o.setContentType(null),"setRequestHeader"in g&&Vn.forEach(o.toJSON(),function(e,t){g.setRequestHeader(t,e)}),Vn.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),h&&([u,l]=Si(h,!0),g.addEventListener("progress",u)),d&&g.upload&&([a,c]=Si(d),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new Oi(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===fi.protocols.indexOf(m)?n(new Kr("Unsupported protocol "+m+":",Kr.ERR_BAD_REQUEST,e)):g.send(i||null)})};const Mi=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Kr?t:new Oi(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,i(new Kr(`timeout of ${t}ms exceeded`,Kr.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>Vn.asap(s),a}},Fi=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},Ni=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Ii=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of Ni(e))yield*Fi(n,t)}(e,t);let o,s=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},{isFunction:$i}=Vn,Di=(({Request:e,Response:t})=>({Request:e,Response:t}))(Vn.global),{ReadableStream:zi,TextEncoder:qi}=Vn.global,Hi=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Yi=e=>{e=Vn.merge.call({skipUndefined:!0},Di,e);const{fetch:t,Request:n,Response:r}=e,i=t?$i(t):"function"==typeof fetch,o=$i(n),s=$i(r);if(!i)return!1;const a=i&&$i(zi),u=i&&("function"==typeof qi?(e=>t=>e.encode(t))(new qi):async e=>new Uint8Array(await new n(e).arrayBuffer())),c=o&&a&&Hi(()=>{let e=!1;const t=new n(fi.origin,{body:new zi,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),l=s&&a&&Hi(()=>Vn.isReadableStream(new r("").body)),f={stream:l&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Kr(`Response type '${e}' is not supported`,Kr.ERR_NOT_SUPPORT,n)})});const d=async(e,t)=>{const r=Vn.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Vn.isBlob(e))return e.size;if(Vn.isSpecCompliantForm(e)){const t=new n(fi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Vn.isArrayBufferView(e)||Vn.isArrayBuffer(e)?e.byteLength:(Vn.isURLSearchParams(e)&&(e+=""),Vn.isString(e)?(await u(e)).byteLength:void 0)})(t):r};return async e=>{let{url:i,method:s,data:a,signal:u,cancelToken:h,timeout:p,onDownloadProgress:g,onUploadProgress:y,responseType:m,headers:b,withCredentials:w="same-origin",fetchOptions:v}=ji(e),E=t||fetch;m=m?(m+"").toLowerCase():"text";let A=Mi([u,h&&h.toAbortSignal()],p),_=null;const O=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let R;try{if(y&&c&&"get"!==s&&"head"!==s&&0!==(R=await d(b,a))){let e,t=new n(i,{method:"POST",body:a,duplex:"half"});if(Vn.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=Ti(R,Si(xi(y)));a=Ii(t.body,65536,e,n)}}Vn.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in n.prototype;if(Vn.isFormData(a)){const e=b.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&b.delete("content-type")}const u={...v,signal:A,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};_=o&&new n(i,u);let h=await(o?E(_,v):E(i,u));const p=l&&("stream"===m||"response"===m);if(l&&(g||p&&O)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=Vn.toFiniteNumber(h.headers.get("content-length")),[n,i]=g&&Ti(t,Si(xi(g),!0))||[];h=new r(Ii(h.body,65536,n,()=>{i&&i(),O&&O()}),e)}m=m||"text";let S=await f[Vn.findKey(f,m)||"text"](h,e);return!p&&O&&O(),await new Promise((t,n)=>{Ri(t,n,{data:S,headers:Ei.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:_})})}catch(t){if(O&&O(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Kr("Network Error",Kr.ERR_NETWORK,e,_,t&&t.response),{cause:t.cause||t});throw Kr.from(t,t&&t.code,e,_,t&&t.response)}}},Ki=new Map,Vi=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let s,a,u=o.length,c=Ki;for(;u--;)s=o[u],a=c.get(s),void 0===a&&c.set(s,a=u?new Map:Yi(t)),c=a;return a};Vi();const Wi={http:null,xhr:Li,fetch:{get:Vi}};Vn.forEach(Wi,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Ji=e=>`- ${e}`,Xi=e=>Vn.isFunction(e)||null===e||!1===e;var Gi={getAdapter:function(e,t){e=Vn.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let s=0;s<n;s++){let n;if(r=e[s],i=r,!Xi(r)&&(i=Wi[(n=String(r)).toLowerCase()],void 0===i))throw new Kr(`Unknown adapter '${n}'`);if(i&&(Vn.isFunction(i)||(i=i.get(t))))break;o[n||"#"+s]=i}if(!i){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Ji).join("\n"):" "+Ji(e[0]):"as no adapter specified";throw new Kr("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return i},adapters:Wi};function Zi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Oi(null,e)}function Qi(e){Zi(e),e.headers=Ei.from(e.headers),e.data=Ai.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Gi.getAdapter(e.adapter||pi.adapter,e)(e).then(function(t){return Zi(e),t.data=Ai.call(e,e.transformResponse,t),t.headers=Ei.from(t.headers),t},function(t){return _i(t)||(Zi(e),t&&t.response&&(t.response.data=Ai.call(e,e.transformResponse,t.response),t.response.headers=Ei.from(t.response.headers))),Promise.reject(t)})}const eo="1.15.1",to={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{to[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const no={};to.transitional=function(e,t,n){function r(e,t){return"[Axios v"+eo+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new Kr(r(i," has been removed"+(t?" in "+t:"")),Kr.ERR_DEPRECATED);return t&&!no[i]&&(no[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},to.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var ro={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Kr("options must be an object",Kr.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new Kr("option "+o+" must be "+n,Kr.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Kr("Unknown option "+o,Kr.ERR_BAD_OPTION)}},validators:to};const io=ro.validators;let oo=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ri,response:new ri}}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 n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),i=-1===r?"":n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ci(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&ro.assertOptions(n,{silentJSONParsing:io.transitional(io.boolean),forcedJSONParsing:io.transitional(io.boolean),clarifyTimeoutError:io.transitional(io.boolean),legacyInterceptorReqResOrdering:io.transitional(io.boolean)},!1),null!=r&&(Vn.isFunction(r)?t.paramsSerializer={serialize:r}:ro.assertOptions(r,{encode:io.function,serialize:io.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ro.assertOptions(t,{baseUrl:io.spelling("baseURL"),withXsrfToken:io.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&Vn.merge(i.common,i[t.method]);i&&Vn.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=Ei.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||ii;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(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=[Qi.bind(this),void 0];for(e.unshift(...s),e.push(...u),l=e.length,c=Promise.resolve(t);f<l;)c=c.then(e[f++],e[f++]);return c}l=s.length;let d=t;for(;f<l;){const e=s[f++],t=s[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{c=Qi.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 ni(Ui((e=Ci(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Vn.forEach(["delete","get","head","options"],function(e){oo.prototype[e]=function(t,n){return this.request(Ci(n||{},{method:e,url:t,data:(n||{}).data}))}}),Vn.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(Ci(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}oo.prototype[e]=t(),oo.prototype[e+"Form"]=t(!0)});const so={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(so).forEach(([e,t])=>{so[t]=e});const ao=function e(t){const n=new oo(t),r=en(oo.prototype.request,n);return Vn.extend(r,oo.prototype,n,{allOwnKeys:!0}),Vn.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ci(t,n))},r}(pi);ao.Axios=oo,ao.CanceledError=Oi,ao.CancelToken=class e{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 n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Oi(e,r,i),t(n.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)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},ao.isCancel=_i,ao.VERSION=eo,ao.toFormData=Gr,ao.AxiosError=Kr,ao.Cancel=ao.CanceledError,ao.all=function(e){return Promise.all(e)},ao.spread=function(e){return function(t){return e.apply(null,t)}},ao.isAxiosError=function(e){return Vn.isObject(e)&&!0===e.isAxiosError},ao.mergeConfig=Ci,ao.AxiosHeaders=Ei,ao.formToJSON=e=>di(Vn.isHTMLForm(e)?new FormData(e):e),ao.getAdapter=Gi.getAdapter,ao.HttpStatusCode=so,ao.default=ao;const{Axios:uo,AxiosError:co,CanceledError:lo,isCancel:fo,CancelToken:ho,VERSION:po,all:go,Cancel:yo,isAxiosError:mo,spread:bo,toFormData:wo,AxiosHeaders:vo,HttpStatusCode:Eo,formToJSON:Ao,getAdapter:_o,mergeConfig:Oo}=ao;class Ro{constructor(){this.promiseWrapper=new Promise((e,t)=>{this._resolve=e,this._reject=t}),this._restScope=["success","failure","error","login","timeout"];for(let e=0;e<this._restScope.length;e++){const t=this._restScope[e];t&&(this.promiseWrapper[t]=e=>{"function"==typeof e&&(this[`_${t}`]=e);const n=this.promiseWrapper;delete n[t];const r=this._restScope.slice();return r.splice(r.indexOf(t),1),r.every(e=>!!e&&!n[e])&&delete n.rest,n})}this.promiseWrapper.rest=(e,t)=>{"function"==typeof e&&(this._rest=e);const n=this.promiseWrapper;if(delete n.rest,this._restScope=t||this._restScope,0===this._restScope.length)console.warn('[1Money SDK]: The ".rest(cb, scope)" scope is empty and will never be triggered!');else{let e=0;this._restScope.forEach(t=>{t&&(n[t]?delete n[t]:e++)}),e===this._restScope.length&&console.warn(`[1Money SDK]: The "${this._restScope.join(", ")}" had been called and the "rest" will never be triggered!`)}return n}}}const So=new class{constructor(e){this._config=e||{},this.axios=ao,this.parseError=this.parseError.bind(this),this.setting=this.setting.bind(this),this.request=this.request.bind(this)}parseError(e){var t,n,r,i,o,s,a,u,c;"string"==typeof e&&(e=new Error(e)),(!e||"object"!==Ft(e)&&"error"!==Ft(e))&&(e=new Error("Unknown error occurred"));const l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"Error",f=null!==(i=null!==(n=null==e?void 0:e.message)&&void 0!==n?n:null===(r=null==e?void 0:e.toString)||void 0===r?void 0:r.call(e))&&void 0!==i?i:"Unknown error",d=null!==(o=null==e?void 0:e.stack)&&void 0!==o?o:"",h=null!==(a=null===(s=null==e?void 0:e.response)||void 0===s?void 0:s.status)&&void 0!==a?a:500,p=null!==(c=null===(u=null==e?void 0:e.response)||void 0===u?void 0:u.data)&&void 0!==c?c:void 0;return"number"!=typeof h||h<100||h>599?{name:"InvalidStatusError",message:"Invalid HTTP status code",stack:d,status:500,data:p}:{name:l,message:f,stack:d,status:h,data:p}}mergeSignals(...e){const t=new AbortController,n=()=>t.abort(),r=[];for(const i of e){if(i.aborted){t.abort();break}i.addEventListener("abort",n),r.push(()=>i.removeEventListener("abort",n))}return{signal:t.signal,cleanup:()=>r.forEach(e=>e())}}setting(e){if(!e)return console.warn("[1Money SDK]: setting method required correct parameters!");this._config=Object.assign(Object.assign({},this._config),e)}request(e){e.withCredentials="boolean"!=typeof e.withCredentials||e.withCredentials,e.headers=Object.assign(Object.assign(Object.assign({},this.axios.defaults.headers.common),e.method?this.axios.defaults.headers[e.method]:{}),e.headers),e.headers.Accept=e.headers.Accept||"*/*",e.headers["X-Requested-With"]=e.headers["X-Requested-With"]||"XMLHttpRequest";const{onSuccess:n,onFailure:r,onLogin:i,onError:o,onTimeout:s,isSuccess:a,isLogin:u,timeout:c}=this._config,{onSuccess:l,onFailure:f,onLogin:d,onError:h,onTimeout:p,isSuccess:g,isLogin:y,timeout:m}=e,b={success:null!=g?g:a,login:null!=y?y:u},w=new Ro;return Promise.resolve().then(()=>{var a,u,g,y,v,E,A,_,O,R,S,T,x,k,P,U,B,C,j,L;const M={success:null!==(y=null!==(g=null!==(u=null!==(a=w._success)&&void 0!==a?a:~w._restScope.indexOf("success")?w._rest:void 0)&&void 0!==u?u:l)&&void 0!==g?g:n)&&void 0!==y?y:(e,t)=>e,failure:null!==(_=null!==(A=null!==(E=null!==(v=w._failure)&&void 0!==v?v:~w._restScope.indexOf("failure")?w._rest:void 0)&&void 0!==E?E:f)&&void 0!==A?A:r)&&void 0!==_?_:(e,t)=>e,error:null!==(T=null!==(S=null!==(R=null!==(O=w._error)&&void 0!==O?O:~w._restScope.indexOf("error")?w._rest:void 0)&&void 0!==R?R:h)&&void 0!==S?S:o)&&void 0!==T?T:(e,t)=>e,login:null!==(U=null!==(P=null!==(k=null!==(x=w._login)&&void 0!==x?x:~w._restScope.indexOf("login")?w._rest:void 0)&&void 0!==k?k:d)&&void 0!==P?P:i)&&void 0!==U?U:(e,t)=>e,timeout:null!==(L=null!==(j=null!==(C=null!==(B=w._timeout)&&void 0!==B?B:~w._restScope.indexOf("timeout")?w._rest:void 0)&&void 0!==C?C:p)&&void 0!==j?j:s)&&void 0!==L?L:(e,t)=>e},F=(w._success||w._rest&&w._restScope.indexOf("success"),w._failure||w._rest&&w._restScope.indexOf("failure"),w._login||w._rest&&w._restScope.indexOf("login"),!!(w._error||w._rest&&~w._restScope.indexOf("error")||h||o)),N=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")||p||s),I=!!(w._success||w._rest&&~w._restScope.indexOf("success")),$=!!(w._failure||w._rest&&~w._restScope.indexOf("failure")),D=!!(w._login||w._rest&&~w._restScope.indexOf("login")),z=!!(w._error||w._rest&&~w._restScope.indexOf("error")),q=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")),H=(e,n)=>t(this,void 0,void 0,function*(){try{let t=this.parseError(e);const r=yield Promise.resolve(M.error(t,n));z&&(t=r),F?w._resolve(t):w._reject(t)}catch(e){w._reject(this.parseError(e))}});let Y=null,K=!1;const V=null!=m?m:c,W=new AbortController;let J=null;if(e.signal){const t=this.mergeSignals(e.signal,W.signal);e.signal=t.signal,J=t.cleanup}else e.signal=W.signal;const X=()=>{null!==Y&&(clearTimeout(Y),Y=null),J&&(J(),J=null)};V&&(Y=setTimeout(()=>t(this,void 0,void 0,function*(){var t,n;try{K=!0,X(),W.abort();let n=this.parseError("timeout");const r=yield Promise.resolve(M.timeout(n,null!==(t=e.headers)&&void 0!==t?t:{}));q&&(n=r),N?w._resolve(n):w._reject(n)}catch(t){H(t,null!==(n=e.headers)&&void 0!==n?n:{})}}),V)),this.axios(e).then(e=>t(this,void 0,void 0,function*(){var t,n;if(K)return;X();const{status:r,data:i,headers:o}=e;try{const e=null===(t=b.success)||void 0===t?void 0:t.call(b,i,r,o),s=null===(n=b.login)||void 0===n?void 0:n.call(b,i,r,o);let a=i;if(s){const e=yield Promise.resolve(M.login(i,o));D&&(a=e)}else if(e){const e=yield Promise.resolve(M.success(i,o));I&&(a=e)}else{const e=yield Promise.resolve(M.failure(i,o));$&&(a=e)}w._resolve(a)}catch(e){H(e,o)}})).catch(e=>t(this,void 0,void 0,function*(){var t,n,r,i,o,s,a,u,c,l,f,d,h,p;if(K)return;X();const g=null!==(n=null===(t=e.response)||void 0===t?void 0:t.data)&&void 0!==n?n:{};console.error(`[1Money SDK]: Error(${null!==(r=e.status)&&void 0!==r?r:500}, ${null!==(i=e.code)&&void 0!==i?i:"UNKNOWN"}), Message: ${e.message}, Config: ${null===(o=e.config)||void 0===o?void 0:o.method}, ${null!==(a=null===(s=e.config)||void 0===s?void 0:s.baseURL)&&void 0!==a?a:""}${null!==(c=null===(u=e.config)||void 0===u?void 0:u.url)&&void 0!==c?c:""};`);const y=null!==(f=null===(l=e.response)||void 0===l?void 0:l.status)&&void 0!==f?f:500,m=null!==(h=null===(d=e.response)||void 0===d?void 0:d.headers)&&void 0!==h?h:{};try{let t=g;(null===(p=b.login)||void 0===p?void 0:p.call(b,g,y,m))?(t=yield Promise.resolve(M.login(t,m)),w._resolve(t)):H(e,m)}catch(e){H(e,m)}}))}),w.promiseWrapper}}({isSuccess:(e,t)=>200===t&&0==e.code,isLogin:(e,t)=>401===t||401==e.code,timeout:1e4});function To(e,t){return So.request(Object.assign(Object.assign({},t),{method:"get",url:e}))}function xo(e,t,n){return So.request(Object.assign(Object.assign({},n),{method:"post",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))}function ko(e){const{baseURL:t,headers:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["baseURL","headers"]);So.axios.defaults.baseURL=t||("undefined"!=typeof window?location.origin:void 0),n&&(So.axios.defaults.headers.common=Object.assign(Object.assign({},So.axios.defaults.headers.common),n)),So.setting(r)}var Po={get:To,post:xo,postForm:function(e,t,n){return So.request(Object.assign(Object.assign({},n),{method:"post",url:e,data:t,headers:Object.assign({"Content-Type":"multipart/form-data"},null==n?void 0:n.headers)}))},del:function(e,t,n){return So.request(Object.assign(Object.assign({},n),{method:"delete",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},put:function(e,t,n){return So.request(Object.assign(Object.assign({},n),{method:"put",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},patch:function(e,t,n){return So.request(Object.assign(Object.assign({},n),{method:"patch",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},setInitConfig:ko,axiosStatic:So.axios};const Uo="https://api.1money.network",Bo="v1",Co=`/${Bo}/accounts`,jo={getNonce:e=>To(`${Co}/nonce?address=${e}`,{withCredentials:!1}),getBbNonce:e=>To(`${Co}/bbnonce?address=${e}`,{withCredentials:!1}),getTokenAccount:(e,t)=>To(`${Co}/token_account?address=${e}&token=${t}`,{withCredentials:!1})},Lo=`/${Bo}/checkpoints`,Mo={getNumber:()=>To(`${Lo}/number`,{withCredentials:!1}),getByHash:(e,t=!1)=>To(`${Lo}/by_hash?hash=${e}&full=${t}`,{withCredentials:!1}),getByNumber:(e,t=!1)=>To(`${Lo}/by_number?number=${e}&full=${t}`,{withCredentials:!1}),getReceiptsByNumber:e=>To(`${Lo}/receipts/by_number?number=${e}`,{withCredentials:!1})},Fo=`/${Bo}/tokens`,No={getTokenMetadata:e=>To(`${Fo}/token_metadata?token=${e}`,{withCredentials:!1}),manageBlacklist:e=>xo(`${Fo}/manage_blacklist`,e,{withCredentials:!1}),manageWhitelist:e=>xo(`${Fo}/manage_whitelist`,e,{withCredentials:!1}),burnToken:e=>xo(`${Fo}/burn`,e,{withCredentials:!1}),grantAuthority:e=>xo(`${Fo}/grant_authority`,e,{withCredentials:!1}),issueToken:e=>xo(`${Fo}/issue`,e,{withCredentials:!1}),mintToken:e=>xo(`${Fo}/mint`,e,{withCredentials:!1}),pauseToken:e=>xo(`${Fo}/pause`,e,{withCredentials:!1}),updateMetadata:e=>xo(`${Fo}/update_metadata`,e,{withCredentials:!1}),bridgeAndMint:e=>xo(`${Fo}/bridge_and_mint`,e,{withCredentials:!1}),burnAndBridge:e=>xo(`${Fo}/burn_and_bridge`,e,{withCredentials:!1}),clawbackToken:e=>xo(`${Fo}/clawback`,e,{withCredentials:!1})},Io=`/${Bo}/transactions`,$o={getByHash:e=>To(`${Io}/by_hash?hash=${e}`,{withCredentials:!1}),getReceiptByHash:e=>To(`${Io}/receipt/by_hash?hash=${e}`,{withCredentials:!1}),getFinalizedByHash:e=>To(`${Io}/finalized/by_hash?hash=${e}`,{withCredentials:!1}),estimateFee:(e,t,n,r)=>To(`${Io}/estimate_fee?from=${e}&value=${n}&to=${t}&token=${r}`,{withCredentials:!1}),payment:e=>xo(`${Io}/payment`,e,{withCredentials:!1})},Do=`/${Bo}/chains`,zo={getChainId:()=>To(`${Do}/chain_id`,{withCredentials:!1})};var qo,Ho,Yo,Ko;function Vo(e){const t=(null==e?void 0:e.network)||"mainnet";let n=Uo;switch(t){case"mainnet":n=Uo;break;case"testnet":n="https://api.testnet.1money.network";break;case"local":n="http://localhost:18555"}return ko({baseURL:n,isSuccess:(e,t)=>200===t,timeout:(null==e?void 0:e.timeout)||1e4}),{accounts:jo,checkpoints:Mo,tokens:No,transactions:$o,chain:zo}}!function(e){e.MasterMint="MasterMintBurn",e.MintBurnTokens="MintBurnTokens",e.Pause="Pause",e.ManageList="ManageList",e.UpdateMetadata="UpdateMetadata",e.Bridge="Bridge",e.Clawback="Clawback"}(qo||(qo={})),function(e){e.Grant="Grant",e.Revoke="Revoke"}(Ho||(Ho={})),function(e){e.Add="Add",e.Remove="Remove"}(Yo||(Yo={})),function(e){e.Pause="Pause",e.Unpause="Unpause"}(Ko||(Ko={}));const Wo=BigInt("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0");function Jo(e,t){return Q(we([ve(e),"boolean"==typeof t.v?t.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(t.v),O(t.r),O(t.s)]))}function Xo(e){const n=Q(e.rlpBytes),r=t=>(function(e){if(BigInt(e.s)>Wo)throw new Error("[1Money SDK]: Invalid signature - high S value detected (potential malleability)")}(t),{kind:e.kind,unsigned:e.unsigned,signatureHash:n,txHash:Jo(e.rlpBytes,t),signature:t,toRequest:()=>e.toRequest(e.unsigned,t)});return{kind:e.kind,unsigned:e.unsigned,rlpBytes:e.rlpBytes,signatureHash:n,attachSignature:r,sign:e=>t(this,void 0,void 0,function*(){return r(yield e.signDigest(n))})}}function Go(e){const t=Oe.list([Oe.uint(e.unsigned.chain_id),Oe.uint(e.unsigned.nonce),...e.payloadFields]),n=e.unsigned.memo;let r,i;return null==n?(r=Re(t),i=e.kind):(Pe(n),r=Re(Oe.list([t,Ue(n)])),i=`${e.kind}_v2`),Xo({kind:i,unsigned:e.unsigned,rlpBytes:r,toRequest:e.toRequest})}const Zo=/^\d+$/;function Qo(e,t){throw new Error(`[1Money SDK]: Invalid ${e}: ${String(t)}`)}function es(e,t){(!Number.isSafeInteger(t)||t<=0)&&Qo(e,t)}function ts(e,t){(!Number.isSafeInteger(t)||t<0)&&Qo(e,t)}function ns(e,t){Zo.test(t)||Qo(e,t)}function rs(e,t){ie(t)||Qo(e,t)}function is(e){es("chain_id",e.chain_id),ts("nonce",e.nonce)}function os(e){rs("recipient",e.recipient),ns("value",e.value),rs("token",e.token)}function ss(e){ns("value",e.value),rs("token",e.token)}function as(e){return is(e),os(e),Go({kind:"payment",unsigned:e,payloadFields:[Oe.address(e.recipient),Oe.uint(e.value),Oe.address(e.token)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function us(e){var t,n;is(e),rs("authority_address",e.authority_address),rs("token",e.token),t="value",void 0!==(n=e.value)&&ns(t,n);const r=[Oe.string(e.action),Oe.string(e.authority_type),Oe.address(e.authority_address),Oe.address(e.token)];return void 0!==e.value&&r.push(Oe.uint(e.value)),Go({kind:"tokenAuthority",unsigned:e,payloadFields:r,toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function cs(e){return is(e),os(e),es("source_chain_id",e.source_chain_id),Go({kind:"tokenBridgeAndMint",unsigned:e,payloadFields:[Oe.address(e.recipient),Oe.uint(e.value),Oe.address(e.token),Oe.uint(e.source_chain_id),Oe.string(e.source_tx_hash),Oe.string(e.bridge_metadata)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ls(e){return is(e),ss(e),Go({kind:"tokenBurn",unsigned:e,payloadFields:[Oe.uint(e.value),Oe.address(e.token)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function fs(e){return is(e),rs("sender",e.sender),ss(e),es("destination_chain_id",e.destination_chain_id),rs("destination_address",e.destination_address),ns("escrow_fee",e.escrow_fee),Go({kind:"tokenBurnAndBridge",unsigned:e,payloadFields:[Oe.address(e.sender),Oe.uint(e.value),Oe.address(e.token),Oe.uint(e.destination_chain_id),Oe.string(e.destination_address),Oe.uint(e.escrow_fee),Oe.string(e.bridge_metadata),Oe.hex(e.bridge_param)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ds(e){return is(e),os(e),rs("from",e.from),Go({kind:"tokenClawback",unsigned:e,payloadFields:[Oe.address(e.token),Oe.address(e.from),Oe.address(e.recipient),Oe.uint(e.value)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function hs(e){var t;is(e),ts("decimals",e.decimals),rs("master_authority",e.master_authority);const n=null===(t=e.clawback_enabled)||void 0===t||t,r=Object.assign(Object.assign({},e),{clawback_enabled:n});return Go({kind:"tokenIssue",unsigned:r,payloadFields:[Oe.string(r.symbol),Oe.string(r.name),Oe.uint(r.decimals),Oe.address(r.master_authority),Oe.bool(r.is_private),Oe.bool(n)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ps(e){return is(e),rs("address",e.address),rs("token",e.token),Go({kind:"tokenManageList",unsigned:e,payloadFields:[Oe.string(e.action),Oe.address(e.address),Oe.address(e.token)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function gs(e){is(e),rs("token",e.token);const t=e.additional_metadata.map(e=>Oe.list([Oe.string(e.key),Oe.string(e.value)]));return Go({kind:"tokenMetadata",unsigned:e,payloadFields:[Oe.string(e.name),Oe.string(e.uri),Oe.address(e.token),Oe.list(t)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ys(e){return is(e),os(e),Go({kind:"tokenMint",unsigned:e,payloadFields:[Oe.address(e.recipient),Oe.uint(e.value),Oe.address(e.token)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ms(e){return is(e),rs("token",e.token),Go({kind:"tokenPause",unsigned:e,payloadFields:[Oe.string(e.action),Oe.address(e.token)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}const bs=/^0x[0-9a-fA-F]{64}$/;const ws={payment:as,tokenManageList:ps,tokenBurn:ls,tokenAuthority:us,tokenIssue:hs,tokenMint:ys,tokenPause:ms,tokenMetadata:gs,tokenBridgeAndMint:cs,tokenBurnAndBridge:fs,tokenClawback:ds};var vs={api:Vo,client:Po};e.MEMO_DATA_MAX_BYTES=256,e.MEMO_FORMAT_MAX_BYTES=64,e.MEMO_RLP_HEADER_ALLOWANCE=16,e.MEMO_TOTAL_MAX_BYTES=512,e.MEMO_TYPE_MAX_BYTES=128,e.MemoValidationError=Se,e.TransactionBuilder=ws,e._typeof=Ft,e.api=Vo,e.calcSignedTxHash=Jo,e.calcTxHash=function(e,t){const n=Nt(e),r=we("boolean"==typeof t.v?t.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(t.v)),i=we(O(t.r)),o=we(O(t.s)),s=new Uint8Array(r.length+i.length+o.length);s.set(r,0),s.set(i,r.length),s.set(o,r.length+i.length);const a=function(e){if(e<56)return Uint8Array.from([192+e]);{const t=[];let n=e;for(;n>0;)t.unshift(255&n),n>>=8;return Uint8Array.from([247+t.length,...t])}}(n.length+s.length),u=new Uint8Array(a.length+n.length+s.length);return u.set(a,0),u.set(n,a.length),u.set(s,a.length+n.length),Q(u)},e.client=Po,e.createPreparedTx=Xo,e.createPrivateKeySigner=function(e){const n=O(e);return{signDigest:e=>t(this,void 0,void 0,function*(){if(!bs.test(e))throw new Error(`[1Money SDK]: Invalid digest: ${e}`);const t=yield Pt(O(e),n,{lowS:!0}),r=t.toCompactRawBytes(),i=r.subarray(0,32),o=r.subarray(32,64);return{r:y(i),s:y(o),v:t.recovery}})}},e.default=vs,e.deriveTokenAddress=function(e,t){const n=e.startsWith("0x")?O(e):R(e),r=t.startsWith("0x")?O(t):R(t),i=new Uint8Array(n.length+r.length);return i.set(n,0),i.set(r,n.length),y(O(Q(i)).slice(12))},e.encodePayload=Nt,e.encodeRlpPayload=Re,e.memoRlpList=Ue,e.preparePaymentTx=as,e.prepareTokenAuthorityTx=us,e.prepareTokenBridgeAndMintTx=cs,e.prepareTokenBurnAndBridgeTx=fs,e.prepareTokenBurnTx=ls,e.prepareTokenClawbackTx=ds,e.prepareTokenIssueTx=hs,e.prepareTokenManageListTx=ps,e.prepareTokenMetadataTx=gs,e.prepareTokenMintTx=ys,e.prepareTokenPauseTx=ms,e.rlpValue=Oe,e.safePromiseAll=function(e){return e&&e.length?Promise.all(e):Promise.resolve([])},e.safePromiseLine=function(e){return t(this,void 0,void 0,function*(){if(!e||!e.length)return[];const t=[];for(let n=0;n<e.length;n++)try{t.push(yield e[n](n))}catch(e){}return t})},e.signMessage=function(e,n){return t(this,void 0,void 0,function*(){const t=O(Q(Nt(e))),r=O(n),i=yield Pt(t,r,{lowS:!0}),o=i.toCompactRawBytes(),s=o.subarray(0,32),a=o.subarray(32,64);return{r:y(s),s:y(a),v:i.recovery}})},e.toHex=function(e){const t=Ft(e);try{switch(t){case"boolean":return g(e);case"number":case"bigint":return m(e);case"string":if(/^-?\d+$/.test(e))try{return m(BigInt(e))}catch(t){return m(+e)}return w(e);case"uint8array":case"uint16array":case"uint32array":case"int8array":case"int16array":case"int32array":case"arraybuffer":return y(e);case"array":return 0===e.length?"0x":e.every(e=>"number"==typeof e)?y(Uint8Array.from(e)):y(R(JSON.stringify(e)));default:return y(R(JSON.stringify(e)))}}catch(e){throw new Error(`[1Money SDK]: toHex conversion failed: ${e instanceof Error?e.message:String(e)}`)}},e.validateMemo=Pe,Object.defineProperty(e,"__esModule",{value:!0})});
3
+ var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}keccak(){Se||Pe(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const r=(t+8)%10,i=(t+2)%10,o=n[i],s=n[i+1],a=qe(o,s,1)^n[r],u=He(o,s,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=a,e[t+n+1]^=u}let t=e[2],i=e[3];for(let n=0;n<24;n++){const r=Ue[n],o=qe(t,i,r),s=He(t,i,r),a=Be[n];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=De[r],e[1]^=ze[r]}n.fill(0)}(this.state32,this.rounds),Se||Pe(this.state32),this.posOut=0,this.pos=0}update(e){Ae(this);const{blockLen:t,state:n}=this,r=(e=ke(e)).length;for(let i=0;i<r;){const o=Math.min(t-this.pos,r-i);for(let t=0;t<o;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,128&t&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){Ae(this,!1),Ee(e),this.finish();const t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ve(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(function(e,t){Ee(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new Ye(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Ve=((e,t,n)=>function(e){const t=t=>e().update(ke(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}(()=>new Ye(t,e,n)))(1,136,32);function We(e,t){const n=t||"hex",r=Ve(F(e,{strict:!1})?ge(e):e);return"bytes"===n?r:function(e,t={}){return"number"==typeof e||"bigint"==typeof e?fe(e,t):"string"==typeof e?he(e,t):"boolean"==typeof e?ce(e,t):le(e,t)}(r)}function Ke(e){return We(ge(e))}const Je=e=>{var t;return function(e){let t=!0,n="",r=0,i="",o=!1;for(let s=0;s<e.length;s++){const a=e[s];if(["(",")",","].includes(a)&&(t=!0),"("===a&&r++,")"===a&&r--,t)if(0!==r)" "!==a?(i+=a,n+=a):","!==e[s-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===a&&["event","function",""].includes(i))i="";else if(i+=a,")"===a){o=!0;break}}if(!o)throw new Y("Unable to normalize signature.");return i}("string"==typeof e?e:"function"===(t=e).type?`function ${t.name}(${c(t.inputs)})${t.stateMutability&&"nonpayable"!==t.stateMutability?` ${t.stateMutability}`:""}${t.outputs?.length?` returns (${c(t.outputs)})`:""}`:"event"===t.type?`event ${t.name}(${c(t.inputs)})`:"error"===t.type?`error ${t.name}(${c(t.inputs)})`:"constructor"===t.type?`constructor(${c(t.inputs)})${"payable"===t.stateMutability?" payable":""}`:"fallback"===t.type?"fallback() external"+("payable"===t.stateMutability?" payable":""):"receive() external payable")};function Xe(e){return Ke(Je(e))}const Ge=Xe;class Ze extends Y{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class Qe extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const et=new Qe(8192);const tt=/^0x[a-fA-F0-9]{40}$/,nt=new Qe(8192);function rt(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(nt.has(r))return nt.get(r);const i=!(!tt.test(e)||e.toLowerCase()!==e&&n&&function(e,t){if(et.has(`${e}.${t}`))return et.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=We(we(n),"bytes"),i=n.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&r[e>>1])>=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());const o=`0x${i.join("")}`;return et.set(`${e}.${t}`,o),o}(e)!==e);return nt.set(r,i),i}function it(e){return"string"==typeof e[0]?ot(e):function(e){let t=0;for(const n of e)t+=n.length;const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(e)}function ot(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}function st(e,t,n,{strict:r}={}){return F(e,{strict:!1})?function(e,t,n,{strict:r}={}){at(e,t);const i=`0x${e.replace("0x","").slice(2*(t??0),2*(n??e.length))}`;r&&ut(i,t,n);return i}(e,t,n,{strict:r}):function(e,t,n,{strict:r}={}){at(e,t);const i=e.slice(t,n);r&&ut(i,t,n);return i}(e,t,n,{strict:r})}function at(e,t){if("number"==typeof t&&t>0&&t>D(e)-1)throw new te({offset:t,position:"start",size:D(e)})}function ut(e,t,n){if("number"==typeof t&&"number"==typeof n&&D(e)!==n-t)throw new te({offset:n,position:"end",size:D(e)})}const ct=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function lt(e,t){if(e.length!==t.length)throw new J({expectedLength:e.length,givenLength:t.length});const n=function({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(ft({param:e[r],value:t[r]}));return n}({params:e,values:t}),r=dt(n);return 0===r.length?"0x":r}function ft({param:e,value:t}){const n=function(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}(e.type);if(n){const[r,i]=n;return function(e,{length:t,param:n}){const r=null===t;if(!Array.isArray(e))throw new Q(e);if(!r&&e.length!==t)throw new W({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let i=!1;const o=[];for(let t=0;t<e.length;t++){const r=ft({param:n,value:e[t]});r.dynamic&&(i=!0),o.push(r)}if(r||i){const e=dt(o);if(r){const t=fe(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?it([t,e]):t}}if(i)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:it(o.map(({encoded:e})=>e))}}(t,{length:r,param:{...e,type:i}})}if("tuple"===e.type)return function(e,{param:t}){let n=!1;const r=[];for(let i=0;i<t.components.length;i++){const o=t.components[i],s=ft({param:o,value:e[Array.isArray(e)?i:o.name]});r.push(s),s.dynamic&&(n=!0)}return{dynamic:n,encoded:n?dt(r):it(r.map(({encoded:e})=>e))}}(t,{param:e});if("address"===e.type)return function(e){if(!rt(e))throw new Ze({address:e});return{dynamic:!1,encoded:ie(e.toLowerCase())}}(t);if("bool"===e.type)return function(e){if("boolean"!=typeof e)throw new Y(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ie(ce(e))}}(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const n=e.type.startsWith("int"),[,,r="256"]=ct.exec(e.type)??[];return function(e,{signed:t,size:n=256}){if("number"==typeof n){const r=2n**(BigInt(n)-(t?1n:0n))-1n,i=t?-r-1n:0n;if(e>r||e<i)throw new oe({max:r.toString(),min:i.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:fe(e,{size:32,signed:t})}}(t,{signed:n,size:Number(r)})}if(e.type.startsWith("bytes"))return function(e,{param:t}){const[,n]=t.type.split("bytes"),r=D(e);if(!n){let t=e;return r%32!=0&&(t=ie(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:it([ie(fe(r,{size:32})),t])}}if(r!==Number.parseInt(n))throw new K({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:ie(e,{dir:"right"})}}(t,{param:e});if("string"===e.type)return function(e){const t=he(e),n=Math.ceil(D(t)/32),r=[];for(let e=0;e<n;e++)r.push(ie(st(t,32*e,32*(e+1)),{dir:"right"}));return{dynamic:!0,encoded:it([ie(fe(D(t),{size:32})),...r])}}(t);throw new Z(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function dt(e){let t=0;for(let n=0;n<e.length;n++){const{dynamic:r,encoded:i}=e[n];t+=r?32:D(i)}const n=[],r=[];let i=0;for(let o=0;o<e.length;o++){const{dynamic:s,encoded:a}=e[o];s?(n.push(fe(t+i,{size:32})),r.push(a),i+=D(a)):n.push(a)}return it([...n,...r])}const ht=e=>st(Xe(e),0,4);function pt(e,t){const n=typeof e,r=t.type;switch(r){case"address":return rt(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every((t,n)=>pt(Object.values(e)[n],t)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every(e=>pt(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})))}}function gt(e,t,n){for(const r in e){const i=e[r],o=t[r];if("tuple"===i.type&&"tuple"===o.type&&"components"in i&&"components"in o)return gt(i.components,o.components,n[r]);const s=[i.type,o.type];if((()=>!(!s.includes("address")||!s.includes("bytes20"))||(s.includes("address")&&s.includes("string")||!(!s.includes("address")||!s.includes("bytes")))&&rt(n[r],{strict:!1}))())return s}}const yt="/docs/contract/encodeFunctionData";function mt(e){const{abi:t,args:n,functionName:r}=e;let i=t[0];if(r){const e=function(e){const{abi:t,args:n=[],name:r}=e,i=F(r,{strict:!1}),o=t.filter(e=>i?"function"===e.type?ht(e)===r:"event"===e.type&&Ge(e)===r:"name"in e&&e.name===r);if(0===o.length)return;if(1===o.length)return o[0];let s;for(const e of o){if(!("inputs"in e))continue;if(!n||0===n.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==n.length)continue;const t=n.every((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&pt(t,r)});if(t){if(s&&"inputs"in s&&s.inputs){const t=gt(e.inputs,s.inputs,n);if(t)throw new G({abiItem:e,type:t[0]},{abiItem:s,type:t[1]})}s=e}}return s||o[0]}({abi:t,args:n,name:r});if(!e)throw new X(r,{docsPath:yt});i=e}if("function"!==i.type)throw new X(void 0,{docsPath:yt});return{abi:[i],functionName:ht(N(i))}}class bt extends Error{constructor(e,t,n){super(t??e.code),this.type=e,void 0!==n&&(this.stack=n)}getMetadata(){return this.type}toObject(){return{type:this.getMetadata(),message:this.message??"",stack:this.stack??"",className:this.constructor.name}}}function wt(e,t){return new bt({code:"ETHEREUMJS_DEFAULT_ERROR_CODE"},e,t)}function vt(e){if(0===e[0])throw wt("invalid RLP: extra zeros");return function(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw wt("Invalid byte sequence");return t}(function(e){let t="";for(let n=0;n<e.length;n++)t+=_t[e[n]];return t}(e))}function Et(e,t){if(e<56)return Uint8Array.from([e+t]);const n=Pt(e),r=Pt(t+55+n.length/2);return Uint8Array.from(St(r+n))}function At(e,t,n){if(n>e.length)throw wt("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,n)}function Ot(e){let t,n,r,i,o;const s=[],a=e[0];if(a<=127)return{data:e.slice(0,1),remainder:e.subarray(1)};if(a<=183){if(t=a-127,r=128===a?Uint8Array.from([]):At(e,1,t),2===t&&r[0]<128)throw wt("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:r,remainder:e.subarray(t)}}if(a<=191){if(n=a-182,e.length-1<n)throw wt("invalid RLP: not enough bytes for string length");if(t=vt(At(e,1,n)),t<=55)throw wt("invalid RLP: expected string length to be greater than 55");return r=At(e,n,t+n),{data:r,remainder:e.subarray(t+n)}}if(a<=247){for(t=a-191,i=At(e,1,t);i.length;)o=Ot(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.subarray(t)}}{if(n=a-246,t=vt(At(e,1,n)),t<56)throw wt("invalid RLP: encoded list too short");const r=n+t;if(r>e.length)throw wt("invalid RLP: total length is larger than the data");for(i=At(e,n,r);i.length;)o=Ot(i),s.push(o.data),i=o.remainder;return{data:s,remainder:e.subarray(r)}}}const _t=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const xt={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Rt(e){return e>=xt._0&&e<=xt._9?e-xt._0:e>=xt._A&&e<=xt._F?e-(xt._A-10):e>=xt._a&&e<=xt._f?e-(xt._a-10):void 0}function St(e){if("0x"===e.slice(0,2)&&(e=e.slice(0,2)),"string"!=typeof e)throw wt("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw wt("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=Rt(e.charCodeAt(i)),o=Rt(e.charCodeAt(i+1));if(void 0===n||void 0===o){throw wt('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i)}r[t]=16*n+o}return r}function Tt(...e){if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}function Pt(e){if(e<0)throw wt("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function kt(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function $t(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return kt(e)?St((n="string"!=typeof(r=e)?r:kt(r)?r.slice(2):r).length%2?`0${n}`:n):(t=e,(new TextEncoder).encode(t));var t,n,r;if("number"==typeof e||"bigint"==typeof e)return e?St(Pt(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw wt("toBytes: received unsupported type "+typeof e)}function Bt(e){if(Array.isArray(e)){const t=[];let n=0;for(let r=0;r<e.length;r++){const i=Bt(e[r]);t.push(i),n+=i.length}return Tt(Et(n,192),...t)}const t=$t(e);return 1===t.length&&t[0]<128?t:Tt(Et(t.length,128),t)}function Ut(e,t=!1){if(null==e||0===e.length)return Uint8Array.from([]);const n=Ot($t(e));if(t)return{data:n.data,remainder:n.remainder.slice()};if(0!==n.remainder.length)throw wt("invalid RLP: remainder must be zero");return n.data}const Ct=/^0x[0-9a-fA-F]{40}$/,It=/^0x([0-9a-fA-F]{2})*$/;function jt(e){if(null==e)return new Uint8Array([]);switch(e.kind){case"string":return(new TextEncoder).encode(e.value);case"uint":{if("string"==typeof e.value&&!/^\d+$/.test(e.value))throw new Error(`[1Money SDK]: Invalid uint string: ${e.value}`);const t="bigint"==typeof e.value?e.value:BigInt(e.value);return t===BigInt(0)?new Uint8Array([]):be(fe(t))}case"bool":return e.value?Uint8Array.from([1]):new Uint8Array([]);case"bytes":return e.value;case"list":return e.value.map(e=>jt(e));case"address":case"hex":if(!It.test(e.value))throw new Error(`[1Money SDK]: Invalid hex value: ${e.value}`);if("address"===e.kind&&!Ct.test(e.value))throw new Error(`[1Money SDK]: Invalid address value: ${e.value}`);return"0x"===e.value?new Uint8Array([]):be(e.value)}}const Mt={address:e=>({kind:"address",value:e}),hex:e=>({kind:"hex",value:e}),string:e=>({kind:"string",value:e}),uint:e=>({kind:"uint",value:e}),bool:e=>({kind:"bool",value:e}),bytes:e=>({kind:"bytes",value:e}),list:e=>({kind:"list",value:e})};function Nt(e){return Bt(jt(e))}class Lt extends Error{constructor(e,t){super(t),this.code=e,this.name="MemoValidationError"}}const Ft=new TextEncoder,Dt=/^[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]*$/;function zt(e){return Ft.encode(e).length}function qt(e){var t,n,r;const i=null!==(t=e.type)&&void 0!==t?t:"";if(i.length>0){const e=zt(i);if(e>128)throw new Lt("MEMO_TYPE_TOO_LONG",`memo.type exceeds 128 bytes (got ${e})`);if(!Dt.test(i))throw new Lt("MEMO_TYPE_INVALID_CHARS","memo.type contains non-URL-safe characters")}const o=null!==(n=e.format)&&void 0!==n?n:"";if(o.length>0){const e=zt(o);if(e>64)throw new Lt("MEMO_FORMAT_TOO_LONG",`memo.format exceeds 64 bytes (got ${e})`);if(!Dt.test(o))throw new Lt("MEMO_FORMAT_INVALID_CHARS","memo.format contains non-URL-safe characters")}const s=null!==(r=e.data)&&void 0!==r?r:"";if(s.length>0){const e=zt(s);if(e>256)throw new Lt("MEMO_DATA_TOO_LONG",`memo.data exceeds 256 bytes (got ${e})`);for(const e of s){const t=e.codePointAt(0);if(0===t||t<=31||t>=127&&t<=159||t>=55296&&t<=57343)throw new Lt("MEMO_DATA_CONTROL_CHARS","memo.data contains null bytes or Unicode control/surrogate codepoints")}}const a=function(e){var t,n,r;return zt(null!==(t=e.type)&&void 0!==t?t:"")+zt(null!==(n=e.format)&&void 0!==n?n:"")+zt(null!==(r=e.data)&&void 0!==r?r:"")+16}(e);if(a>512)throw new Lt("MEMO_TOO_LARGE",`memo object exceeds 512 bytes (got ${a})`)}function Ht(e){var t,n,r;return Mt.list([Mt.string(null!==(t=e.type)&&void 0!==t?t:""),Mt.string(null!==(n=e.format)&&void 0!==n?n:""),Mt.string(null!==(r=e.data)&&void 0!==r?r:"")])}/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
4
+ const{p:Yt,n:Vt,Gx:Wt,Gy:Kt,b:Jt}={p:0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,n:0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,b:7n,Gx:0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n,Gy:0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n},Xt=32,Gt=64,Zt=(e="")=>{throw new Error(e)},Qt=e=>"bigint"==typeof e,en=e=>"string"==typeof e,tn=(e,t)=>!(e=>e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name)(e)||"number"==typeof t&&t>0&&e.length!==t?Zt("Uint8Array expected"):e,nn=e=>new Uint8Array(e),rn=(e,t)=>e.toString(16).padStart(t,"0"),on=e=>Array.from(tn(e)).map(e=>rn(e,2)).join(""),sn=48,an=57,un=65,cn=70,ln=97,fn=102,dn=e=>e>=sn&&e<=an?e-sn:e>=un&&e<=cn?e-(un-10):e>=ln&&e<=fn?e-(ln-10):void 0,hn=e=>{const t="hex invalid";if(!en(e))return Zt(t);const n=e.length,r=n/2;if(n%2)return Zt(t);const i=nn(r);for(let n=0,o=0;n<r;n++,o+=2){const r=dn(e.charCodeAt(o)),s=dn(e.charCodeAt(o+1));if(void 0===r||void 0===s)return Zt(t);i[n]=16*r+s}return i},pn=(e,t)=>{return tn(en(e)?hn(e):(n=tn(e),Uint8Array.from(n)),t);var n},gn=()=>globalThis?.crypto,yn=(...e)=>{const t=nn(e.reduce((e,t)=>e+tn(t).length,0));let n=0;return e.forEach(e=>{t.set(e,n),n+=e.length}),t},mn=(e=Xt)=>gn().getRandomValues(nn(e)),bn=BigInt,wn=(e,t,n,r="bad number: out of range")=>Qt(e)&&t<=e&&e<n?e:Zt(r),vn=(e,t=Yt)=>{const n=e%t;return n>=0n?n:t+n},En=e=>vn(e,Vt),An=(e,t)=>{(0n===e||t<=0n)&&Zt("no inverse n="+e+" mod="+t);let n=vn(e,t),r=t,i=0n,o=1n;for(;0n!==n;){const e=r%n,t=i-o*(r/n);r=n,n=e,i=o,o=t}return 1n===r?vn(i,t):Zt("no inverse")},On=e=>e instanceof $n?e:Zt("Point expected"),_n=e=>vn(vn(e*e)*e+Jt),xn=e=>wn(e,0n,Yt),Rn=e=>wn(e,1n,Yt),Sn=e=>wn(e,1n,Vt),Tn=e=>0n==(1n&e),Pn=e=>Uint8Array.of(e),kn=e=>Pn(Tn(e)?2:3);class $n{static BASE;static ZERO;px;py;pz;constructor(e,t,n){this.px=xn(e),this.py=Rn(t),this.pz=xn(n),Object.freeze(this)}static fromBytes(e){let t;tn(e);const n=e[0],r=e.subarray(1),i=In(r,0,Xt),o=e.length;if(33===o&&[2,3].includes(n)){let e=(e=>{const t=_n(Rn(e));let n=1n;for(let e=t,r=(Yt+1n)/4n;r>0n;r>>=1n)1n&r&&(n=n*e%Yt),e=e*e%Yt;return vn(n*n)===t?n:Zt("sqrt invalid")})(i);const r=Tn(e);Tn(bn(n))!==r&&(e=vn(-e)),t=new $n(i,e,1n)}return 65===o&&4===n&&(t=new $n(i,In(r,Xt,Gt),1n)),t?t.assertValidity():Zt("bad point: not on curve")}equals(e){const{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=On(e),a=vn(t*s),u=vn(i*r),c=vn(n*s),l=vn(o*r);return a===u&&c===l}is0(){return this.equals(Un)}negate(){return new $n(this.px,vn(-this.py),this.pz)}double(){return this.add(this)}add(e){const{px:t,py:n,pz:r}=this,{px:i,py:o,pz:s}=On(e);let a=0n,u=0n,c=0n;const l=vn(3n*Jt);let f=vn(t*i),d=vn(n*o),h=vn(r*s),p=vn(t+n),g=vn(i+o);p=vn(p*g),g=vn(f+d),p=vn(p-g),g=vn(t+r);let y=vn(i+s);return g=vn(g*y),y=vn(f+h),g=vn(g-y),y=vn(n+r),a=vn(o+s),y=vn(y*a),a=vn(d+h),y=vn(y-a),c=vn(0n*g),a=vn(l*h),c=vn(a+c),a=vn(d-c),c=vn(d+c),u=vn(a*c),d=vn(f+f),d=vn(d+f),h=vn(0n*h),g=vn(l*g),d=vn(d+h),h=vn(f-h),h=vn(0n*h),g=vn(g+h),f=vn(d*g),u=vn(u+f),f=vn(y*g),a=vn(p*a),a=vn(a-f),f=vn(p*d),c=vn(y*c),c=vn(c+f),new $n(a,u,c)}multiply(e,t=!0){if(!t&&0n===e)return Un;if(Sn(e),1n===e)return this;if(this.equals(Bn))return Xn(e).p;let n=Un,r=Bn;for(let i=this;e>0n;i=i.double(),e>>=1n)1n&e?n=n.add(i):t&&(r=r.add(i));return n}toAffine(){const{px:e,py:t,pz:n}=this;if(this.equals(Un))return{x:0n,y:0n};if(1n===n)return{x:e,y:t};const r=An(n,Yt);return 1n!==vn(n*r)&&Zt("inverse invalid"),{x:vn(e*r),y:vn(t*r)}}assertValidity(){const{x:e,y:t}=this.toAffine();return Rn(e),Rn(t),vn(t*t)===_n(e)?this:Zt("bad point: not on curve")}toBytes(e=!0){const{x:t,y:n}=this.assertValidity().toAffine(),r=Mn(t);return e?yn(kn(n),r):yn(Pn(4),r,Mn(n))}static fromAffine(e){const{x:t,y:n}=e;return 0n===t&&0n===n?Un:new $n(t,n,1n)}toHex(e){return on(this.toBytes(e))}static fromPrivateKey(e){return Bn.multiply(Nn(e))}static fromHex(e){return $n.fromBytes(pn(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}toRawBytes(e){return this.toBytes(e)}}const Bn=new $n(Wt,Kt,1n),Un=new $n(0n,1n,0n);$n.BASE=Bn,$n.ZERO=Un;const Cn=e=>bn("0x"+(on(e)||"0")),In=(e,t,n)=>Cn(e.subarray(t,n)),jn=2n**256n,Mn=e=>hn(rn(wn(e,0n,jn),Gt)),Nn=e=>{const t=Qt(e)?e:Cn(pn(e,Xt));return wn(t,1n,Vt,"private key invalid 3")},Ln=e=>e>Vt>>1n;class Fn{r;s;recovery;constructor(e,t,n){this.r=Sn(e),this.s=Sn(t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e){tn(e,Gt);const t=In(e,0,Xt),n=In(e,Xt,Gt);return new Fn(t,n)}toBytes(){const{r:e,s:t}=this;return yn(Mn(e),Mn(t))}addRecoveryBit(e){return new Fn(this.r,this.s,e)}hasHighS(){return Ln(this.s)}toCompactRawBytes(){return this.toBytes()}toCompactHex(){return on(this.toBytes())}recoverPublicKey(e){return Yn(this,e)}static fromCompact(e){return Fn.fromBytes(pn(e,Gt))}assertValidity(){return this}normalizeS(){const{r:e,s:t,recovery:n}=this;return Ln(t)?new Fn(e,En(-t),n):this}}const Dn=e=>{const t=8*e.length-256;t>1024&&Zt("msg invalid");const n=Cn(e);return t>0?n>>bn(t):n},zn=e=>En(Dn(tn(e))),qn={lowS:!0},Hn=async(e,t,n=qn)=>{const{seed:r,k2sig:i}=((e,t,n=qn)=>{["der","recovered","canonical"].some(e=>e in n)&&Zt("option not supported");let{lowS:r,extraEntropy:i}=n;null==r&&(r=!0);const o=Mn,s=zn(pn(e)),a=o(s),u=Nn(t),c=[o(u),a];i&&c.push(!0===i?mn(Xt):pn(i));const l=s;return{seed:yn(...c),k2sig:e=>{const t=Dn(e);if(!(1n<=t&&t<Vt))return;const n=Bn.multiply(t).toAffine(),i=En(n.x);if(0n===i)return;const o=An(t,Vt),s=En(o*En(l+En(u*i)));if(0n===s)return;let a=s,c=(n.x===i?0:2)|Number(1n&n.y);return r&&Ln(s)&&(a=En(-s),c^=1),new Fn(i,a,c)}}})(e,t,n),o=await(()=>{let e=nn(Xt),t=nn(Xt),n=0;const r=nn(0),i=()=>{e.fill(1),t.fill(0),n=0};{const o=(...n)=>Vn.hmacSha256Async(t,e,...n),s=async(n=r)=>{t=await o(Pn(0),n),e=await o(),0!==n.length&&(t=await o(Pn(1),n),e=await o())},a=async()=>(n++>=1e3&&Zt("drbg: tried 1000 values"),e=await o(),e);return async(e,t)=>{let n;for(i(),await s(e);!(n=t(await a()));)await s();return i(),n}}})()(r,i);return o},Yn=(e,t)=>{const{r:n,s:r,recovery:i}=e;[0,1,2,3].includes(i)||Zt("recovery id invalid");const o=zn(pn(t,Xt)),s=2===i||3===i?n+Vt:n;Rn(s);const a=kn(bn(i)),u=yn(a,Mn(s)),c=$n.fromBytes(u),l=An(s,Vt);return((e,t,n)=>Bn.multiply(t,!1).add(e.multiply(n,!1)).assertValidity())(c,En(-o*l),En(r*l))},Vn={hexToBytes:hn,bytesToHex:on,concatBytes:yn,bytesToNumberBE:Cn,numberToBytesBE:Mn,mod:vn,invert:An,hmacSha256Async:async(e,...t)=>{const n=gn()?.subtle??Zt("crypto.subtle must be defined"),r="HMAC",i=await n.importKey("raw",e,{name:r,hash:{name:"SHA-256"}},!1,["sign"]);return nn(await n.sign(r,i,yn(...t)))},hmacSha256Sync:void 0,hashToPrivateKey:e=>{((e=pn(e)).length<40||e.length>1024)&&Zt("expected 40-1024b");const t=vn(Cn(e),Vt-1n);return Mn(t+1n)},randomBytes:mn},Wn=Math.ceil(32)+1;let Kn;const Jn=(e,t)=>{const n=t.negate();return e?n:t},Xn=e=>{const t=Kn||(Kn=(()=>{const e=[];let t=Bn,n=t;for(let r=0;r<Wn;r++){n=t,e.push(n);for(let r=1;r<128;r++)n=n.add(t),e.push(n);t=n.double()}return e})());let n=Un,r=Bn;const i=bn(255),o=bn(8);for(let s=0;s<Wn;s++){let a=Number(e&i);e>>=o,a>128&&(a-=256,e+=1n);const u=128*s,c=u,l=u+Math.abs(a)-1,f=s%2!=0,d=a<0;0===a?r=r.add(Jn(f,t[c])):n=n.add(Jn(d,t[l]))}return{p:n,f:r}};function Gn(e){if("object"!=typeof e)return(typeof e).toLowerCase();const t=Object.prototype.toString.call(e);return t.slice(8,t.length-1).toLowerCase()}function Zn(e){if("array"===Gn(e)){return Bt(e.map(e=>"string"===Gn(e)?/^0x([0-9a-fA-F]{2})*$/.test(e)?"0x"===e?new Uint8Array([]):be(e):/^\d+$/.test(e)?"0"===e?new Uint8Array([]):be(fe(BigInt(e))):(new TextEncoder).encode(e):"number"===Gn(e)||"bigint"===Gn(e)?0===e||e===BigInt(0)?new Uint8Array([]):be(fe(e)):"boolean"===Gn(e)?e?Uint8Array.from([1]):new Uint8Array([]):e))}return"boolean"===Gn(e)?Bt(e?Uint8Array.from([1]):new Uint8Array([])):Bt(e)}var Qn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function er(){throw new Error("setTimeout has not been defined")}function tr(){throw new Error("clearTimeout has not been defined")}var nr=er,rr=tr;function ir(e){if(nr===setTimeout)return setTimeout(e,0);if((nr===er||!nr)&&setTimeout)return nr=setTimeout,setTimeout(e,0);try{return nr(e,0)}catch(t){try{return nr.call(null,e,0)}catch(t){return nr.call(this,e,0)}}}"function"==typeof Qn.setTimeout&&(nr=setTimeout),"function"==typeof Qn.clearTimeout&&(rr=clearTimeout);var or,sr=[],ar=!1,ur=-1;function cr(){ar&&or&&(ar=!1,or.length?sr=or.concat(sr):ur=-1,sr.length&&lr())}function lr(){if(!ar){var e=ir(cr);ar=!0;for(var t=sr.length;t;){for(or=sr,sr=[];++ur<t;)or&&or[ur].run();ur=-1,t=sr.length}or=null,ar=!1,function(e){if(rr===clearTimeout)return clearTimeout(e);if((rr===tr||!rr)&&clearTimeout)return rr=clearTimeout,clearTimeout(e);try{return rr(e)}catch(t){try{return rr.call(null,e)}catch(t){return rr.call(this,e)}}}(e)}}function fr(e,t){this.fun=e,this.array=t}fr.prototype.run=function(){this.fun.apply(null,this.array)};var dr=Qn.performance||{};dr.now||dr.mozNow||dr.msNow||dr.oNow||dr.webkitNow;var hr={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];sr.push(new fr(e,t)),1!==sr.length||ar||ir(lr)}};function pr(e,t){return function(){return e.apply(t,arguments)}}const{toString:gr}=Object.prototype,{getPrototypeOf:yr}=Object,{iterator:mr,toStringTag:br}=Symbol,wr=(vr=Object.create(null),e=>{const t=gr.call(e);return vr[t]||(vr[t]=t.slice(8,-1).toLowerCase())});var vr;const Er=e=>(e=e.toLowerCase(),t=>wr(t)===e),Ar=e=>t=>typeof t===e,{isArray:Or}=Array,_r=Ar("undefined");function xr(e){return null!==e&&!_r(e)&&null!==e.constructor&&!_r(e.constructor)&&Tr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Rr=Er("ArrayBuffer");const Sr=Ar("string"),Tr=Ar("function"),Pr=Ar("number"),kr=e=>null!==e&&"object"==typeof e,$r=e=>{if("object"!==wr(e))return!1;const t=yr(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||br in e||mr in e)},Br=Er("Date"),Ur=Er("File"),Cr=Er("Blob"),Ir=Er("FileList");const jr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==Qn?Qn:{},Mr=void 0!==jr.FormData?jr.FormData:void 0,Nr=Er("URLSearchParams"),[Lr,Fr,Dr,zr]=["ReadableStream","Request","Response","Headers"].map(Er);function qr(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),Or(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(xr(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function Hr(e,t){if(xr(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const Yr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:Qn,Vr=e=>!_r(e)&&e!==Yr;const Wr=(Kr="undefined"!=typeof Uint8Array&&yr(Uint8Array),e=>Kr&&e instanceof Kr);var Kr;const Jr=Er("HTMLFormElement"),Xr=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Gr=Er("RegExp"),Zr=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};qr(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)};const Qr=Er("AsyncFunction"),ei=(ti="function"==typeof setImmediate,ni=Tr(Yr.postMessage),ti?setImmediate:ni?(ri=`axios@${Math.random()}`,ii=[],Yr.addEventListener("message",({source:e,data:t})=>{e===Yr&&t===ri&&ii.length&&ii.shift()()},!1),e=>{ii.push(e),Yr.postMessage(ri,"*")}):e=>setTimeout(e));var ti,ni,ri,ii;const oi="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Yr):hr.nextTick||ei;var si={isArray:Or,isArrayBuffer:Rr,isBuffer:xr,isFormData:e=>{if(!e)return!1;if(Mr&&e instanceof Mr)return!0;const t=yr(e);if(!t||t===Object.prototype)return!1;if(!Tr(e.append))return!1;const n=wr(e);return"formdata"===n||"object"===n&&Tr(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Rr(e.buffer),t},isString:Sr,isNumber:Pr,isBoolean:e=>!0===e||!1===e,isObject:kr,isPlainObject:$r,isEmptyObject:e=>{if(!kr(e)||xr(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Lr,isRequest:Fr,isResponse:Dr,isHeaders:zr,isUndefined:_r,isDate:Br,isFile:Ur,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:Cr,isRegExp:Gr,isFunction:Tr,isStream:e=>kr(e)&&Tr(e.pipe),isURLSearchParams:Nr,isTypedArray:Wr,isFileList:Ir,forEach:qr,merge:function e(){const{caseless:t,skipUndefined:n}=Vr(this)&&this||{},r={},i=(i,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;const s=t&&Hr(r,o)||o;$r(r[s])&&$r(i)?r[s]=e(r[s],i):$r(i)?r[s]=e({},i):Or(i)?r[s]=i.slice():n&&_r(i)||(r[s]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&qr(arguments[e],i);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(qr(t,(t,r)=>{n&&Tr(t)?Object.defineProperty(e,r,{value:pr(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),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,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&yr(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:wr,kindOfTest:Er,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Or(e))return e;let t=e.length;if(!Pr(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[mr]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Jr,hasOwnProperty:Xr,hasOwnProp:Xr,reduceDescriptors:Zr,freezeMethods:e=>{Zr(e,(t,n)=>{if(Tr(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Tr(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Or(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Hr,global:Yr,isContextDefined:Vr,isSpecCompliantForm:function(e){return!!(e&&Tr(e.append)&&"FormData"===e[br]&&e[mr])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(kr(e)){if(t.indexOf(e)>=0)return;if(xr(e))return e;if(!("toJSON"in e)){t[r]=e;const i=Or(e)?[]:{};return qr(e,(e,t)=>{const o=n(e,r+1);!_r(o)&&(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:Qr,isThenable:e=>e&&(kr(e)||Tr(e))&&Tr(e.then)&&Tr(e.catch),setImmediate:ei,asap:oi,isIterable:e=>null!=e&&Tr(e[mr])},ai=[],ui=[],ci="undefined"!=typeof Uint8Array?Uint8Array:Array,li=!1;function fi(){li=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)ai[t]=e[t],ui[e.charCodeAt(t)]=t;ui["-".charCodeAt(0)]=62,ui["_".charCodeAt(0)]=63}function di(e){return ai[e>>18&63]+ai[e>>12&63]+ai[e>>6&63]+ai[63&e]}function hi(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(di(r));return i.join("")}function pi(e){var t;li||fi();for(var n=e.length,r=n%3,i="",o=[],s=16383,a=0,u=n-r;a<u;a+=s)o.push(hi(e,a,a+s>u?u:a+s));return 1===r?(t=e[n-1],i+=ai[t>>2],i+=ai[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=ai[t>>10],i+=ai[t>>4&63],i+=ai[t<<2&63],i+="="),o.push(i),o.join("")}function gi(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,f=n?i-1:0,d=n?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+f],f+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),o-=c}return(h?-1:1)*s*Math.pow(2,o-r)}function yi(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[n+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+h]=255&s,h+=p,s/=256,c-=8);e[n+h-p]|=128*g}var mi={}.toString,bi=Array.isArray||function(e){return"[object Array]"==mi.call(e)};function wi(){return Ei.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function vi(e,t){if(wi()<t)throw new RangeError("Invalid typed array length");return Ei.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Ei.prototype:(null===e&&(e=new Ei(t)),e.length=t),e}function Ei(e,t,n){if(!(Ei.TYPED_ARRAY_SUPPORT||this instanceof Ei))return new Ei(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return _i(this,e)}return Ai(this,e,t,n)}function Ai(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);Ei.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Ei.prototype:e=xi(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Ei.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Ti(t,n);e=vi(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(Si(t)){var n=0|Ri(t.length);return 0===(e=vi(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?vi(e,0):xi(e,t);if("Buffer"===t.type&&bi(t.data))return xi(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Oi(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function _i(e,t){if(Oi(t),e=vi(e,t<0?0:0|Ri(t)),!Ei.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function xi(e,t){var n=t.length<0?0:0|Ri(t.length);e=vi(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function Ri(e){if(e>=wi())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+wi().toString(16)+" bytes");return 0|e}function Si(e){return!(null==e||!e._isBuffer)}function Ti(e,t){if(Si(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return to(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return no(e).length;default:if(r)return to(e).length;t=(""+t).toLowerCase(),r=!0}}function Pi(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Hi(this,t,n);case"utf8":case"utf-8":return Fi(this,t,n);case"ascii":return zi(this,t,n);case"latin1":case"binary":return qi(this,t,n);case"base64":return Li(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yi(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function ki(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function $i(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=Ei.from(t,r)),Si(t))return 0===t.length?-1:Bi(e,t,n,r,i);if("number"==typeof t)return t&=255,Ei.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Bi(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Bi(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;o<a;o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var f=!0,d=0;d<u;d++)if(c(e,o+d)!==c(t,d)){f=!1;break}if(f)return o}return-1}function Ui(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function Ci(e,t,n,r){return ro(to(t,e.length-n),e,n,r)}function Ii(e,t,n,r){return ro(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function ji(e,t,n,r){return Ii(e,t,n,r)}function Mi(e,t,n,r){return ro(no(t),e,n,r)}function Ni(e,t,n,r){return ro(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function Li(e,t,n){return 0===t&&n===e.length?pi(e):pi(e.slice(t,n))}function Fi(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=Di)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Di));return n}(r)}Ei.TYPED_ARRAY_SUPPORT=void 0===Qn.TYPED_ARRAY_SUPPORT||Qn.TYPED_ARRAY_SUPPORT,wi(),Ei.poolSize=8192,Ei._augment=function(e){return e.__proto__=Ei.prototype,e},Ei.from=function(e,t,n){return Ai(null,e,t,n)},Ei.TYPED_ARRAY_SUPPORT&&(Ei.prototype.__proto__=Uint8Array.prototype,Ei.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Ei[Symbol.species]),Ei.alloc=function(e,t,n){return function(e,t,n,r){return Oi(t),t<=0?vi(e,t):void 0!==n?"string"==typeof r?vi(e,t).fill(n,r):vi(e,t).fill(n):vi(e,t)}(null,e,t,n)},Ei.allocUnsafe=function(e){return _i(null,e)},Ei.allocUnsafeSlow=function(e){return _i(null,e)},Ei.isBuffer=function(e){return null!=e&&(!!e._isBuffer||io(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&io(e.slice(0,0))}(e))},Ei.compare=function(e,t){if(!Si(e)||!Si(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},Ei.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}},Ei.concat=function(e,t){if(!bi(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Ei.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Ei.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!Si(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},Ei.byteLength=Ti,Ei.prototype._isBuffer=!0,Ei.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)ki(this,t,t+1);return this},Ei.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)ki(this,t,t+3),ki(this,t+1,t+2);return this},Ei.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)ki(this,t,t+7),ki(this,t+1,t+6),ki(this,t+2,t+5),ki(this,t+3,t+4);return this},Ei.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Fi(this,0,e):Pi.apply(this,arguments)},Ei.prototype.equals=function(e){if(!Si(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Ei.compare(this,e)},Ei.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Ei.prototype.compare=function(e,t,n,r,i){if(!Si(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),c=e.slice(t,n),l=0;l<a;++l)if(u[l]!==c[l]){o=u[l],s=c[l];break}return o<s?-1:s<o?1:0},Ei.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Ei.prototype.indexOf=function(e,t,n){return $i(this,e,t,n,!0)},Ei.prototype.lastIndexOf=function(e,t,n){return $i(this,e,t,n,!1)},Ei.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return Ui(this,e,t,n);case"utf8":case"utf-8":return Ci(this,e,t,n);case"ascii":return Ii(this,e,t,n);case"latin1":case"binary":return ji(this,e,t,n);case"base64":return Mi(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ni(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Ei.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Di=4096;function zi(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function qi(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Hi(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=eo(e[o]);return i}function Yi(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Vi(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function Wi(e,t,n,r,i,o){if(!Si(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Ki(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Ji(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function Xi(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Gi(e,t,n,r,i){return i||Xi(e,0,n,4),yi(e,t,n,r,23,4),n+4}function Zi(e,t,n,r,i){return i||Xi(e,0,n,8),yi(e,t,n,r,52,8),n+8}Ei.prototype.slice=function(e,t){var n,r=this.length;if((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),Ei.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Ei.prototype;else{var i=t-e;n=new Ei(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},Ei.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Vi(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},Ei.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Vi(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},Ei.prototype.readUInt8=function(e,t){return t||Vi(e,1,this.length),this[e]},Ei.prototype.readUInt16LE=function(e,t){return t||Vi(e,2,this.length),this[e]|this[e+1]<<8},Ei.prototype.readUInt16BE=function(e,t){return t||Vi(e,2,this.length),this[e]<<8|this[e+1]},Ei.prototype.readUInt32LE=function(e,t){return t||Vi(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Ei.prototype.readUInt32BE=function(e,t){return t||Vi(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Ei.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Vi(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},Ei.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Vi(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Ei.prototype.readInt8=function(e,t){return t||Vi(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Ei.prototype.readInt16LE=function(e,t){t||Vi(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Ei.prototype.readInt16BE=function(e,t){t||Vi(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Ei.prototype.readInt32LE=function(e,t){return t||Vi(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Ei.prototype.readInt32BE=function(e,t){return t||Vi(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Ei.prototype.readFloatLE=function(e,t){return t||Vi(e,4,this.length),gi(this,e,!0,23,4)},Ei.prototype.readFloatBE=function(e,t){return t||Vi(e,4,this.length),gi(this,e,!1,23,4)},Ei.prototype.readDoubleLE=function(e,t){return t||Vi(e,8,this.length),gi(this,e,!0,52,8)},Ei.prototype.readDoubleBE=function(e,t){return t||Vi(e,8,this.length),gi(this,e,!1,52,8)},Ei.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Wi(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},Ei.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||Wi(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},Ei.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Wi(this,e,t,1,255,0),Ei.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Ei.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Wi(this,e,t,2,65535,0),Ei.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Ki(this,e,t,!0),t+2},Ei.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Wi(this,e,t,2,65535,0),Ei.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Ki(this,e,t,!1),t+2},Ei.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Wi(this,e,t,4,4294967295,0),Ei.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Ji(this,e,t,!0),t+4},Ei.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Wi(this,e,t,4,4294967295,0),Ei.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Ji(this,e,t,!1),t+4},Ei.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Wi(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},Ei.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Wi(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},Ei.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Wi(this,e,t,1,127,-128),Ei.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Ei.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Wi(this,e,t,2,32767,-32768),Ei.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Ki(this,e,t,!0),t+2},Ei.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Wi(this,e,t,2,32767,-32768),Ei.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Ki(this,e,t,!1),t+2},Ei.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Wi(this,e,t,4,2147483647,-2147483648),Ei.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Ji(this,e,t,!0),t+4},Ei.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Wi(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Ei.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Ji(this,e,t,!1),t+4},Ei.prototype.writeFloatLE=function(e,t,n){return Gi(this,e,t,!0,n)},Ei.prototype.writeFloatBE=function(e,t,n){return Gi(this,e,t,!1,n)},Ei.prototype.writeDoubleLE=function(e,t,n){return Zi(this,e,t,!0,n)},Ei.prototype.writeDoubleBE=function(e,t,n){return Zi(this,e,t,!1,n)},Ei.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!Ei.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},Ei.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Ei.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=Si(e)?e:to(new Ei(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var Qi=/[^+\/0-9A-Za-z-_]/g;function eo(e){return e<16?"0"+e.toString(16):e.toString(16)}function to(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function no(e){return function(e){var t,n,r,i,o,s;li||fi();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[a-2]?2:"="===e[a-1]?1:0,s=new ci(3*a/4-o),r=o>0?a-4:a;var u=0;for(t=0,n=0;t<r;t+=4,n+=3)i=ui[e.charCodeAt(t)]<<18|ui[e.charCodeAt(t+1)]<<12|ui[e.charCodeAt(t+2)]<<6|ui[e.charCodeAt(t+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=ui[e.charCodeAt(t)]<<2|ui[e.charCodeAt(t+1)]>>4,s[u++]=255&i):1===o&&(i=ui[e.charCodeAt(t)]<<10|ui[e.charCodeAt(t+1)]<<4|ui[e.charCodeAt(t+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Qi,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ro(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function io(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}let oo=class e extends Error{static from(t,n,r,i,o,s){const a=new e(t.message,n||t.code,r,i,o);return a.cause=t,a.name=t.name,null!=t.status&&null==a.status&&(a.status=t.status),s&&Object.assign(a,s),a}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){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:si.toJSONObject(this.config),code:this.code,status:this.status}}};oo.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",oo.ERR_BAD_OPTION="ERR_BAD_OPTION",oo.ECONNABORTED="ECONNABORTED",oo.ETIMEDOUT="ETIMEDOUT",oo.ERR_NETWORK="ERR_NETWORK",oo.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",oo.ERR_DEPRECATED="ERR_DEPRECATED",oo.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",oo.ERR_BAD_REQUEST="ERR_BAD_REQUEST",oo.ERR_CANCELED="ERR_CANCELED",oo.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",oo.ERR_INVALID_URL="ERR_INVALID_URL",oo.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";function so(e){return si.isPlainObject(e)||si.isArray(e)}function ao(e){return si.endsWith(e,"[]")?e.slice(0,-2):e}function uo(e,t,n){return e?e.concat(t).map(function(e,t){return e=ao(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const co=si.toFlatObject(si,{},null,function(e){return/^is[A-Z]/.test(e)});function lo(e,t,n){if(!si.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=si.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!si.isUndefined(t[e])})).metaTokens,i=n.visitor||f,o=n.dots,s=n.indexes,a=n.Blob||"undefined"!=typeof Blob&&Blob,u=void 0===n.maxDepth?100:n.maxDepth,c=a&&si.isSpecCompliantForm(t);if(!si.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(si.isDate(e))return e.toISOString();if(si.isBoolean(e))return e.toString();if(!c&&si.isBlob(e))throw new oo("Blob is not supported. Use a Buffer instead.");return si.isArrayBuffer(e)||si.isTypedArray(e)?c&&"function"==typeof Blob?new Blob([e]):Ei.from(e):e}function f(e,n,i){let a=e;if(si.isReactNative(t)&&si.isReactNativeBlob(e))return t.append(uo(i,n,o),l(e)),!1;if(e&&!i&&"object"==typeof e)if(si.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(si.isArray(e)&&function(e){return si.isArray(e)&&!e.some(so)}(e)||(si.isFileList(e)||si.endsWith(n,"[]"))&&(a=si.toArray(e)))return n=ao(n),a.forEach(function(e,r){!si.isUndefined(e)&&null!==e&&t.append(!0===s?uo([n],r,o):null===s?n:n+"[]",l(e))}),!1;return!!so(e)||(t.append(uo(i,n,o),l(e)),!1)}const d=[],h=Object.assign(co,{defaultVisitor:f,convertValue:l,isVisitable:so});if(!si.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!si.isUndefined(n)){if(o>u)throw new oo("Object is too deeply nested ("+o+" levels). Max depth: "+u,oo.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+r.join("."));d.push(n),si.forEach(n,function(n,s){!0===(!(si.isUndefined(n)||null===n)&&i.call(t,n,si.isString(s)?s.trim():s,r,h))&&e(n,r?r.concat(s):[s],o+1)}),d.pop()}}(e),t}function fo(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ho(e,t){this._pairs=[],e&&lo(e,this,t)}const po=ho.prototype;function go(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function yo(e,t,n){if(!t)return e;const r=n&&n.encode||go,i=si.isFunction(n)?{serialize:n}:n,o=i&&i.serialize;let s;if(s=o?o(t,i):si.isURLSearchParams(t)?t.toString():new ho(t,i).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}po.append=function(e,t){this._pairs.push([e,t])},po.toString=function(e){const t=e?function(t){return e.call(this,t,fo)}:fo;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class mo{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){si.forEach(this.handlers,function(t){null!==t&&e(t)})}}var bo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},wo={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ho,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const vo="undefined"!=typeof window&&"undefined"!=typeof document,Eo="object"==typeof navigator&&navigator||void 0,Ao=vo&&(!Eo||["ReactNative","NativeScript","NS"].indexOf(Eo.product)<0),Oo="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,_o=vo&&window.location.href||"http://localhost";var xo={...Object.freeze({__proto__:null,hasBrowserEnv:vo,hasStandardBrowserEnv:Ao,hasStandardBrowserWebWorkerEnv:Oo,navigator:Eo,origin:_o}),...wo};function Ro(e){function t(e,n,r,i){let o=e[i++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=i>=e.length;if(o=!o&&si.isArray(r)?r.length:o,a)return si.hasOwnProp(r,o)?r[o]=si.isArray(r[o])?r[o].concat(n):[r[o],n]:r[o]=n,!s;r[o]&&si.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],i)&&si.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!s}if(si.isFormData(e)&&si.isFunction(e.entries)){const n={};return si.forEachEntry(e,(e,r)=>{t(function(e){return si.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const So=(e,t)=>null!=e&&si.hasOwnProp(e,t)?e[t]:void 0;const To={transitional:bo,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=si.isObject(e);i&&si.isHTMLForm(e)&&(e=new FormData(e));if(si.isFormData(e))return r?JSON.stringify(Ro(e)):e;if(si.isArrayBuffer(e)||si.isBuffer(e)||si.isStream(e)||si.isFile(e)||si.isBlob(e)||si.isReadableStream(e))return e;if(si.isArrayBufferView(e))return e.buffer;if(si.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){const t=So(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return lo(e,new xo.classes.URLSearchParams,{visitor:function(e,t,n,r){return xo.isNode&&si.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((o=si.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=So(this,"env"),r=n&&n.FormData;return lo(o?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(si.isString(e))try{return(t||JSON.parse)(e),si.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=So(this,"transitional")||To.transitional,n=t&&t.forcedJSONParsing,r=So(this,"responseType"),i="json"===r;if(si.isResponse(e)||si.isReadableStream(e))return e;if(e&&si.isString(e)&&(n&&!r||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,So(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw oo.from(e,oo.ERR_BAD_RESPONSE,this,null,So(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xo.classes.FormData,Blob:xo.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};si.forEach(["delete","get","head","post","put","patch"],e=>{To.headers[e]={}});const Po=si.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 ko=Symbol("internals"),$o=/[^\x09\x20-\x7E\x80-\xFF]/g;function Bo(e){return e&&String(e).trim().toLowerCase()}function Uo(e){return!1===e||null==e?e:si.isArray(e)?e.map(Uo):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace($o,""))}function Co(e,t,n,r,i){return si.isFunction(r)?r.call(this,t,n):(i&&(t=n),si.isString(t)?si.isString(r)?-1!==t.indexOf(r):si.isRegExp(r)?r.test(t):void 0:void 0)}let Io=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=Bo(t);if(!i)throw new Error("header name must be a non-empty string");const o=si.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=Uo(e))}const o=(e,t)=>si.forEach(e,(e,n)=>i(e,n,t));if(si.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(si.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&Po[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(si.isObject(e)&&si.isIterable(e)){let n,r,i={};for(const t of e){if(!si.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?si.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=Bo(e)){const n=si.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(si.isFunction(t))return t.call(this,e,n);if(si.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Bo(e)){const n=si.findKey(this,e);return!(!n||void 0===this[n]||t&&!Co(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=Bo(e)){const i=si.findKey(n,e);!i||t&&!Co(0,n[i],i,t)||(delete n[i],r=!0)}}return si.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Co(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return si.forEach(this,(r,i)=>{const o=si.findKey(n,i);if(o)return t[o]=Uo(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=Uo(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return si.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&si.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ko]=this[ko]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Bo(e);t[r]||(!function(e,t){const n=si.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return si.isArray(e)?e.forEach(r):r(e),this}};function jo(e,t){const n=this||To,r=t||n,i=Io.from(r.headers);let o=r.data;return si.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Mo(e){return!(!e||!e.__CANCEL__)}Io.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),si.reduceDescriptors(Io.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),si.freezeMethods(Io);let No=class extends oo{constructor(e,t,n){super(null==e?"canceled":e,oo.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Lo(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new oo("Request failed with status code "+n.status,[oo.ERR_BAD_REQUEST,oo.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Fo=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=r[s];i||(i=u),n[o]=a,r[o]=u;let l=s,f=0;for(;l!==o;)f+=n[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-i<t)return;const d=c&&u-c;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,i=0,o=1e3/t;const s=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=o?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},o-a)))},()=>n&&s(n)]}(n=>{const o=n.loaded,s=n.lengthComputable?n.total:void 0,a=null!=s?Math.min(o,s):o,u=Math.max(0,a-r),c=i(u);r=Math.max(r,a);e({loaded:a,total:s,progress:s?a/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s?(s-a)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},Do=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},zo=e=>(...t)=>si.asap(()=>e(...t));var qo=xo.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,xo.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(xo.origin),xo.navigator&&/(msie|trident)/i.test(xo.navigator.userAgent)):()=>!0,Ho=xo.hasStandardBrowserEnv?{write(e,t,n,r,i,o,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];si.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),si.isString(r)&&a.push(`path=${r}`),si.isString(i)&&a.push(`domain=${i}`),!0===o&&a.push("secure"),si.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Yo(e,t,n){let r=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));var i;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Vo=e=>e instanceof Io?{...e}:e;function Wo(e,t){t=t||{};const n={};function r(e,t,n,r){return si.isPlainObject(e)&&si.isPlainObject(t)?si.merge.call({caseless:r},e,t):si.isPlainObject(t)?si.merge({},t):si.isArray(t)?t.slice():t}function i(e,t,n,i){return si.isUndefined(t)?si.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function o(e,t){if(!si.isUndefined(t))return r(void 0,t)}function s(e,t){return si.isUndefined(t)?si.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return si.hasOwnProp(t,o)?r(n,i):si.hasOwnProp(e,o)?r(void 0,n):void 0}const u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>i(Vo(e),Vo(t),0,!0)};return si.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const o=si.hasOwnProp(u,r)?u[r]:i,s=o(si.hasOwnProp(e,r)?e[r]:void 0,si.hasOwnProp(t,r)?t[r]:void 0,r);si.isUndefined(s)&&o!==a||(n[r]=s)}),n}var Ko=e=>{const t=Wo({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=Io.from(s),t.url=yo(Yo(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),si.isFormData(n))if(xo.hasStandardBrowserEnv||xo.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(si.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(xo.hasStandardBrowserEnv){si.isFunction(r)&&(r=r(t));if(!0===r||null==r&&qo(t.url)){const e=i&&o&&Ho.read(o);e&&s.set(i,e)}}return t};var Jo="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Ko(e);let i=r.data;const o=Io.from(r.headers).normalize();let s,a,u,c,l,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=r;function p(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function y(){if(!g)return;const r=Io.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());Lo(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(y)},g.onabort=function(){g&&(n(new oo("Request aborted",oo.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",i=new oo(r,oo.ERR_NETWORK,e,g);i.event=t||null,n(i),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||bo;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new oo(t,i.clarifyTimeoutError?oo.ETIMEDOUT:oo.ECONNABORTED,e,g)),g=null},void 0===i&&o.setContentType(null),"setRequestHeader"in g&&si.forEach(o.toJSON(),function(e,t){g.setRequestHeader(t,e)}),si.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),f&&"json"!==f&&(g.responseType=r.responseType),h&&([u,l]=Fo(h,!0),g.addEventListener("progress",u)),d&&g.upload&&([a,c]=Fo(d),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new No(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);m&&-1===xo.protocols.indexOf(m)?n(new oo("Unsupported protocol "+m+":",oo.ERR_BAD_REQUEST,e)):g.send(i||null)})};const Xo=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof oo?t:new No(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,i(new oo(`timeout of ${t}ms exceeded`,oo.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>si.asap(s),a}},Go=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},Zo=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Qo=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of Zo(e))yield*Go(n,t)}(e,t);let o,s=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},{isFunction:es}=si,ts=(({Request:e,Response:t})=>({Request:e,Response:t}))(si.global),{ReadableStream:ns,TextEncoder:rs}=si.global,is=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},os=e=>{e=si.merge.call({skipUndefined:!0},ts,e);const{fetch:t,Request:n,Response:r}=e,i=t?es(t):"function"==typeof fetch,o=es(n),s=es(r);if(!i)return!1;const a=i&&es(ns),u=i&&("function"==typeof rs?(e=>t=>e.encode(t))(new rs):async e=>new Uint8Array(await new n(e).arrayBuffer())),c=o&&a&&is(()=>{let e=!1;const t=new n(xo.origin,{body:new ns,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),l=s&&a&&is(()=>si.isReadableStream(new r("").body)),f={stream:l&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new oo(`Response type '${e}' is not supported`,oo.ERR_NOT_SUPPORT,n)})});const d=async(e,t)=>{const r=si.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(si.isBlob(e))return e.size;if(si.isSpecCompliantForm(e)){const t=new n(xo.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return si.isArrayBufferView(e)||si.isArrayBuffer(e)?e.byteLength:(si.isURLSearchParams(e)&&(e+=""),si.isString(e)?(await u(e)).byteLength:void 0)})(t):r};return async e=>{let{url:i,method:s,data:a,signal:u,cancelToken:h,timeout:p,onDownloadProgress:g,onUploadProgress:y,responseType:m,headers:b,withCredentials:w="same-origin",fetchOptions:v}=Ko(e),E=t||fetch;m=m?(m+"").toLowerCase():"text";let A=Xo([u,h&&h.toAbortSignal()],p),O=null;const _=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let x;try{if(y&&c&&"get"!==s&&"head"!==s&&0!==(x=await d(b,a))){let e,t=new n(i,{method:"POST",body:a,duplex:"half"});if(si.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=Do(x,Fo(zo(y)));a=Qo(t.body,65536,e,n)}}si.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in n.prototype;if(si.isFormData(a)){const e=b.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&b.delete("content-type")}const u={...v,signal:A,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};O=o&&new n(i,u);let h=await(o?E(O,v):E(i,u));const p=l&&("stream"===m||"response"===m);if(l&&(g||p&&_)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=si.toFiniteNumber(h.headers.get("content-length")),[n,i]=g&&Do(t,Fo(zo(g),!0))||[];h=new r(Qo(h.body,65536,n,()=>{i&&i(),_&&_()}),e)}m=m||"text";let R=await f[si.findKey(f,m)||"text"](h,e);return!p&&_&&_(),await new Promise((t,n)=>{Lo(t,n,{data:R,headers:Io.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:O})})}catch(t){if(_&&_(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new oo("Network Error",oo.ERR_NETWORK,e,O,t&&t.response),{cause:t.cause||t});throw oo.from(t,t&&t.code,e,O,t&&t.response)}}},ss=new Map,as=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let s,a,u=o.length,c=ss;for(;u--;)s=o[u],a=c.get(s),void 0===a&&c.set(s,a=u?new Map:os(t)),c=a;return a};as();const us={http:null,xhr:Jo,fetch:{get:as}};si.forEach(us,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const cs=e=>`- ${e}`,ls=e=>si.isFunction(e)||null===e||!1===e;var fs={getAdapter:function(e,t){e=si.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let s=0;s<n;s++){let n;if(r=e[s],i=r,!ls(r)&&(i=us[(n=String(r)).toLowerCase()],void 0===i))throw new oo(`Unknown adapter '${n}'`);if(i&&(si.isFunction(i)||(i=i.get(t))))break;o[n||"#"+s]=i}if(!i){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(cs).join("\n"):" "+cs(e[0]):"as no adapter specified";throw new oo("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return i},adapters:us};function ds(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new No(null,e)}function hs(e){ds(e),e.headers=Io.from(e.headers),e.data=jo.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return fs.getAdapter(e.adapter||To.adapter,e)(e).then(function(t){return ds(e),t.data=jo.call(e,e.transformResponse,t),t.headers=Io.from(t.headers),t},function(t){return Mo(t)||(ds(e),t&&t.response&&(t.response.data=jo.call(e,e.transformResponse,t.response),t.response.headers=Io.from(t.response.headers))),Promise.reject(t)})}const ps="1.15.1",gs={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gs[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const ys={};gs.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ps+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new oo(r(i," has been removed"+(t?" in "+t:"")),oo.ERR_DEPRECATED);return t&&!ys[i]&&(ys[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},gs.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var ms={assertOptions:function(e,t,n){if("object"!=typeof e)throw new oo("options must be an object",oo.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new oo("option "+o+" must be "+n,oo.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new oo("Unknown option "+o,oo.ERR_BAD_OPTION)}},validators:gs};const bs=ms.validators;let ws=class{constructor(e){this.defaults=e||{},this.interceptors={request:new mo,response:new mo}}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 n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),i=-1===r?"":n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Wo(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&ms.assertOptions(n,{silentJSONParsing:bs.transitional(bs.boolean),forcedJSONParsing:bs.transitional(bs.boolean),clarifyTimeoutError:bs.transitional(bs.boolean),legacyInterceptorReqResOrdering:bs.transitional(bs.boolean)},!1),null!=r&&(si.isFunction(r)?t.paramsSerializer={serialize:r}:ms.assertOptions(r,{encode:bs.function,serialize:bs.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ms.assertOptions(t,{baseUrl:bs.spelling("baseURL"),withXsrfToken:bs.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&si.merge(i.common,i[t.method]);i&&si.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=Io.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const n=t.transitional||bo;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(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=[hs.bind(this),void 0];for(e.unshift(...s),e.push(...u),l=e.length,c=Promise.resolve(t);f<l;)c=c.then(e[f++],e[f++]);return c}l=s.length;let d=t;for(;f<l;){const e=s[f++],t=s[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{c=hs.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 yo(Yo((e=Wo(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};si.forEach(["delete","get","head","options"],function(e){ws.prototype[e]=function(t,n){return this.request(Wo(n||{},{method:e,url:t,data:(n||{}).data}))}}),si.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(Wo(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ws.prototype[e]=t(),ws.prototype[e+"Form"]=t(!0)});const vs={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(vs).forEach(([e,t])=>{vs[t]=e});const Es=function e(t){const n=new ws(t),r=pr(ws.prototype.request,n);return si.extend(r,ws.prototype,n,{allOwnKeys:!0}),si.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Wo(t,n))},r}(To);Es.Axios=ws,Es.CanceledError=No,Es.CancelToken=class e{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 n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new No(e,r,i),t(n.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)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Es.isCancel=Mo,Es.VERSION=ps,Es.toFormData=lo,Es.AxiosError=oo,Es.Cancel=Es.CanceledError,Es.all=function(e){return Promise.all(e)},Es.spread=function(e){return function(t){return e.apply(null,t)}},Es.isAxiosError=function(e){return si.isObject(e)&&!0===e.isAxiosError},Es.mergeConfig=Wo,Es.AxiosHeaders=Io,Es.formToJSON=e=>Ro(si.isHTMLForm(e)?new FormData(e):e),Es.getAdapter=fs.getAdapter,Es.HttpStatusCode=vs,Es.default=Es;const{Axios:As,AxiosError:Os,CanceledError:_s,isCancel:xs,CancelToken:Rs,VERSION:Ss,all:Ts,Cancel:Ps,isAxiosError:ks,spread:$s,toFormData:Bs,AxiosHeaders:Us,HttpStatusCode:Cs,formToJSON:Is,getAdapter:js,mergeConfig:Ms}=Es;class Ns{constructor(){this.promiseWrapper=new Promise((e,t)=>{this._resolve=e,this._reject=t}),this._restScope=["success","failure","error","login","timeout"];for(let e=0;e<this._restScope.length;e++){const t=this._restScope[e];t&&(this.promiseWrapper[t]=e=>{"function"==typeof e&&(this[`_${t}`]=e);const n=this.promiseWrapper;delete n[t];const r=this._restScope.slice();return r.splice(r.indexOf(t),1),r.every(e=>!!e&&!n[e])&&delete n.rest,n})}this.promiseWrapper.rest=(e,t)=>{"function"==typeof e&&(this._rest=e);const n=this.promiseWrapper;if(delete n.rest,this._restScope=t||this._restScope,0===this._restScope.length)console.warn('[1Money SDK]: The ".rest(cb, scope)" scope is empty and will never be triggered!');else{let e=0;this._restScope.forEach(t=>{t&&(n[t]?delete n[t]:e++)}),e===this._restScope.length&&console.warn(`[1Money SDK]: The "${this._restScope.join(", ")}" had been called and the "rest" will never be triggered!`)}return n}}}const Ls=new class{constructor(e){this._config=e||{},this.axios=Es,this.parseError=this.parseError.bind(this),this.setting=this.setting.bind(this),this.request=this.request.bind(this)}parseError(e){var t,n,r,i,o,s,a,u,c;"string"==typeof e&&(e=new Error(e)),(!e||"object"!==Gn(e)&&"error"!==Gn(e))&&(e=new Error("Unknown error occurred"));const l=null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"Error",f=null!==(i=null!==(n=null==e?void 0:e.message)&&void 0!==n?n:null===(r=null==e?void 0:e.toString)||void 0===r?void 0:r.call(e))&&void 0!==i?i:"Unknown error",d=null!==(o=null==e?void 0:e.stack)&&void 0!==o?o:"",h=null!==(a=null===(s=null==e?void 0:e.response)||void 0===s?void 0:s.status)&&void 0!==a?a:500,p=null!==(c=null===(u=null==e?void 0:e.response)||void 0===u?void 0:u.data)&&void 0!==c?c:void 0;return"number"!=typeof h||h<100||h>599?{name:"InvalidStatusError",message:"Invalid HTTP status code",stack:d,status:500,data:p}:{name:l,message:f,stack:d,status:h,data:p}}mergeSignals(...e){const t=new AbortController,n=()=>t.abort(),r=[];for(const i of e){if(i.aborted){t.abort();break}i.addEventListener("abort",n),r.push(()=>i.removeEventListener("abort",n))}return{signal:t.signal,cleanup:()=>r.forEach(e=>e())}}setting(e){if(!e)return console.warn("[1Money SDK]: setting method required correct parameters!");this._config=Object.assign(Object.assign({},this._config),e)}request(e){e.withCredentials="boolean"!=typeof e.withCredentials||e.withCredentials,e.headers=Object.assign(Object.assign(Object.assign({},this.axios.defaults.headers.common),e.method?this.axios.defaults.headers[e.method]:{}),e.headers),e.headers.Accept=e.headers.Accept||"*/*",e.headers["X-Requested-With"]=e.headers["X-Requested-With"]||"XMLHttpRequest";const{onSuccess:n,onFailure:r,onLogin:i,onError:o,onTimeout:s,isSuccess:a,isLogin:u,timeout:c}=this._config,{onSuccess:l,onFailure:f,onLogin:d,onError:h,onTimeout:p,isSuccess:g,isLogin:y,timeout:m}=e,b={success:null!=g?g:a,login:null!=y?y:u},w=new Ns;return Promise.resolve().then(()=>{var a,u,g,y,v,E,A,O,_,x,R,S,T,P,k,$,B,U,C,I;const j={success:null!==(y=null!==(g=null!==(u=null!==(a=w._success)&&void 0!==a?a:~w._restScope.indexOf("success")?w._rest:void 0)&&void 0!==u?u:l)&&void 0!==g?g:n)&&void 0!==y?y:(e,t)=>e,failure:null!==(O=null!==(A=null!==(E=null!==(v=w._failure)&&void 0!==v?v:~w._restScope.indexOf("failure")?w._rest:void 0)&&void 0!==E?E:f)&&void 0!==A?A:r)&&void 0!==O?O:(e,t)=>e,error:null!==(S=null!==(R=null!==(x=null!==(_=w._error)&&void 0!==_?_:~w._restScope.indexOf("error")?w._rest:void 0)&&void 0!==x?x:h)&&void 0!==R?R:o)&&void 0!==S?S:(e,t)=>e,login:null!==($=null!==(k=null!==(P=null!==(T=w._login)&&void 0!==T?T:~w._restScope.indexOf("login")?w._rest:void 0)&&void 0!==P?P:d)&&void 0!==k?k:i)&&void 0!==$?$:(e,t)=>e,timeout:null!==(I=null!==(C=null!==(U=null!==(B=w._timeout)&&void 0!==B?B:~w._restScope.indexOf("timeout")?w._rest:void 0)&&void 0!==U?U:p)&&void 0!==C?C:s)&&void 0!==I?I:(e,t)=>e},M=(w._success||w._rest&&w._restScope.indexOf("success"),w._failure||w._rest&&w._restScope.indexOf("failure"),w._login||w._rest&&w._restScope.indexOf("login"),!!(w._error||w._rest&&~w._restScope.indexOf("error")||h||o)),N=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")||p||s),L=!!(w._success||w._rest&&~w._restScope.indexOf("success")),F=!!(w._failure||w._rest&&~w._restScope.indexOf("failure")),D=!!(w._login||w._rest&&~w._restScope.indexOf("login")),z=!!(w._error||w._rest&&~w._restScope.indexOf("error")),q=!!(w._timeout||w._rest&&~w._restScope.indexOf("timeout")),H=(e,n)=>t(this,void 0,void 0,function*(){try{let t=this.parseError(e);const r=yield Promise.resolve(j.error(t,n));z&&(t=r),M?w._resolve(t):w._reject(t)}catch(e){w._reject(this.parseError(e))}});let Y=null,V=!1;const W=null!=m?m:c,K=new AbortController;let J=null;if(e.signal){const t=this.mergeSignals(e.signal,K.signal);e.signal=t.signal,J=t.cleanup}else e.signal=K.signal;const X=()=>{null!==Y&&(clearTimeout(Y),Y=null),J&&(J(),J=null)};W&&(Y=setTimeout(()=>t(this,void 0,void 0,function*(){var t,n;try{V=!0,X(),K.abort();let n=this.parseError("timeout");const r=yield Promise.resolve(j.timeout(n,null!==(t=e.headers)&&void 0!==t?t:{}));q&&(n=r),N?w._resolve(n):w._reject(n)}catch(t){H(t,null!==(n=e.headers)&&void 0!==n?n:{})}}),W)),this.axios(e).then(e=>t(this,void 0,void 0,function*(){var t,n;if(V)return;X();const{status:r,data:i,headers:o}=e;try{const e=null===(t=b.success)||void 0===t?void 0:t.call(b,i,r,o),s=null===(n=b.login)||void 0===n?void 0:n.call(b,i,r,o);let a=i;if(s){const e=yield Promise.resolve(j.login(i,o));D&&(a=e)}else if(e){const e=yield Promise.resolve(j.success(i,o));L&&(a=e)}else{const e=yield Promise.resolve(j.failure(i,o));F&&(a=e)}w._resolve(a)}catch(e){H(e,o)}})).catch(e=>t(this,void 0,void 0,function*(){var t,n,r,i,o,s,a,u,c,l,f,d,h,p;if(V)return;X();const g=null!==(n=null===(t=e.response)||void 0===t?void 0:t.data)&&void 0!==n?n:{};console.error(`[1Money SDK]: Error(${null!==(r=e.status)&&void 0!==r?r:500}, ${null!==(i=e.code)&&void 0!==i?i:"UNKNOWN"}), Message: ${e.message}, Config: ${null===(o=e.config)||void 0===o?void 0:o.method}, ${null!==(a=null===(s=e.config)||void 0===s?void 0:s.baseURL)&&void 0!==a?a:""}${null!==(c=null===(u=e.config)||void 0===u?void 0:u.url)&&void 0!==c?c:""};`);const y=null!==(f=null===(l=e.response)||void 0===l?void 0:l.status)&&void 0!==f?f:500,m=null!==(h=null===(d=e.response)||void 0===d?void 0:d.headers)&&void 0!==h?h:{};try{let t=g;(null===(p=b.login)||void 0===p?void 0:p.call(b,g,y,m))?(t=yield Promise.resolve(j.login(t,m)),w._resolve(t)):H(e,m)}catch(e){H(e,m)}}))}),w.promiseWrapper}}({isSuccess:(e,t)=>200===t&&0==e.code,isLogin:(e,t)=>401===t||401==e.code,timeout:1e4});function Fs(e,t){return Ls.request(Object.assign(Object.assign({},t),{method:"get",url:e}))}function Ds(e,t,n){return Ls.request(Object.assign(Object.assign({},n),{method:"post",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))}function zs(e){const{baseURL:t,headers:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["baseURL","headers"]);Ls.axios.defaults.baseURL=t||("undefined"!=typeof window?location.origin:void 0),n&&(Ls.axios.defaults.headers.common=Object.assign(Object.assign({},Ls.axios.defaults.headers.common),n)),Ls.setting(r)}var qs={get:Fs,post:Ds,postForm:function(e,t,n){return Ls.request(Object.assign(Object.assign({},n),{method:"post",url:e,data:t,headers:Object.assign({"Content-Type":"multipart/form-data"},null==n?void 0:n.headers)}))},del:function(e,t,n){return Ls.request(Object.assign(Object.assign({},n),{method:"delete",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},put:function(e,t,n){return Ls.request(Object.assign(Object.assign({},n),{method:"put",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},patch:function(e,t,n){return Ls.request(Object.assign(Object.assign({},n),{method:"patch",url:e,data:t,headers:Object.assign({"Content-Type":"application/json"},null==n?void 0:n.headers)}))},setInitConfig:zs,axiosStatic:Ls.axios};const Hs="https://api.1money.network",Ys="v1",Vs=`/${Ys}/accounts`,Ws={getNonce:e=>Fs(`${Vs}/nonce?address=${e}`,{withCredentials:!1}),getBbNonce:e=>Fs(`${Vs}/bbnonce?address=${e}`,{withCredentials:!1}),getTokenAccount:(e,t)=>Fs(`${Vs}/token_account?address=${e}&token=${t}`,{withCredentials:!1})},Ks=`/${Ys}/checkpoints`,Js={getNumber:()=>Fs(`${Ks}/number`,{withCredentials:!1}),getByHash:(e,t=!1)=>Fs(`${Ks}/by_hash?hash=${e}&full=${t}`,{withCredentials:!1}),getByNumber:(e,t=!1)=>Fs(`${Ks}/by_number?number=${e}&full=${t}`,{withCredentials:!1}),getReceiptsByNumber:e=>Fs(`${Ks}/receipts/by_number?number=${e}`,{withCredentials:!1})},Xs=`/${Ys}/tokens`,Gs={getTokenMetadata:e=>Fs(`${Xs}/token_metadata?token=${e}`,{withCredentials:!1}),manageBlacklist:e=>Ds(`${Xs}/manage_blacklist`,e,{withCredentials:!1}),manageWhitelist:e=>Ds(`${Xs}/manage_whitelist`,e,{withCredentials:!1}),burnToken:e=>Ds(`${Xs}/burn`,e,{withCredentials:!1}),grantAuthority:e=>Ds(`${Xs}/grant_authority`,e,{withCredentials:!1}),issueToken:e=>Ds(`${Xs}/issue`,e,{withCredentials:!1}),mintToken:e=>Ds(`${Xs}/mint`,e,{withCredentials:!1}),pauseToken:e=>Ds(`${Xs}/pause`,e,{withCredentials:!1}),updateMetadata:e=>Ds(`${Xs}/update_metadata`,e,{withCredentials:!1}),bridgeAndMint:e=>Ds(`${Xs}/bridge_and_mint`,e,{withCredentials:!1}),burnAndBridge:e=>Ds(`${Xs}/burn_and_bridge`,e,{withCredentials:!1}),clawbackToken:e=>Ds(`${Xs}/clawback`,e,{withCredentials:!1})},Zs=`/${Ys}/transactions`,Qs={getByHash:e=>Fs(`${Zs}/by_hash?hash=${e}`,{withCredentials:!1}),getReceiptByHash:e=>Fs(`${Zs}/receipt/by_hash?hash=${e}`,{withCredentials:!1}),getFinalizedByHash:e=>Fs(`${Zs}/finalized/by_hash?hash=${e}`,{withCredentials:!1}),estimateFee:(e,t,n,r)=>Fs(`${Zs}/estimate_fee?from=${e}&value=${n}&to=${t}&token=${r}`,{withCredentials:!1}),payment:e=>Ds(`${Zs}/payment`,e,{withCredentials:!1})},ea=`/${Ys}/chains`,ta={getChainId:()=>Fs(`${ea}/chain_id`,{withCredentials:!1})};var na,ra,ia,oa;function sa(e){const t=(null==e?void 0:e.network)||"mainnet";let n=Hs;switch(t){case"mainnet":n=Hs;break;case"testnet":n="https://api.testnet.1money.network";break;case"local":n="http://localhost:18555"}return zs({baseURL:n,isSuccess:(e,t)=>200===t,timeout:(null==e?void 0:e.timeout)||1e4}),{accounts:Ws,checkpoints:Js,tokens:Gs,transactions:Qs,chain:ta}}!function(e){e.MasterMint="MasterMintBurn",e.MintBurnTokens="MintBurnTokens",e.Pause="Pause",e.ManageList="ManageList",e.UpdateMetadata="UpdateMetadata",e.Bridge="Bridge",e.Clawback="Clawback"}(na||(na={})),function(e){e.Grant="Grant",e.Revoke="Revoke"}(ra||(ra={})),function(e){e.Add="Add",e.Remove="Remove"}(ia||(ia={})),function(e){e.Pause="Pause",e.Unpause="Unpause"}(oa||(oa={}));const aa=BigInt("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0");function ua(e,t){return We(Bt([Ut(e),"boolean"==typeof t.v?t.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(t.v),be(t.r),be(t.s)]))}function ca(e){const n=We(e.rlpBytes),r=t=>(function(e){if(BigInt(e.s)>aa)throw new Error("[1Money SDK]: Invalid signature - high S value detected (potential malleability)")}(t),{kind:e.kind,unsigned:e.unsigned,signatureHash:n,txHash:ua(e.rlpBytes,t),signature:t,toRequest:()=>e.toRequest(e.unsigned,t)});return{kind:e.kind,unsigned:e.unsigned,rlpBytes:e.rlpBytes,signatureHash:n,attachSignature:r,sign:e=>t(this,void 0,void 0,function*(){return r(yield e.signDigest(n))})}}function la(e){const t=Mt.list([Mt.uint(e.unsigned.chain_id),Mt.uint(e.unsigned.nonce),...e.payloadFields]),n=e.unsigned.memo;let r,i;return null==n?(r=Nt(t),i=e.kind):(qt(n),r=Nt(Mt.list([t,Ht(n)])),i=`${e.kind}_v2`),ca({kind:i,unsigned:e.unsigned,rlpBytes:r,toRequest:e.toRequest})}const fa=/^\d+$/;function da(e,t){throw new Error(`[1Money SDK]: Invalid ${e}: ${String(t)}`)}function ha(e,t){(!Number.isSafeInteger(t)||t<=0)&&da(e,t)}function pa(e,t){(!Number.isSafeInteger(t)||t<0)&&da(e,t)}function ga(e,t){fa.test(t)||da(e,t)}function ya(e,t){rt(t)||da(e,t)}function ma(e){ha("chain_id",e.chain_id),pa("nonce",e.nonce)}function ba(e){ya("recipient",e.recipient),ga("value",e.value),ya("token",e.token)}function wa(e){ga("value",e.value),ya("token",e.token)}function va(e){return ma(e),ba(e),la({kind:"payment",unsigned:e,payloadFields:[Mt.address(e.recipient),Mt.uint(e.value),Mt.address(e.token)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Ea(e){var t,n;ma(e),ya("authority_address",e.authority_address),ya("token",e.token),t="value",void 0!==(n=e.value)&&ga(t,n);const r=[Mt.string(e.action),Mt.string(e.authority_type),Mt.address(e.authority_address),Mt.address(e.token)];return void 0!==e.value&&r.push(Mt.uint(e.value)),la({kind:"tokenAuthority",unsigned:e,payloadFields:r,toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Aa(e){return ma(e),ba(e),ha("source_chain_id",e.source_chain_id),la({kind:"tokenBridgeAndMint",unsigned:e,payloadFields:[Mt.address(e.recipient),Mt.uint(e.value),Mt.address(e.token),Mt.uint(e.source_chain_id),Mt.string(e.source_tx_hash),Mt.string(e.bridge_metadata)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Oa(e){return ma(e),wa(e),la({kind:"tokenBurn",unsigned:e,payloadFields:[Mt.uint(e.value),Mt.address(e.token)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function _a(e){return ma(e),ya("sender",e.sender),wa(e),ha("destination_chain_id",e.destination_chain_id),ya("destination_address",e.destination_address),ga("escrow_fee",e.escrow_fee),la({kind:"tokenBurnAndBridge",unsigned:e,payloadFields:[Mt.address(e.sender),Mt.uint(e.value),Mt.address(e.token),Mt.uint(e.destination_chain_id),Mt.string(e.destination_address),Mt.uint(e.escrow_fee),Mt.string(e.bridge_metadata),Mt.hex(e.bridge_param)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function xa(e){return ma(e),ba(e),ya("from",e.from),la({kind:"tokenClawback",unsigned:e,payloadFields:[Mt.address(e.token),Mt.address(e.from),Mt.address(e.recipient),Mt.uint(e.value)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Ra(e){var t;ma(e),pa("decimals",e.decimals),ya("master_authority",e.master_authority);const n=null===(t=e.clawback_enabled)||void 0===t||t,r=Object.assign(Object.assign({},e),{clawback_enabled:n});return la({kind:"tokenIssue",unsigned:r,payloadFields:[Mt.string(r.symbol),Mt.string(r.name),Mt.uint(r.decimals),Mt.address(r.master_authority),Mt.bool(r.is_private),Mt.bool(n)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Sa(e){return ma(e),ya("address",e.address),ya("token",e.token),la({kind:"tokenManageList",unsigned:e,payloadFields:[Mt.string(e.action),Mt.address(e.address),Mt.address(e.token)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Ta(e){ma(e),ya("token",e.token);const t=e.additional_metadata.map(e=>Mt.list([Mt.string(e.key),Mt.string(e.value)]));return la({kind:"tokenMetadata",unsigned:e,payloadFields:[Mt.string(e.name),Mt.string(e.uri),Mt.address(e.token),Mt.list(t)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function Pa(e){return ma(e),ba(e),la({kind:"tokenMint",unsigned:e,payloadFields:[Mt.address(e.recipient),Mt.uint(e.value),Mt.address(e.token)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}function ka(e){return ma(e),ya("token",e.token),la({kind:"tokenPause",unsigned:e,payloadFields:[Mt.string(e.action),Mt.address(e.token)],toRequest:(e,t)=>Object.assign(Object.assign({},e),{signature:t})})}const $a=/^0x[0-9a-fA-F]{64}$/;const Ba="0xfffffffffffffffffffffffffffffffffffffffe",Ua="1Money Network",Ca=[{name:"memoType",type:"string"},{name:"memoFormat",type:"string"},{name:"memoData",type:"string"}],Ia={abiName:"TransferV1",discriminant:0,primaryType:"PaymentV1",eip712Fields:[{name:"chainId",type:"uint64"},{name:"nonce",type:"uint64"},{name:"recipient",type:"address"},{name:"value",type:"uint256"},{name:"token",type:"address"},{name:"memo",type:"SolMemo"}],abiParams:"(uint64,uint64,address,uint256,address,(string,string,string))"};const ja=[{type:"function",name:"submitTypedData",inputs:[{name:"envelope",type:"tuple",components:[{name:"kind",type:"uint8"},{name:"payload",type:"bytes"},{name:"v",type:"uint8"},{name:"r",type:"bytes32"},{name:"s",type:"bytes32"}]}],outputs:[]}];function Ma(e){var t,n,r,i,o,s;return e.memo&&qt(e.memo),{domain:{name:Ua,version:"1",chainId:e.chain_id,verifyingContract:Ba},types:{PaymentV1:Ia.eip712Fields,SolMemo:Ca},primaryType:"PaymentV1",message:{chainId:e.chain_id,nonce:e.nonce,recipient:e.recipient,value:e.value,token:e.token,memo:{memoType:null!==(n=null===(t=e.memo)||void 0===t?void 0:t.type)&&void 0!==n?n:"",memoFormat:null!==(i=null===(r=e.memo)||void 0===r?void 0:r.format)&&void 0!==i?i:"",memoData:null!==(s=null===(o=e.memo)||void 0===o?void 0:o.data)&&void 0!==s?s:""}}}}const Na={payment:va,tokenManageList:Sa,tokenBurn:Oa,tokenAuthority:Ea,tokenIssue:Ra,tokenMint:Pa,tokenPause:ka,tokenMetadata:Ta,tokenBridgeAndMint:Aa,tokenBurnAndBridge:_a,tokenClawback:xa};var La={api:sa,client:qs};e.EIP712_DOMAIN_NAME=Ua,e.EIP712_DOMAIN_VERSION="1",e.EIP712_VERIFYING_CONTRACT=Ba,e.MEMO_DATA_MAX_BYTES=256,e.MEMO_FORMAT_MAX_BYTES=64,e.MEMO_RLP_HEADER_ALLOWANCE=16,e.MEMO_TOTAL_MAX_BYTES=512,e.MEMO_TYPE_MAX_BYTES=128,e.MemoValidationError=Lt,e.PAYMENT_KIND=Ia,e.SOL_MEMO_FIELDS=Ca,e.TransactionBuilder=Na,e._typeof=Gn,e.api=sa,e.buildPaymentEip712TypedData=Ma,e.calcSignedTxHash=ua,e.calcTxHash=function(e,t){const n=Zn(e),r=Bt("boolean"==typeof t.v?t.v?Uint8Array.from([1]):new Uint8Array([]):BigInt(t.v)),i=Bt(be(t.r)),o=Bt(be(t.s)),s=new Uint8Array(r.length+i.length+o.length);s.set(r,0),s.set(i,r.length),s.set(o,r.length+i.length);const a=function(e){if(e<56)return Uint8Array.from([192+e]);{const t=[];let n=e;for(;n>0;)t.unshift(255&n),n>>=8;return Uint8Array.from([247+t.length,...t])}}(n.length+s.length),u=new Uint8Array(a.length+n.length+s.length);return u.set(a,0),u.set(n,a.length),u.set(s,a.length+n.length),We(u)},e.client=qs,e.createPreparedTx=ca,e.createPrivateKeySigner=function(e){const n=be(e);return{signDigest:e=>t(this,void 0,void 0,function*(){if(!$a.test(e))throw new Error(`[1Money SDK]: Invalid digest: ${e}`);const t=yield Hn(be(e),n,{lowS:!0}),r=t.toCompactRawBytes(),i=r.subarray(0,32),o=r.subarray(32,64);return{r:le(i),s:le(o),v:t.recovery}})}},e.default=La,e.deriveTokenAddress=function(e,t){const n=e.startsWith("0x")?be(e):we(e),r=t.startsWith("0x")?be(t):we(t),i=new Uint8Array(n.length+r.length);return i.set(n,0),i.set(r,n.length),le(be(We(i)).slice(12))},e.encodePayload=Zn,e.encodeRlpPayload=Nt,e.memoRlpList=Ht,e.parseSig=function(e){const t=e.startsWith("0x")?e.slice(2):e;if(130!==t.length)throw new Error(`[1Money SDK]: expected 65-byte signature, got ${t.length/2} bytes`);const n=`0x${t.slice(0,64)}`,r=`0x${t.slice(64,128)}`,i=parseInt(t.slice(128,130),16);let o;if(27===i||0===i)o=27;else{if(28!==i&&1!==i)throw new Error(`[1Money SDK]: unexpected signature v byte: 0x${i.toString(16)}`);o=28}return{v:o,r:n,s:r}},e.preparePaymentTx=va,e.preparePaymentTypedTx=function(e){const t=Ma(e),n=t.message.memo;return{kind:Ia.abiName,primaryType:Ia.primaryType,typedData:t,encodeCalldata:t=>{if(27!==t.v&&28!==t.v)throw new Error(`[1Money SDK]: EIP-712 v must be 27 or 28, got ${t.v}`);const r=lt(M(Ia.abiParams),[[BigInt(e.chain_id),BigInt(e.nonce),e.recipient,BigInt(e.value),e.token,[n.memoType,n.memoFormat,n.memoData]]]),i=function(e){const{args:t}=e,{abi:n,functionName:r}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:mt(e),i=n[0];return ot([r,("inputs"in i&&i.inputs?lt(i.inputs,t??[]):void 0)??"0x"])}({abi:ja,functionName:"submitTypedData",args:[{kind:Ia.discriminant,payload:r,v:t.v,r:t.r,s:t.s}]});return{to:e.token,data:i,value:0n,gas:21000n,gasPrice:0n,type:"legacy"}}}},e.prepareTokenAuthorityTx=Ea,e.prepareTokenBridgeAndMintTx=Aa,e.prepareTokenBurnAndBridgeTx=_a,e.prepareTokenBurnTx=Oa,e.prepareTokenClawbackTx=xa,e.prepareTokenIssueTx=Ra,e.prepareTokenManageListTx=Sa,e.prepareTokenMetadataTx=Ta,e.prepareTokenMintTx=Pa,e.prepareTokenPauseTx=ka,e.rlpValue=Mt,e.safePromiseAll=function(e){return e&&e.length?Promise.all(e):Promise.resolve([])},e.safePromiseLine=function(e){return t(this,void 0,void 0,function*(){if(!e||!e.length)return[];const t=[];for(let n=0;n<e.length;n++)try{t.push(yield e[n](n))}catch(e){}return t})},e.signMessage=function(e,n){return t(this,void 0,void 0,function*(){const t=be(We(Zn(e))),r=be(n),i=yield Hn(t,r,{lowS:!0}),o=i.toCompactRawBytes(),s=o.subarray(0,32),a=o.subarray(32,64);return{r:le(s),s:le(a),v:i.recovery}})},e.toHex=function(e){const t=Gn(e);try{switch(t){case"boolean":return ce(e);case"number":case"bigint":return fe(e);case"string":if(/^-?\d+$/.test(e))try{return fe(BigInt(e))}catch(t){return fe(+e)}return he(e);case"uint8array":case"uint16array":case"uint32array":case"int8array":case"int16array":case"int32array":case"arraybuffer":return le(e);case"array":return 0===e.length?"0x":e.every(e=>"number"==typeof e)?le(Uint8Array.from(e)):le(we(JSON.stringify(e)));default:return le(we(JSON.stringify(e)))}}catch(e){throw new Error(`[1Money SDK]: toHex conversion failed: ${e instanceof Error?e.message:String(e)}`)}},e.validateMemo=qt,Object.defineProperty(e,"__esModule",{value:!0})});