multichain-address-validator 0.0.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/.editorconfig +10 -0
- package/.travis.yml +11 -0
- package/.vscode/launch.json +23 -0
- package/LICENSE +21 -0
- package/README.md +87 -0
- package/config/esbuild.inject.js +1 -0
- package/config/esbuild.ts +14 -0
- package/dist/chain-validators.d.ts +2 -0
- package/dist/chain-validators.js +98 -0
- package/dist/crypto/base32.d.ts +5 -0
- package/dist/crypto/base32.js +64 -0
- package/dist/crypto/base58.d.ts +4 -0
- package/dist/crypto/base58.js +42 -0
- package/dist/crypto/bech32.d.ts +17 -0
- package/dist/crypto/bech32.js +124 -0
- package/dist/crypto/biginteger.d.ts +57 -0
- package/dist/crypto/biginteger.js +1311 -0
- package/dist/crypto/blake256.d.ts +22 -0
- package/dist/crypto/blake256.js +169 -0
- package/dist/crypto/blake2b.d.ts +13 -0
- package/dist/crypto/blake2b.js +242 -0
- package/dist/crypto/cnBase58.d.ts +7 -0
- package/dist/crypto/cnBase58.js +209 -0
- package/dist/crypto/segwit_addr.d.ts +12 -0
- package/dist/crypto/segwit_addr.js +102 -0
- package/dist/crypto/utils.d.ts +26 -0
- package/dist/crypto/utils.js +123 -0
- package/dist/helpers.d.ts +2 -0
- package/dist/helpers.js +5 -0
- package/dist/multichain-address-validator.bundle.min.js +17 -0
- package/dist/multichain-address-validator.d.ts +2 -0
- package/dist/multichain-address-validator.js +8 -0
- package/dist/types.d.ts +15 -0
- package/dist/types.js +5 -0
- package/dist/validators/algorand_validator.d.ts +5 -0
- package/dist/validators/algorand_validator.js +23 -0
- package/dist/validators/base58_validator.d.ts +4 -0
- package/dist/validators/base58_validator.js +31 -0
- package/dist/validators/bch_validator.d.ts +13 -0
- package/dist/validators/bch_validator.js +50 -0
- package/dist/validators/bip173_validator.d.ts +7 -0
- package/dist/validators/bip173_validator.js +12 -0
- package/dist/validators/bitcoin_validator.d.ts +12 -0
- package/dist/validators/bitcoin_validator.js +68 -0
- package/dist/validators/cardano_validator.d.ts +5 -0
- package/dist/validators/cardano_validator.js +41 -0
- package/dist/validators/eos_validator.d.ts +5 -0
- package/dist/validators/eos_validator.js +10 -0
- package/dist/validators/ethereum_validator.d.ts +6 -0
- package/dist/validators/ethereum_validator.js +30 -0
- package/dist/validators/index.d.ts +16 -0
- package/dist/validators/index.js +16 -0
- package/dist/validators/monero_validator.d.ts +5 -0
- package/dist/validators/monero_validator.js +58 -0
- package/dist/validators/nano_validator.d.ts +6 -0
- package/dist/validators/nano_validator.js +23 -0
- package/dist/validators/nem_validator.d.ts +5 -0
- package/dist/validators/nem_validator.js +14 -0
- package/dist/validators/polkadot_validator.d.ts +5 -0
- package/dist/validators/polkadot_validator.js +49 -0
- package/dist/validators/ripple_validator.d.ts +10 -0
- package/dist/validators/ripple_validator.js +26 -0
- package/dist/validators/sia_validator.d.ts +5 -0
- package/dist/validators/sia_validator.js +27 -0
- package/dist/validators/solana_validator.d.ts +5 -0
- package/dist/validators/solana_validator.js +10 -0
- package/dist/validators/tezos_validator.d.ts +5 -0
- package/dist/validators/tezos_validator.js +30 -0
- package/dist/validators/tron_validator.d.ts +8 -0
- package/dist/validators/tron_validator.js +45 -0
- package/dist/validators/xlm_validator.d.ts +6 -0
- package/dist/validators/xlm_validator.js +32 -0
- package/index.html +12 -0
- package/package.json +353 -0
- package/src/chain-validators.ts +131 -0
- package/src/crypto/base32.ts +66 -0
- package/src/crypto/base58.ts +46 -0
- package/src/crypto/bech32.js +132 -0
- package/src/crypto/biginteger.js +1426 -0
- package/src/crypto/blake256.js +186 -0
- package/src/crypto/blake2b.js +276 -0
- package/src/crypto/cnBase58.js +226 -0
- package/src/crypto/segwit_addr.js +112 -0
- package/src/crypto/utils.ts +133 -0
- package/src/helpers.ts +7 -0
- package/src/multichain-address-validator.ts +11 -0
- package/src/types.ts +18 -0
- package/src/validators/algorand_validator.ts +28 -0
- package/src/validators/base58_validator.ts +32 -0
- package/src/validators/bch_validator.ts +66 -0
- package/src/validators/bip173_validator.ts +19 -0
- package/src/validators/bitcoin_validator.ts +94 -0
- package/src/validators/cardano_validator.ts +50 -0
- package/src/validators/eos_validator.ts +13 -0
- package/src/validators/ethereum_validator.ts +37 -0
- package/src/validators/index.ts +16 -0
- package/src/validators/monero_validator.ts +72 -0
- package/src/validators/nano_validator.ts +32 -0
- package/src/validators/nem_validator.ts +18 -0
- package/src/validators/polkadot_validator.ts +57 -0
- package/src/validators/ripple_validator.ts +36 -0
- package/src/validators/sia_validator.ts +33 -0
- package/src/validators/solana_validator.ts +12 -0
- package/src/validators/tezos_validator.ts +36 -0
- package/src/validators/tron_validator.ts +59 -0
- package/src/validators/xlm_validator.ts +42 -0
- package/test/addresses/addresses.ts +45 -0
- package/test/addresses/algorand.json +6 -0
- package/test/addresses/bch-testnet.json +4 -0
- package/test/addresses/bch.json +12 -0
- package/test/addresses/btc-testnet.json +6 -0
- package/test/addresses/btc.json +14 -0
- package/test/addresses/cardano.json +8 -0
- package/test/addresses/doge.json +7 -0
- package/test/addresses/eos.json +6 -0
- package/test/addresses/evm.json +21 -0
- package/test/addresses/invalid.json +15 -0
- package/test/addresses/ltc-testnet.json +7 -0
- package/test/addresses/ltc.json +9 -0
- package/test/addresses/monero.json +7 -0
- package/test/addresses/nano.json +12 -0
- package/test/addresses/nem.json +4 -0
- package/test/addresses/polkadot.json +8 -0
- package/test/addresses/ripple.json +11 -0
- package/test/addresses/sia.json +6 -0
- package/test/addresses/solana.json +8 -0
- package/test/addresses/tezos.json +9 -0
- package/test/addresses/tron.json +6 -0
- package/test/addresses/xlm.json +12 -0
- package/test/multichain-address-validator.test.ts +1589 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Copyright (c) 2017, 2021 Pieter Wuille
|
|
2
|
+
//
|
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
// in the Software without restriction, including without limitation the rights
|
|
6
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
// furnished to do so, subject to the following conditions:
|
|
9
|
+
//
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in
|
|
11
|
+
// all copies or substantial portions of the Software.
|
|
12
|
+
//
|
|
13
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
// THE SOFTWARE.
|
|
20
|
+
import bech32 from './bech32';
|
|
21
|
+
function convertbits(data, frombits, tobits, pad) {
|
|
22
|
+
var acc = 0;
|
|
23
|
+
var bits = 0;
|
|
24
|
+
var ret = [];
|
|
25
|
+
var maxv = (1 << tobits) - 1;
|
|
26
|
+
for (var p = 0; p < data.length; ++p) {
|
|
27
|
+
var value = data[p];
|
|
28
|
+
if (value < 0 || (value >> frombits) !== 0) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
acc = (acc << frombits) | value;
|
|
32
|
+
bits += frombits;
|
|
33
|
+
while (bits >= tobits) {
|
|
34
|
+
bits -= tobits;
|
|
35
|
+
ret.push((acc >> bits) & maxv);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (pad) {
|
|
39
|
+
if (bits > 0) {
|
|
40
|
+
ret.push((acc << (tobits - bits)) & maxv);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else if (bits >= frombits || ((acc << (tobits - bits)) & maxv)) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return ret;
|
|
47
|
+
}
|
|
48
|
+
function decode(hrp, addr) {
|
|
49
|
+
var bech32m = false;
|
|
50
|
+
var dec = bech32.decode(addr, bech32.encodings.BECH32);
|
|
51
|
+
if (dec === null) {
|
|
52
|
+
dec = bech32.decode(addr, bech32.encodings.BECH32M);
|
|
53
|
+
bech32m = true;
|
|
54
|
+
}
|
|
55
|
+
if (dec === null || dec.hrp !== hrp || dec.data.length < 1 || dec.data[0] > 16) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
var res = convertbits(dec.data.slice(1), 5, 8, false);
|
|
59
|
+
if (res === null || res.length < 2 || res.length > 40) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
if (dec.data[0] === 0 && res.length !== 20 && res.length !== 32) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
if (dec.data[0] === 0 && bech32m) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
if (dec.data[0] !== 0 && !bech32m) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
return { version: dec.data[0], program: res };
|
|
72
|
+
}
|
|
73
|
+
function encode(hrp, version, program) {
|
|
74
|
+
var enc = bech32.encodings.BECH32;
|
|
75
|
+
if (version > 0) {
|
|
76
|
+
enc = bech32.encodings.BECH32M;
|
|
77
|
+
}
|
|
78
|
+
var ret = bech32.encode(hrp, [version].concat(convertbits(program, 8, 5, true)), enc);
|
|
79
|
+
if (decode(hrp, ret, enc) === null) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
return ret;
|
|
83
|
+
}
|
|
84
|
+
/////////////////////////////////////////////////////
|
|
85
|
+
function isValidAddress(address, opts = {}) {
|
|
86
|
+
if (!opts.bech32Hrp || opts.bech32Hrp.length === 0) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const correctBech32Hrps = opts.bech32Hrp;
|
|
90
|
+
for (var chrp of correctBech32Hrps) {
|
|
91
|
+
var ret = decode(chrp, address);
|
|
92
|
+
if (ret) {
|
|
93
|
+
return encode(chrp, ret.version, ret.program) === address.toLowerCase();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
export default {
|
|
99
|
+
encode: encode,
|
|
100
|
+
decode: decode,
|
|
101
|
+
isValidAddress: isValidAddress,
|
|
102
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare function numberToHex(number: number, length: number): string;
|
|
2
|
+
declare function byteArray2hexStr(byteArray: number[]): string;
|
|
3
|
+
declare function hexStr2byteArray(str: string): Uint8Array;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
numberToHex: typeof numberToHex;
|
|
6
|
+
toHex: (arrayOfBytes: any) => string;
|
|
7
|
+
sha256: (payload: any, format?: string) => string;
|
|
8
|
+
sha256x2: (buffer: any, format?: string) => any;
|
|
9
|
+
sha256Checksum: (payload: any) => any;
|
|
10
|
+
sha512: (payload: any, format?: string) => string;
|
|
11
|
+
sha512_256: (payload: any, format?: string) => string;
|
|
12
|
+
blake256: (hexString: string) => any;
|
|
13
|
+
blake256Checksum: (payload: any) => any;
|
|
14
|
+
blake2b: (hexString: string, outlen: number) => any;
|
|
15
|
+
keccak256: (hexString: string) => string;
|
|
16
|
+
keccak256Checksum: (payload: any) => any;
|
|
17
|
+
blake2b256: (hexString: string) => any;
|
|
18
|
+
base58: (string: string) => number[];
|
|
19
|
+
byteArray2hexStr: typeof byteArray2hexStr;
|
|
20
|
+
hexStr2byteArray: typeof hexStr2byteArray;
|
|
21
|
+
base32: {
|
|
22
|
+
b32decode: (s: string) => Uint8Array;
|
|
23
|
+
b32encode: (s: string) => string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Buffer } from 'buffer';
|
|
2
|
+
import { sha256 } from '@noble/hashes/sha256';
|
|
3
|
+
import { sha512, sha512_256 } from '@noble/hashes/sha512';
|
|
4
|
+
import { bytesToHex } from '@noble/hashes/utils';
|
|
5
|
+
import { keccak_256 } from '@noble/hashes/sha3';
|
|
6
|
+
import base32 from './base32.js';
|
|
7
|
+
import base58 from './base58.js';
|
|
8
|
+
import Blake256 from './blake256.js';
|
|
9
|
+
import Blake2B from './blake2b.js';
|
|
10
|
+
function numberToHex(number, length) {
|
|
11
|
+
let hex = number.toString(16);
|
|
12
|
+
if (hex.length % 2 === 1) {
|
|
13
|
+
hex = '0' + hex;
|
|
14
|
+
}
|
|
15
|
+
return hex.padStart(length, '0');
|
|
16
|
+
}
|
|
17
|
+
function isHexChar(c) {
|
|
18
|
+
if ((c >= 'A' && c <= 'F') ||
|
|
19
|
+
(c >= 'a' && c <= 'f') ||
|
|
20
|
+
(c >= '0' && c <= '9')) {
|
|
21
|
+
return 1;
|
|
22
|
+
}
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
/* Convert a hex char to value */
|
|
26
|
+
function hexChar2byte(c) {
|
|
27
|
+
let d = 0;
|
|
28
|
+
if (c >= 'A' && c <= 'F') {
|
|
29
|
+
d = c.charCodeAt(0) - 'A'.charCodeAt(0) + 10;
|
|
30
|
+
}
|
|
31
|
+
else if (c >= 'a' && c <= 'f') {
|
|
32
|
+
d = c.charCodeAt(0) - 'a'.charCodeAt(0) + 10;
|
|
33
|
+
}
|
|
34
|
+
else if (c >= '0' && c <= '9') {
|
|
35
|
+
d = c.charCodeAt(0) - '0'.charCodeAt(0);
|
|
36
|
+
}
|
|
37
|
+
return d;
|
|
38
|
+
}
|
|
39
|
+
/* Convert a byte to string */
|
|
40
|
+
function byte2hexStr(byte) {
|
|
41
|
+
const hexByteMap = "0123456789ABCDEF";
|
|
42
|
+
let str = "";
|
|
43
|
+
str += hexByteMap.charAt(byte >> 4);
|
|
44
|
+
str += hexByteMap.charAt(byte & 0x0f);
|
|
45
|
+
return str;
|
|
46
|
+
}
|
|
47
|
+
function byteArray2hexStr(byteArray) {
|
|
48
|
+
let str = "";
|
|
49
|
+
let i = 0;
|
|
50
|
+
for (i = 0; i < (byteArray.length - 1); i++) {
|
|
51
|
+
str += byte2hexStr(byteArray[i]);
|
|
52
|
+
}
|
|
53
|
+
str += byte2hexStr(byteArray[i]);
|
|
54
|
+
return str;
|
|
55
|
+
}
|
|
56
|
+
function hexStr2byteArray(str) {
|
|
57
|
+
const byteArray = new Uint8Array(str.length / 2);
|
|
58
|
+
let d = 0;
|
|
59
|
+
let i = 0;
|
|
60
|
+
let j = 0;
|
|
61
|
+
let k = 0;
|
|
62
|
+
for (i = 0; i < str.length; i++) {
|
|
63
|
+
const c = str.charAt(i);
|
|
64
|
+
if (isHexChar(c)) {
|
|
65
|
+
d <<= 4;
|
|
66
|
+
d += hexChar2byte(c);
|
|
67
|
+
j++;
|
|
68
|
+
if (0 === (j % 2)) {
|
|
69
|
+
byteArray[k++] = d;
|
|
70
|
+
d = 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return byteArray;
|
|
75
|
+
}
|
|
76
|
+
export default {
|
|
77
|
+
numberToHex: numberToHex,
|
|
78
|
+
toHex: function (arrayOfBytes) {
|
|
79
|
+
let hex = '';
|
|
80
|
+
for (let i = 0; i < arrayOfBytes.length; i++) {
|
|
81
|
+
// @ts-expect-error
|
|
82
|
+
hex += numberToHex(arrayOfBytes[i]);
|
|
83
|
+
}
|
|
84
|
+
return hex;
|
|
85
|
+
},
|
|
86
|
+
sha256: function (payload, format = 'HEX') {
|
|
87
|
+
return bytesToHex(sha256(hexStr2byteArray(payload)));
|
|
88
|
+
},
|
|
89
|
+
sha256x2: function (buffer, format = 'HEX') {
|
|
90
|
+
return this.sha256(this.sha256(buffer, format), format);
|
|
91
|
+
},
|
|
92
|
+
sha256Checksum: function (payload) {
|
|
93
|
+
return this.sha256(this.sha256(payload)).slice(0, 8);
|
|
94
|
+
},
|
|
95
|
+
sha512: function (payload, format = 'HEX') {
|
|
96
|
+
return bytesToHex(sha512(payload));
|
|
97
|
+
},
|
|
98
|
+
sha512_256: function (payload, format = 'HEX') {
|
|
99
|
+
return bytesToHex(sha512_256(hexStr2byteArray(payload)));
|
|
100
|
+
},
|
|
101
|
+
blake256: function (hexString) {
|
|
102
|
+
return new Blake256().update(hexString, 'hex').digest('hex');
|
|
103
|
+
},
|
|
104
|
+
blake256Checksum: function (payload) {
|
|
105
|
+
return this.blake256(this.blake256(payload)).substr(0, 8);
|
|
106
|
+
},
|
|
107
|
+
blake2b: function (hexString, outlen) {
|
|
108
|
+
return new Blake2B(outlen).update(Buffer.from(hexString, 'hex')).digest('hex');
|
|
109
|
+
},
|
|
110
|
+
keccak256: function (hexString) {
|
|
111
|
+
return bytesToHex(keccak_256(hexString));
|
|
112
|
+
},
|
|
113
|
+
keccak256Checksum: function (payload) {
|
|
114
|
+
return this.keccak256(payload).toString().substr(0, 8);
|
|
115
|
+
},
|
|
116
|
+
blake2b256: function (hexString) {
|
|
117
|
+
return new Blake2B(32).update(Buffer.from(hexString, 'hex')).digest('hex');
|
|
118
|
+
},
|
|
119
|
+
base58: base58.decode,
|
|
120
|
+
byteArray2hexStr: byteArray2hexStr,
|
|
121
|
+
hexStr2byteArray: hexStr2byteArray,
|
|
122
|
+
base32: base32
|
|
123
|
+
};
|
package/dist/helpers.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var MCAV=(()=>{var Ax=Object.create;var te=Object.defineProperty;var _x=Object.getOwnPropertyDescriptor;var Bx=Object.getOwnPropertyNames;var vx=Object.getPrototypeOf,Ex=Object.prototype.hasOwnProperty;var Ix=(t,e)=>()=>(t&&(e=t(t=0)),e);var L0=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Cx=(t,e)=>{for(var r in e)te(t,r,{get:e[r],enumerable:!0})},jt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let x of Bx(e))!Ex.call(t,x)&&x!==r&&te(t,x,{get:()=>e[x],enumerable:!(n=_x(e,x))||n.enumerable});return t};var a0=(t,e,r)=>(r=t!=null?Ax(vx(t)):{},jt(e||!t||!t.__esModule?te(r,"default",{value:t,enumerable:!0}):r,t)),Ux=t=>jt(te({},"__esModule",{value:!0}),t);var Kt=L0(re=>{"use strict";d();re.byteLength=Lx;re.toByteArray=kx;re.fromByteArray=Hx;var e0=[],Y=[],Tx=typeof Uint8Array<"u"?Uint8Array:Array,Fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(B0=0,Wt=Fe.length;B0<Wt;++B0)e0[B0]=Fe[B0],Y[Fe.charCodeAt(B0)]=B0;var B0,Wt;Y[45]=62;Y[95]=63;function qt(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Lx(t){var e=qt(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Fx(t,e,r){return(e+r)*3/4-r}function kx(t){var e,r=qt(t),n=r[0],x=r[1],i=new Tx(Fx(t,n,x)),a=0,f=x>0?n-4:n,c;for(c=0;c<f;c+=4)e=Y[t.charCodeAt(c)]<<18|Y[t.charCodeAt(c+1)]<<12|Y[t.charCodeAt(c+2)]<<6|Y[t.charCodeAt(c+3)],i[a++]=e>>16&255,i[a++]=e>>8&255,i[a++]=e&255;return x===2&&(e=Y[t.charCodeAt(c)]<<2|Y[t.charCodeAt(c+1)]>>4,i[a++]=e&255),x===1&&(e=Y[t.charCodeAt(c)]<<10|Y[t.charCodeAt(c+1)]<<4|Y[t.charCodeAt(c+2)]>>2,i[a++]=e>>8&255,i[a++]=e&255),i}function Sx(t){return e0[t>>18&63]+e0[t>>12&63]+e0[t>>6&63]+e0[t&63]}function Ox(t,e,r){for(var n,x=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),x.push(Sx(n));return x.join("")}function Hx(t){for(var e,r=t.length,n=r%3,x=[],i=16383,a=0,f=r-n;a<f;a+=i)x.push(Ox(t,a,a+i>f?f:a+i));return n===1?(e=t[r-1],x.push(e0[e>>2]+e0[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],x.push(e0[e>>10]+e0[e>>4&63]+e0[e<<2&63]+"=")),x.join("")}});var Jt=L0(ke=>{d();ke.read=function(t,e,r,n,x){var i,a,f=x*8-n-1,c=(1<<f)-1,s=c>>1,h=-7,u=r?x-1:0,m=r?-1:1,p=t[e+u];for(u+=m,i=p&(1<<-h)-1,p>>=-h,h+=f;h>0;i=i*256+t[e+u],u+=m,h-=8);for(a=i&(1<<-h)-1,i>>=-h,h+=n;h>0;a=a*256+t[e+u],u+=m,h-=8);if(i===0)i=1-s;else{if(i===c)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-s}return(p?-1:1)*a*Math.pow(2,i-n)};ke.write=function(t,e,r,n,x,i){var a,f,c,s=i*8-x-1,h=(1<<s)-1,u=h>>1,m=x===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,v=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+u>=1?e+=m/c:e+=m*Math.pow(2,1-u),e*c>=2&&(a++,c/=2),a+u>=h?(f=0,a=h):a+u>=1?(f=(e*c-1)*Math.pow(2,x),a=a+u):(f=e*Math.pow(2,u-1)*Math.pow(2,x),a=0));x>=8;t[r+p]=f&255,p+=v,f/=256,x-=8);for(a=a<<x|f,s+=x;s>0;t[r+p]=a&255,p+=v,a/=256,s-=8);t[r+p-v]|=g*128}});var H0=L0(O0=>{"use strict";d();var Se=Kt(),k0=Jt(),Yt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;O0.Buffer=l;O0.SlowBuffer=$x;O0.INSPECT_MAX_BYTES=50;var ne=2147483647;O0.kMaxLength=ne;l.TYPED_ARRAY_SUPPORT=Rx();!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Rx(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}});Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function f0(t){if(t>ne)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Me(t)}return tr(t,e,r)}l.poolSize=8192;function tr(t,e,r){if(typeof t=="string")return Vx(t,e);if(ArrayBuffer.isView(t))return Dx(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(t0(t,ArrayBuffer)||t&&t0(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(t0(t,SharedArrayBuffer)||t&&t0(t.buffer,SharedArrayBuffer)))return He(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return l.from(n,e,r);let x=Nx(t);if(x)return x;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return l.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}l.from=function(t,e,r){return tr(t,e,r)};Object.setPrototypeOf(l.prototype,Uint8Array.prototype);Object.setPrototypeOf(l,Uint8Array);function rr(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Mx(t,e,r){return rr(t),t<=0?f0(t):e!==void 0?typeof r=="string"?f0(t).fill(e,r):f0(t).fill(e):f0(t)}l.alloc=function(t,e,r){return Mx(t,e,r)};function Me(t){return rr(t),f0(t<0?0:Ve(t)|0)}l.allocUnsafe=function(t){return Me(t)};l.allocUnsafeSlow=function(t){return Me(t)};function Vx(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=nr(t,e)|0,n=f0(r),x=n.write(t,e);return x!==r&&(n=n.slice(0,x)),n}function Oe(t){let e=t.length<0?0:Ve(t.length)|0,r=f0(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Dx(t){if(t0(t,Uint8Array)){let e=new Uint8Array(t);return He(e.buffer,e.byteOffset,e.byteLength)}return Oe(t)}function He(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,l.prototype),n}function Nx(t){if(l.isBuffer(t)){let e=Ve(t.length)|0,r=f0(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Ne(t.length)?f0(0):Oe(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Oe(t.data)}function Ve(t){if(t>=ne)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ne.toString(16)+" bytes");return t|0}function $x(t){return+t!=t&&(t=0),l.alloc(+t)}l.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==l.prototype};l.compare=function(e,r){if(t0(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),t0(r,Uint8Array)&&(r=l.from(r,r.offset,r.byteLength)),!l.isBuffer(e)||!l.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,x=r.length;for(let i=0,a=Math.min(n,x);i<a;++i)if(e[i]!==r[i]){n=e[i],x=r[i];break}return n<x?-1:x<n?1:0};l.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}};l.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return l.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let x=l.allocUnsafe(r),i=0;for(n=0;n<e.length;++n){let a=e[n];if(t0(a,Uint8Array))i+a.length>x.length?(l.isBuffer(a)||(a=l.from(a)),a.copy(x,i)):Uint8Array.prototype.set.call(x,a,i);else if(l.isBuffer(a))a.copy(x,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=a.length}return x};function nr(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||t0(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let x=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Re(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ur(t).length;default:if(x)return n?-1:Re(t).length;e=(""+e).toLowerCase(),x=!0}}l.byteLength=nr;function Px(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Zx(this,e,r);case"utf8":case"utf-8":return ir(this,e,r);case"ascii":return Jx(this,e,r);case"latin1":case"binary":return Yx(this,e,r);case"base64":return qx(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Qx(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}l.prototype._isBuffer=!0;function v0(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}l.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)v0(this,r,r+1);return this};l.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)v0(this,r,r+3),v0(this,r+1,r+2);return this};l.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)v0(this,r,r+7),v0(this,r+1,r+6),v0(this,r+2,r+5),v0(this,r+3,r+4);return this};l.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?ir(this,0,e):Px.apply(this,arguments)};l.prototype.toLocaleString=l.prototype.toString;l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:l.compare(this,e)===0};l.prototype.inspect=function(){let e="",r=O0.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Yt&&(l.prototype[Yt]=l.prototype.inspect);l.prototype.compare=function(e,r,n,x,i){if(t0(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),x===void 0&&(x=0),i===void 0&&(i=this.length),r<0||n>e.length||x<0||i>this.length)throw new RangeError("out of range index");if(x>=i&&r>=n)return 0;if(x>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,x>>>=0,i>>>=0,this===e)return 0;let a=i-x,f=n-r,c=Math.min(a,f),s=this.slice(x,i),h=e.slice(r,n);for(let u=0;u<c;++u)if(s[u]!==h[u]){a=s[u],f=h[u];break}return a<f?-1:f<a?1:0};function xr(t,e,r,n,x){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Ne(r)&&(r=x?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(x)return-1;r=t.length-1}else if(r<0)if(x)r=0;else return-1;if(typeof e=="string"&&(e=l.from(e,n)),l.isBuffer(e))return e.length===0?-1:Zt(t,e,r,n,x);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?x?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Zt(t,[e],r,n,x);throw new TypeError("val must be string, number or Buffer")}function Zt(t,e,r,n,x){let i=1,a=t.length,f=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,a/=2,f/=2,r/=2}function c(h,u){return i===1?h[u]:h.readUInt16BE(u*i)}let s;if(x){let h=-1;for(s=r;s<a;s++)if(c(t,s)===c(e,h===-1?0:s-h)){if(h===-1&&(h=s),s-h+1===f)return h*i}else h!==-1&&(s-=s-h),h=-1}else for(r+f>a&&(r=a-f),s=r;s>=0;s--){let h=!0;for(let u=0;u<f;u++)if(c(t,s+u)!==c(e,u)){h=!1;break}if(h)return s}return-1}l.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};l.prototype.indexOf=function(e,r,n){return xr(this,e,r,n,!0)};l.prototype.lastIndexOf=function(e,r,n){return xr(this,e,r,n,!1)};function Gx(t,e,r,n){r=Number(r)||0;let x=t.length-r;n?(n=Number(n),n>x&&(n=x)):n=x;let i=e.length;n>i/2&&(n=i/2);let a;for(a=0;a<n;++a){let f=parseInt(e.substr(a*2,2),16);if(Ne(f))return a;t[r+a]=f}return a}function zx(t,e,r,n){return xe(Re(e,t.length-r),t,r,n)}function Xx(t,e,r,n){return xe(ni(e),t,r,n)}function jx(t,e,r,n){return xe(ur(e),t,r,n)}function Wx(t,e,r,n){return xe(xi(e,t.length-r),t,r,n)}l.prototype.write=function(e,r,n,x){if(r===void 0)x="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")x=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,x===void 0&&(x="utf8")):(x=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");x||(x="utf8");let a=!1;for(;;)switch(x){case"hex":return Gx(this,e,r,n);case"utf8":case"utf-8":return zx(this,e,r,n);case"ascii":case"latin1":case"binary":return Xx(this,e,r,n);case"base64":return jx(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wx(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+x);x=(""+x).toLowerCase(),a=!0}};l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qx(t,e,r){return e===0&&r===t.length?Se.fromByteArray(t):Se.fromByteArray(t.slice(e,r))}function ir(t,e,r){r=Math.min(t.length,r);let n=[],x=e;for(;x<r;){let i=t[x],a=null,f=i>239?4:i>223?3:i>191?2:1;if(x+f<=r){let c,s,h,u;switch(f){case 1:i<128&&(a=i);break;case 2:c=t[x+1],(c&192)===128&&(u=(i&31)<<6|c&63,u>127&&(a=u));break;case 3:c=t[x+1],s=t[x+2],(c&192)===128&&(s&192)===128&&(u=(i&15)<<12|(c&63)<<6|s&63,u>2047&&(u<55296||u>57343)&&(a=u));break;case 4:c=t[x+1],s=t[x+2],h=t[x+3],(c&192)===128&&(s&192)===128&&(h&192)===128&&(u=(i&15)<<18|(c&63)<<12|(s&63)<<6|h&63,u>65535&&u<1114112&&(a=u))}}a===null?(a=65533,f=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),x+=f}return Kx(n)}var Qt=4096;function Kx(t){let e=t.length;if(e<=Qt)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Qt));return r}function Jx(t,e,r){let n="";r=Math.min(t.length,r);for(let x=e;x<r;++x)n+=String.fromCharCode(t[x]&127);return n}function Yx(t,e,r){let n="";r=Math.min(t.length,r);for(let x=e;x<r;++x)n+=String.fromCharCode(t[x]);return n}function Zx(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let x="";for(let i=e;i<r;++i)x+=ii[t[i]];return x}function Qx(t,e,r){let n=t.slice(e,r),x="";for(let i=0;i<n.length-1;i+=2)x+=String.fromCharCode(n[i]+n[i+1]*256);return x}l.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let x=this.subarray(e,r);return Object.setPrototypeOf(x,l.prototype),x};function X(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||X(e,r,this.length);let x=this[e],i=1,a=0;for(;++a<r&&(i*=256);)x+=this[e+a]*i;return x};l.prototype.readUintBE=l.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||X(e,r,this.length);let x=this[e+--r],i=1;for(;r>0&&(i*=256);)x+=this[e+--r]*i;return x};l.prototype.readUint8=l.prototype.readUInt8=function(e,r){return e=e>>>0,r||X(e,1,this.length),this[e]};l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||X(e,2,this.length),this[e]|this[e+1]<<8};l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||X(e,2,this.length),this[e]<<8|this[e+1]};l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||X(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||X(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};l.prototype.readBigUInt64LE=u0(function(e){e=e>>>0,S0(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&X0(e,this.length-8);let x=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(x)+(BigInt(i)<<BigInt(32))});l.prototype.readBigUInt64BE=u0(function(e){e=e>>>0,S0(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&X0(e,this.length-8);let x=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(x)<<BigInt(32))+BigInt(i)});l.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||X(e,r,this.length);let x=this[e],i=1,a=0;for(;++a<r&&(i*=256);)x+=this[e+a]*i;return i*=128,x>=i&&(x-=Math.pow(2,8*r)),x};l.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||X(e,r,this.length);let x=r,i=1,a=this[e+--x];for(;x>0&&(i*=256);)a+=this[e+--x]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};l.prototype.readInt8=function(e,r){return e=e>>>0,r||X(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};l.prototype.readInt16LE=function(e,r){e=e>>>0,r||X(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};l.prototype.readInt16BE=function(e,r){e=e>>>0,r||X(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};l.prototype.readInt32LE=function(e,r){return e=e>>>0,r||X(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};l.prototype.readInt32BE=function(e,r){return e=e>>>0,r||X(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};l.prototype.readBigInt64LE=u0(function(e){e=e>>>0,S0(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&X0(e,this.length-8);let x=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(x)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});l.prototype.readBigInt64BE=u0(function(e){e=e>>>0,S0(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&X0(e,this.length-8);let x=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(x)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});l.prototype.readFloatLE=function(e,r){return e=e>>>0,r||X(e,4,this.length),k0.read(this,e,!0,23,4)};l.prototype.readFloatBE=function(e,r){return e=e>>>0,r||X(e,4,this.length),k0.read(this,e,!1,23,4)};l.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||X(e,8,this.length),k0.read(this,e,!0,52,8)};l.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||X(e,8,this.length),k0.read(this,e,!1,52,8)};function K(t,e,r,n,x,i){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>x||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,r,n,x){if(e=+e,r=r>>>0,n=n>>>0,!x){let f=Math.pow(2,8*n)-1;K(this,e,r,n,f,0)}let i=1,a=0;for(this[r]=e&255;++a<n&&(i*=256);)this[r+a]=e/i&255;return r+n};l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,r,n,x){if(e=+e,r=r>>>0,n=n>>>0,!x){let f=Math.pow(2,8*n)-1;K(this,e,r,n,f,0)}let i=n-1,a=1;for(this[r+i]=e&255;--i>=0&&(a*=256);)this[r+i]=e/a&255;return r+n};l.prototype.writeUint8=l.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||K(this,e,r,1,255,0),this[r]=e&255,r+1};l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||K(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||K(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||K(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||K(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function ar(t,e,r,n,x){dr(e,n,x,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function fr(t,e,r,n,x){dr(e,n,x,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i=i>>8,t[r+6]=i,i=i>>8,t[r+5]=i,i=i>>8,t[r+4]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}l.prototype.writeBigUInt64LE=u0(function(e,r=0){return ar(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});l.prototype.writeBigUInt64BE=u0(function(e,r=0){return fr(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});l.prototype.writeIntLE=function(e,r,n,x){if(e=+e,r=r>>>0,!x){let c=Math.pow(2,8*n-1);K(this,e,r,n,c-1,-c)}let i=0,a=1,f=0;for(this[r]=e&255;++i<n&&(a*=256);)e<0&&f===0&&this[r+i-1]!==0&&(f=1),this[r+i]=(e/a>>0)-f&255;return r+n};l.prototype.writeIntBE=function(e,r,n,x){if(e=+e,r=r>>>0,!x){let c=Math.pow(2,8*n-1);K(this,e,r,n,c-1,-c)}let i=n-1,a=1,f=0;for(this[r+i]=e&255;--i>=0&&(a*=256);)e<0&&f===0&&this[r+i+1]!==0&&(f=1),this[r+i]=(e/a>>0)-f&255;return r+n};l.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||K(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};l.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||K(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};l.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||K(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};l.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||K(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};l.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||K(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};l.prototype.writeBigInt64LE=u0(function(e,r=0){return ar(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});l.prototype.writeBigInt64BE=u0(function(e,r=0){return fr(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function cr(t,e,r,n,x,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function or(t,e,r,n,x){return e=+e,r=r>>>0,x||cr(t,e,r,4,34028234663852886e22,-34028234663852886e22),k0.write(t,e,r,n,23,4),r+4}l.prototype.writeFloatLE=function(e,r,n){return or(this,e,r,!0,n)};l.prototype.writeFloatBE=function(e,r,n){return or(this,e,r,!1,n)};function sr(t,e,r,n,x){return e=+e,r=r>>>0,x||cr(t,e,r,8,17976931348623157e292,-17976931348623157e292),k0.write(t,e,r,n,52,8),r+8}l.prototype.writeDoubleLE=function(e,r,n){return sr(this,e,r,!0,n)};l.prototype.writeDoubleBE=function(e,r,n){return sr(this,e,r,!1,n)};l.prototype.copy=function(e,r,n,x){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!x&&x!==0&&(x=this.length),r>=e.length&&(r=e.length),r||(r=0),x>0&&x<n&&(x=n),x===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("sourceEnd out of bounds");x>this.length&&(x=this.length),e.length-r<x-n&&(x=e.length-r+n);let i=x-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,x):Uint8Array.prototype.set.call(e,this.subarray(n,x),r),i};l.prototype.fill=function(e,r,n,x){if(typeof e=="string"){if(typeof r=="string"?(x=r,r=0,n=this.length):typeof n=="string"&&(x=n,n=this.length),x!==void 0&&typeof x!="string")throw new TypeError("encoding must be a string");if(typeof x=="string"&&!l.isEncoding(x))throw new TypeError("Unknown encoding: "+x);if(e.length===1){let a=e.charCodeAt(0);(x==="utf8"&&a<128||x==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let i;if(typeof e=="number")for(i=r;i<n;++i)this[i]=e;else{let a=l.isBuffer(e)?e:l.from(e,x),f=a.length;if(f===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-r;++i)this[i+r]=a[i%f]}return this};var F0={};function De(t,e,r){F0[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(x){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:x,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}De("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);De("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);De("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,x=r;return Number.isInteger(r)&&Math.abs(r)>2**32?x=er(String(r)):typeof r=="bigint"&&(x=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(x=er(x)),x+="n"),n+=` It must be ${e}. Received ${x}`,n},RangeError);function er(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function ei(t,e,r){S0(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&X0(e,t.length-(r+1))}function dr(t,e,r,n,x,i){if(t>r||t<e){let a=typeof e=="bigint"?"n":"",f;throw i>3?e===0||e===BigInt(0)?f=`>= 0${a} and < 2${a} ** ${(i+1)*8}${a}`:f=`>= -(2${a} ** ${(i+1)*8-1}${a}) and < 2 ** ${(i+1)*8-1}${a}`:f=`>= ${e}${a} and <= ${r}${a}`,new F0.ERR_OUT_OF_RANGE("value",f,t)}ei(n,x,i)}function S0(t,e){if(typeof t!="number")throw new F0.ERR_INVALID_ARG_TYPE(e,"number",t)}function X0(t,e,r){throw Math.floor(t)!==t?(S0(t,r),new F0.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new F0.ERR_BUFFER_OUT_OF_BOUNDS:new F0.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var ti=/[^+/0-9A-Za-z-_]/g;function ri(t){if(t=t.split("=")[0],t=t.trim().replace(ti,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Re(t,e){e=e||1/0;let r,n=t.length,x=null,i=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!x){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}x=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),x=r;continue}r=(x-55296<<10|r-56320)+65536}else x&&(e-=3)>-1&&i.push(239,191,189);if(x=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function ni(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function xi(t,e){let r,n,x,i=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,x=r%256,i.push(x),i.push(n);return i}function ur(t){return Se.toByteArray(ri(t))}function xe(t,e,r,n){let x;for(x=0;x<n&&!(x+r>=e.length||x>=t.length);++x)e[x+r]=t[x];return x}function t0(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Ne(t){return t!==t}var ii=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let x=0;x<16;++x)e[n+x]=t[r]+t[x]}return e}();function u0(t){return typeof BigInt>"u"?ai:t}function ai(){throw new Error("BigInt not supported")}});var w,d=Ix(()=>{w=H0().Buffer});var qr=L0((Wr,he)=>{d();(function(t,e){"use strict";var r=Math.pow(2,-24),n=Math.pow(2,32),x=Math.pow(2,53);function i(c){var s=new ArrayBuffer(256),h=new DataView(s),u,m=0;function p(E){for(var O=s.byteLength,U=m+E;O<U;)O*=2;if(O!==s.byteLength){var L=h;s=new ArrayBuffer(O),h=new DataView(s);for(var $=m+3>>2,S=0;S<$;++S)h.setUint32(S*4,L.getUint32(S*4))}return u=E,h}function v(){m+=u}function g(E){v(p(8).setFloat64(m,E))}function b(E){v(p(1).setUint8(m,E))}function y(E){for(var O=p(E.length),U=0;U<E.length;++U)O.setUint8(m+U,E[U]);v()}function B(E){v(p(2).setUint16(m,E))}function A(E){v(p(4).setUint32(m,E))}function I(E){var O=E%n,U=(E-O)/n,L=p(8);L.setUint32(m,U),L.setUint32(m+4,O),v()}function T(E,O){O<24?b(E<<5|O):O<256?(b(E<<5|24),b(O)):O<65536?(b(E<<5|25),B(O)):O<4294967296?(b(E<<5|26),A(O)):(b(E<<5|27),I(O))}function D(E){var O;if(E===!1)return b(244);if(E===!0)return b(245);if(E===null)return b(246);if(E===e)return b(247);switch(typeof E){case"number":if(Math.floor(E)===E){if(0<=E&&E<=x)return T(0,E);if(-x<=E&&E<0)return T(1,-(E+1))}return b(251),g(E);case"string":var U=[];for(O=0;O<E.length;++O){var L=E.charCodeAt(O);L<128?U.push(L):L<2048?(U.push(192|L>>6),U.push(128|L&63)):L<55296?(U.push(224|L>>12),U.push(128|L>>6&63),U.push(128|L&63)):(L=(L&1023)<<10,L|=E.charCodeAt(++O)&1023,L+=65536,U.push(240|L>>18),U.push(128|L>>12&63),U.push(128|L>>6&63),U.push(128|L&63))}return T(3,U.length),y(U);default:var $;if(Array.isArray(E))for($=E.length,T(4,$),O=0;O<$;++O)D(E[O]);else if(E instanceof Uint8Array)T(2,E.length),y(E);else{var S=Object.keys(E);for($=S.length,T(5,$),O=0;O<$;++O){var M=S[O];D(M),D(E[M])}}}}if(D(c),"slice"in s)return s.slice(0,m);for(var P=new ArrayBuffer(m),z=new DataView(P),j=0;j<m;++j)z.setUint8(j,h.getUint8(j));return P}function a(c,s,h){var u=new DataView(c),m=0;typeof s!="function"&&(s=function(U){return U}),typeof h!="function"&&(h=function(){return e});function p(U,L){return m+=L,U}function v(U){return p(new Uint8Array(c,m,U),U)}function g(){var U=new ArrayBuffer(4),L=new DataView(U),$=A(),S=$&32768,M=$&31744,d0=$&1023;if(M===31744)M=261120;else if(M!==0)M+=114688;else if(d0!==0)return d0*r;return L.setUint32(0,S<<16|M<<13|d0<<13),L.getFloat32(0)}function b(){return p(u.getFloat32(m),4)}function y(){return p(u.getFloat64(m),8)}function B(){return p(u.getUint8(m),1)}function A(){return p(u.getUint16(m),2)}function I(){return p(u.getUint32(m),4)}function T(){return I()*n+I()}function D(){return u.getUint8(m)!==255?!1:(m+=1,!0)}function P(U){if(U<24)return U;if(U===24)return B();if(U===25)return A();if(U===26)return I();if(U===27)return T();if(U===31)return-1;throw"Invalid length encoding"}function z(U){var L=B();if(L===255)return-1;var $=P(L&31);if($<0||L>>5!==U)throw"Invalid indefinite length element";return $}function j(U,L){for(var $=0;$<L;++$){var S=B();S&128&&(S<224?(S=(S&31)<<6|B()&63,L-=1):S<240?(S=(S&15)<<12|(B()&63)<<6|B()&63,L-=2):(S=(S&15)<<18|(B()&63)<<12|(B()&63)<<6|B()&63,L-=3)),S<65536?U.push(S):(S-=65536,U.push(55296|S>>10),U.push(56320|S&1023))}}function E(){var U=B(),L=U>>5,$=U&31,S,M;if(L===7)switch($){case 25:return g();case 26:return b();case 27:return y()}if(M=P($),M<0&&(L<2||6<L))throw"Invalid length";switch(L){case 0:return M;case 1:return-1-M;case 2:if(M<0){for(var d0=[],Pt=0;(M=z(L))>=0;)Pt+=M,d0.push(v(M));var Gt=new Uint8Array(Pt),zt=0;for(S=0;S<d0.length;++S)Gt.set(d0[S],zt),zt+=d0[S].length;return Gt}return v(M);case 3:var Le=[];if(M<0)for(;(M=z(L))>=0;)j(Le,M);else j(Le,M);return String.fromCharCode.apply(null,Le);case 4:var z0;if(M<0)for(z0=[];!D();)z0.push(E());else for(z0=new Array(M),S=0;S<M;++S)z0[S]=E();return z0;case 5:var Xt={};for(S=0;S<M||M<0&&!D();++S){var wx=E();Xt[wx]=E()}return Xt;case 6:return s(E(),M);case 7:switch(M){case 20:return!1;case 21:return!0;case 22:return null;case 23:return e;default:return h(M)}}}var O=E();if(m!==c.byteLength)throw"Remaining bytes";return O}var f={encode:i,decode:a};typeof define=="function"&&define.amd?define("cbor/cbor",f):typeof he<"u"&&he.exports?he.exports=f:t.CBOR||(t.CBOR=f)})(Wr)});var ge=L0((k1,Un)=>{"use strict";d();function Ha(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var x=t.charAt(n),i=x.charCodeAt(0);if(e[i]!==255)throw new TypeError(x+" is ambiguous");e[i]=n}var a=t.length,f=t.charAt(0),c=Math.log(a)/Math.log(256),s=Math.log(256)/Math.log(a);function h(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var v=0,g=0,b=0,y=p.length;b!==y&&p[b]===0;)b++,v++;for(var B=(y-b)*s+1>>>0,A=new Uint8Array(B);b!==y;){for(var I=p[b],T=0,D=B-1;(I!==0||T<g)&&D!==-1;D--,T++)I+=256*A[D]>>>0,A[D]=I%a>>>0,I=I/a>>>0;if(I!==0)throw new Error("Non-zero carry");g=T,b++}for(var P=B-g;P!==B&&A[P]===0;)P++;for(var z=f.repeat(v);P<B;++P)z+=t.charAt(A[P]);return z}function u(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;for(var v=0,g=0,b=0;p[v]===f;)g++,v++;for(var y=(p.length-v)*c+1>>>0,B=new Uint8Array(y);p[v];){var A=e[p.charCodeAt(v)];if(A===255)return;for(var I=0,T=y-1;(A!==0||I<b)&&T!==-1;T--,I++)A+=a*B[T]>>>0,B[T]=A%256>>>0,A=A/256>>>0;if(A!==0)throw new Error("Non-zero carry");b=I,v++}for(var D=y-b;D!==y&&B[D]===0;)D++;for(var P=new Uint8Array(g+(y-D)),z=g;D!==y;)P[z++]=B[D++];return P}function m(p){var v=u(p);if(v)return v;throw new Error("Non-base"+a+" character")}return{encode:h,decodeUnsafe:u,decode:m}}Un.exports=Ha});var lx=L0((J0,P0)=>{d();var $a=200,Rt="__lodash_hash_undefined__",Ee=1,Xn=2,jn=9007199254740991,me="[object Arguments]",Tt="[object Array]",Pa="[object AsyncFunction]",Wn="[object Boolean]",qn="[object Date]",Kn="[object Error]",Jn="[object Function]",Ga="[object GeneratorFunction]",ye="[object Map]",Yn="[object Number]",za="[object Null]",$0="[object Object]",On="[object Promise]",Xa="[object Proxy]",Zn="[object RegExp]",we="[object Set]",Qn="[object String]",ja="[object Symbol]",Wa="[object Undefined]",Lt="[object WeakMap]",ex="[object ArrayBuffer]",Ae="[object DataView]",qa="[object Float32Array]",Ka="[object Float64Array]",Ja="[object Int8Array]",Ya="[object Int16Array]",Za="[object Int32Array]",Qa="[object Uint8Array]",ef="[object Uint8ClampedArray]",tf="[object Uint16Array]",rf="[object Uint32Array]",nf=/[\\^$.*+?()[\]{}|]/g,xf=/^\[object .+?Constructor\]$/,af=/^(?:0|[1-9]\d*)$/,N={};N[qa]=N[Ka]=N[Ja]=N[Ya]=N[Za]=N[Qa]=N[ef]=N[tf]=N[rf]=!0;N[me]=N[Tt]=N[ex]=N[Wn]=N[Ae]=N[qn]=N[Kn]=N[Jn]=N[ye]=N[Yn]=N[$0]=N[Zn]=N[we]=N[Qn]=N[Lt]=!1;var tx=typeof global=="object"&&global&&global.Object===Object&&global,ff=typeof self=="object"&&self&&self.Object===Object&&self,o0=tx||ff||Function("return this")(),rx=typeof J0=="object"&&J0&&!J0.nodeType&&J0,Hn=rx&&typeof P0=="object"&&P0&&!P0.nodeType&&P0,nx=Hn&&Hn.exports===rx,It=nx&&tx.process,Rn=function(){try{return It&&It.binding&&It.binding("util")}catch{}}(),Mn=Rn&&Rn.isTypedArray;function cf(t,e){for(var r=-1,n=t==null?0:t.length,x=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[x++]=a)}return i}function of(t,e){for(var r=-1,n=e.length,x=t.length;++r<n;)t[x+r]=e[r];return t}function sf(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function df(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function uf(t){return function(e){return t(e)}}function hf(t,e){return t.has(e)}function lf(t,e){return t?.[e]}function bf(t){var e=-1,r=Array(t.size);return t.forEach(function(n,x){r[++e]=[x,n]}),r}function pf(t,e){return function(r){return t(e(r))}}function gf(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var mf=Array.prototype,yf=Function.prototype,Ie=Object.prototype,Ct=o0["__core-js_shared__"],xx=yf.toString,i0=Ie.hasOwnProperty,Vn=function(){var t=/[^.]+$/.exec(Ct&&Ct.keys&&Ct.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ix=Ie.toString,wf=RegExp("^"+xx.call(i0).replace(nf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dn=nx?o0.Buffer:void 0,_e=o0.Symbol,Nn=o0.Uint8Array,ax=Ie.propertyIsEnumerable,Af=mf.splice,I0=_e?_e.toStringTag:void 0,$n=Object.getOwnPropertySymbols,_f=Dn?Dn.isBuffer:void 0,Bf=pf(Object.keys,Object),Ft=G0(o0,"DataView"),Y0=G0(o0,"Map"),kt=G0(o0,"Promise"),St=G0(o0,"Set"),Ot=G0(o0,"WeakMap"),Z0=G0(Object,"create"),vf=T0(Ft),Ef=T0(Y0),If=T0(kt),Cf=T0(St),Uf=T0(Ot),Pn=_e?_e.prototype:void 0,Ut=Pn?Pn.valueOf:void 0;function C0(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Tf(){this.__data__=Z0?Z0(null):{},this.size=0}function Lf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Ff(t){var e=this.__data__;if(Z0){var r=e[t];return r===Rt?void 0:r}return i0.call(e,t)?e[t]:void 0}function kf(t){var e=this.__data__;return Z0?e[t]!==void 0:i0.call(e,t)}function Sf(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Z0&&e===void 0?Rt:e,this}C0.prototype.clear=Tf;C0.prototype.delete=Lf;C0.prototype.get=Ff;C0.prototype.has=kf;C0.prototype.set=Sf;function s0(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Of(){this.__data__=[],this.size=0}function Hf(t){var e=this.__data__,r=Ce(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Af.call(e,r,1),--this.size,!0}function Rf(t){var e=this.__data__,r=Ce(e,t);return r<0?void 0:e[r][1]}function Mf(t){return Ce(this.__data__,t)>-1}function Vf(t,e){var r=this.__data__,n=Ce(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}s0.prototype.clear=Of;s0.prototype.delete=Hf;s0.prototype.get=Rf;s0.prototype.has=Mf;s0.prototype.set=Vf;function U0(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Df(){this.size=0,this.__data__={hash:new C0,map:new(Y0||s0),string:new C0}}function Nf(t){var e=Ue(this,t).delete(t);return this.size-=e?1:0,e}function $f(t){return Ue(this,t).get(t)}function Pf(t){return Ue(this,t).has(t)}function Gf(t,e){var r=Ue(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}U0.prototype.clear=Df;U0.prototype.delete=Nf;U0.prototype.get=$f;U0.prototype.has=Pf;U0.prototype.set=Gf;function Be(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new U0;++e<r;)this.add(t[e])}function zf(t){return this.__data__.set(t,Rt),this}function Xf(t){return this.__data__.has(t)}Be.prototype.add=Be.prototype.push=zf;Be.prototype.has=Xf;function _0(t){var e=this.__data__=new s0(t);this.size=e.size}function jf(){this.__data__=new s0,this.size=0}function Wf(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function qf(t){return this.__data__.get(t)}function Kf(t){return this.__data__.has(t)}function Jf(t,e){var r=this.__data__;if(r instanceof s0){var n=r.__data__;if(!Y0||n.length<$a-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new U0(n)}return r.set(t,e),this.size=r.size,this}_0.prototype.clear=jf;_0.prototype.delete=Wf;_0.prototype.get=qf;_0.prototype.has=Kf;_0.prototype.set=Jf;function Yf(t,e){var r=ve(t),n=!r&&uc(t),x=!r&&!n&&Ht(t),i=!r&&!n&&!x&&hx(t),a=r||n||x||i,f=a?df(t.length,String):[],c=f.length;for(var s in t)(e||i0.call(t,s))&&!(a&&(s=="length"||x&&(s=="offset"||s=="parent")||i&&(s=="buffer"||s=="byteLength"||s=="byteOffset")||fc(s,c)))&&f.push(s);return f}function Ce(t,e){for(var r=t.length;r--;)if(ox(t[r][0],e))return r;return-1}function Zf(t,e,r){var n=e(t);return ve(t)?n:of(n,r(t))}function ee(t){return t==null?t===void 0?Wa:za:I0&&I0 in Object(t)?ic(t):dc(t)}function Gn(t){return Q0(t)&&ee(t)==me}function fx(t,e,r,n,x){return t===e?!0:t==null||e==null||!Q0(t)&&!Q0(e)?t!==t&&e!==e:Qf(t,e,r,n,fx,x)}function Qf(t,e,r,n,x,i){var a=ve(t),f=ve(e),c=a?Tt:A0(t),s=f?Tt:A0(e);c=c==me?$0:c,s=s==me?$0:s;var h=c==$0,u=s==$0,m=c==s;if(m&&Ht(t)){if(!Ht(e))return!1;a=!0,h=!1}if(m&&!h)return i||(i=new _0),a||hx(t)?cx(t,e,r,n,x,i):nc(t,e,c,r,n,x,i);if(!(r&Ee)){var p=h&&i0.call(t,"__wrapped__"),v=u&&i0.call(e,"__wrapped__");if(p||v){var g=p?t.value():t,b=v?e.value():e;return i||(i=new _0),x(g,b,r,n,i)}}return m?(i||(i=new _0),xc(t,e,r,n,x,i)):!1}function ec(t){if(!ux(t)||oc(t))return!1;var e=sx(t)?wf:xf;return e.test(T0(t))}function tc(t){return Q0(t)&&dx(t.length)&&!!N[ee(t)]}function rc(t){if(!sc(t))return Bf(t);var e=[];for(var r in Object(t))i0.call(t,r)&&r!="constructor"&&e.push(r);return e}function cx(t,e,r,n,x,i){var a=r&Ee,f=t.length,c=e.length;if(f!=c&&!(a&&c>f))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var h=-1,u=!0,m=r&Xn?new Be:void 0;for(i.set(t,e),i.set(e,t);++h<f;){var p=t[h],v=e[h];if(n)var g=a?n(v,p,h,e,t,i):n(p,v,h,t,e,i);if(g!==void 0){if(g)continue;u=!1;break}if(m){if(!sf(e,function(b,y){if(!hf(m,y)&&(p===b||x(p,b,r,n,i)))return m.push(y)})){u=!1;break}}else if(!(p===v||x(p,v,r,n,i))){u=!1;break}}return i.delete(t),i.delete(e),u}function nc(t,e,r,n,x,i,a){switch(r){case Ae:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ex:return!(t.byteLength!=e.byteLength||!i(new Nn(t),new Nn(e)));case Wn:case qn:case Yn:return ox(+t,+e);case Kn:return t.name==e.name&&t.message==e.message;case Zn:case Qn:return t==e+"";case ye:var f=bf;case we:var c=n&Ee;if(f||(f=gf),t.size!=e.size&&!c)return!1;var s=a.get(t);if(s)return s==e;n|=Xn,a.set(t,e);var h=cx(f(t),f(e),n,x,i,a);return a.delete(t),h;case ja:if(Ut)return Ut.call(t)==Ut.call(e)}return!1}function xc(t,e,r,n,x,i){var a=r&Ee,f=zn(t),c=f.length,s=zn(e),h=s.length;if(c!=h&&!a)return!1;for(var u=c;u--;){var m=f[u];if(!(a?m in e:i0.call(e,m)))return!1}var p=i.get(t);if(p&&i.get(e))return p==e;var v=!0;i.set(t,e),i.set(e,t);for(var g=a;++u<c;){m=f[u];var b=t[m],y=e[m];if(n)var B=a?n(y,b,m,e,t,i):n(b,y,m,t,e,i);if(!(B===void 0?b===y||x(b,y,r,n,i):B)){v=!1;break}g||(g=m=="constructor")}if(v&&!g){var A=t.constructor,I=e.constructor;A!=I&&"constructor"in t&&"constructor"in e&&!(typeof A=="function"&&A instanceof A&&typeof I=="function"&&I instanceof I)&&(v=!1)}return i.delete(t),i.delete(e),v}function zn(t){return Zf(t,bc,ac)}function Ue(t,e){var r=t.__data__;return cc(e)?r[typeof e=="string"?"string":"hash"]:r.map}function G0(t,e){var r=lf(t,e);return ec(r)?r:void 0}function ic(t){var e=i0.call(t,I0),r=t[I0];try{t[I0]=void 0;var n=!0}catch{}var x=ix.call(t);return n&&(e?t[I0]=r:delete t[I0]),x}var ac=$n?function(t){return t==null?[]:(t=Object(t),cf($n(t),function(e){return ax.call(t,e)}))}:pc,A0=ee;(Ft&&A0(new Ft(new ArrayBuffer(1)))!=Ae||Y0&&A0(new Y0)!=ye||kt&&A0(kt.resolve())!=On||St&&A0(new St)!=we||Ot&&A0(new Ot)!=Lt)&&(A0=function(t){var e=ee(t),r=e==$0?t.constructor:void 0,n=r?T0(r):"";if(n)switch(n){case vf:return Ae;case Ef:return ye;case If:return On;case Cf:return we;case Uf:return Lt}return e});function fc(t,e){return e=e??jn,!!e&&(typeof t=="number"||af.test(t))&&t>-1&&t%1==0&&t<e}function cc(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function oc(t){return!!Vn&&Vn in t}function sc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ie;return t===r}function dc(t){return ix.call(t)}function T0(t){if(t!=null){try{return xx.call(t)}catch{}try{return t+""}catch{}}return""}function ox(t,e){return t===e||t!==t&&e!==e}var uc=Gn(function(){return arguments}())?Gn:function(t){return Q0(t)&&i0.call(t,"callee")&&!ax.call(t,"callee")},ve=Array.isArray;function hc(t){return t!=null&&dx(t.length)&&!sx(t)}var Ht=_f||gc;function lc(t,e){return fx(t,e)}function sx(t){if(!ux(t))return!1;var e=ee(t);return e==Jn||e==Ga||e==Pa||e==Xa}function dx(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=jn}function ux(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Q0(t){return t!=null&&typeof t=="object"}var hx=Mn?uf(Mn):tc;function bc(t){return hc(t)?Yf(t):rc(t)}function pc(){return[]}function gc(){return!1}P0.exports=lc});var Uc={};Cx(Uc,{validate:()=>Cc});d();d();d();d();d();d();var rt=a0(H0(),1);d();d();d();function $e(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function fi(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function R0(t,...e){if(!fi(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function M0(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function ie(t,e){R0(t);let r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}d();var hr=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),ae=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Z=(t,e)=>t<<32-e|t>>>e;var Pe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,ci=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function Ge(t){for(let e=0;e<t.length;e++)t[e]=ci(t[e])}var oi=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function j0(t){R0(t);let e="";for(let r=0;r<t.length;r++)e+=oi[t[r]];return e}function si(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function D0(t){return typeof t=="string"&&(t=si(t)),R0(t),t}var V0=class{clone(){return this._cloneInto()}},Gc={}.toString;function E0(t){let e=n=>t().update(D0(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function lr(t){let e=(n,x)=>t(x).update(D0(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}function di(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let x=BigInt(32),i=BigInt(4294967295),a=Number(r>>x&i),f=Number(r&i),c=n?4:0,s=n?0:4;t.setUint32(e+c,a,n),t.setUint32(e+s,f,n)}var br=(t,e,r)=>t&e^~t&r,pr=(t,e,r)=>t&e^t&r^e&r,N0=class extends V0{constructor(e,r,n,x){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=x,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ae(this.buffer)}update(e){M0(this);let{view:r,buffer:n,blockLen:x}=this;e=D0(e);let i=e.length;for(let a=0;a<i;){let f=Math.min(x-this.pos,i-a);if(f===x){let c=ae(e);for(;x<=i-a;a+=x)this.process(c,a);continue}n.set(e.subarray(a,a+f),this.pos),this.pos+=f,a+=f,this.pos===x&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){M0(this),ie(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:x,isLE:i}=this,{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>x-a&&(this.process(n,0),a=0);for(let u=a;u<x;u++)r[u]=0;di(n,x-8,BigInt(this.length*8),i),this.process(n,0);let f=ae(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let s=c/4,h=this.get();if(s>h.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<s;u++)f.setUint32(4*u,h[u],i)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:x,finished:i,destroyed:a,pos:f}=this;return e.length=x,e.pos=f,e.finished=i,e.destroyed=a,x%r&&e.buffer.set(n),e}};var ui=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),h0=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),l0=new Uint32Array(64),ze=class extends N0{constructor(){super(64,32,8,!1),this.A=h0[0]|0,this.B=h0[1]|0,this.C=h0[2]|0,this.D=h0[3]|0,this.E=h0[4]|0,this.F=h0[5]|0,this.G=h0[6]|0,this.H=h0[7]|0}get(){let{A:e,B:r,C:n,D:x,E:i,F:a,G:f,H:c}=this;return[e,r,n,x,i,a,f,c]}set(e,r,n,x,i,a,f,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=x|0,this.E=i|0,this.F=a|0,this.G=f|0,this.H=c|0}process(e,r){for(let u=0;u<16;u++,r+=4)l0[u]=e.getUint32(r,!1);for(let u=16;u<64;u++){let m=l0[u-15],p=l0[u-2],v=Z(m,7)^Z(m,18)^m>>>3,g=Z(p,17)^Z(p,19)^p>>>10;l0[u]=g+l0[u-7]+v+l0[u-16]|0}let{A:n,B:x,C:i,D:a,E:f,F:c,G:s,H:h}=this;for(let u=0;u<64;u++){let m=Z(f,6)^Z(f,11)^Z(f,25),p=h+m+br(f,c,s)+ui[u]+l0[u]|0,g=(Z(n,2)^Z(n,13)^Z(n,22))+pr(n,x,i)|0;h=s,s=c,c=f,f=a+p|0,a=i,i=x,x=n,n=p+g|0}n=n+this.A|0,x=x+this.B|0,i=i+this.C|0,a=a+this.D|0,f=f+this.E|0,c=c+this.F|0,s=s+this.G|0,h=h+this.H|0,this.set(n,x,i,a,f,c,s,h)}roundClean(){l0.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var gr=E0(()=>new ze);d();d();var fe=BigInt(4294967295),Xe=BigInt(32);function mr(t,e=!1){return e?{h:Number(t&fe),l:Number(t>>Xe&fe)}:{h:Number(t>>Xe&fe)|0,l:Number(t&fe)|0}}function je(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let x=0;x<t.length;x++){let{h:i,l:a}=mr(t[x],e);[r[x],n[x]]=[i,a]}return[r,n]}var hi=(t,e)=>BigInt(t>>>0)<<Xe|BigInt(e>>>0),li=(t,e,r)=>t>>>r,bi=(t,e,r)=>t<<32-r|e>>>r,pi=(t,e,r)=>t>>>r|e<<32-r,gi=(t,e,r)=>t<<32-r|e>>>r,mi=(t,e,r)=>t<<64-r|e>>>r-32,yi=(t,e,r)=>t>>>r-32|e<<64-r,wi=(t,e)=>e,Ai=(t,e)=>t,We=(t,e,r)=>t<<r|e>>>32-r,qe=(t,e,r)=>e<<r|t>>>32-r,Ke=(t,e,r)=>e<<r-32|t>>>64-r,Je=(t,e,r)=>t<<r-32|e>>>64-r;function _i(t,e,r,n){let x=(e>>>0)+(n>>>0);return{h:t+r+(x/2**32|0)|0,l:x|0}}var Bi=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),vi=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Ei=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Ii=(t,e,r,n,x)=>e+r+n+x+(t/2**32|0)|0,Ci=(t,e,r,n,x)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(x>>>0),Ui=(t,e,r,n,x,i)=>e+r+n+x+i+(t/2**32|0)|0;var Ti={fromBig:mr,split:je,toBig:hi,shrSH:li,shrSL:bi,rotrSH:pi,rotrSL:gi,rotrBH:mi,rotrBL:yi,rotr32H:wi,rotr32L:Ai,rotlSH:We,rotlSL:qe,rotlBH:Ke,rotlBL:Je,add:_i,add3L:Bi,add3H:vi,add4L:Ei,add4H:Ii,add5H:Ui,add5L:Ci},k=Ti;var[Li,Fi]=k.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),b0=new Uint32Array(80),p0=new Uint32Array(80),ce=class extends N0{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:r,Bh:n,Bl:x,Ch:i,Cl:a,Dh:f,Dl:c,Eh:s,El:h,Fh:u,Fl:m,Gh:p,Gl:v,Hh:g,Hl:b}=this;return[e,r,n,x,i,a,f,c,s,h,u,m,p,v,g,b]}set(e,r,n,x,i,a,f,c,s,h,u,m,p,v,g,b){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=x|0,this.Ch=i|0,this.Cl=a|0,this.Dh=f|0,this.Dl=c|0,this.Eh=s|0,this.El=h|0,this.Fh=u|0,this.Fl=m|0,this.Gh=p|0,this.Gl=v|0,this.Hh=g|0,this.Hl=b|0}process(e,r){for(let A=0;A<16;A++,r+=4)b0[A]=e.getUint32(r),p0[A]=e.getUint32(r+=4);for(let A=16;A<80;A++){let I=b0[A-15]|0,T=p0[A-15]|0,D=k.rotrSH(I,T,1)^k.rotrSH(I,T,8)^k.shrSH(I,T,7),P=k.rotrSL(I,T,1)^k.rotrSL(I,T,8)^k.shrSL(I,T,7),z=b0[A-2]|0,j=p0[A-2]|0,E=k.rotrSH(z,j,19)^k.rotrBH(z,j,61)^k.shrSH(z,j,6),O=k.rotrSL(z,j,19)^k.rotrBL(z,j,61)^k.shrSL(z,j,6),U=k.add4L(P,O,p0[A-7],p0[A-16]),L=k.add4H(U,D,E,b0[A-7],b0[A-16]);b0[A]=L|0,p0[A]=U|0}let{Ah:n,Al:x,Bh:i,Bl:a,Ch:f,Cl:c,Dh:s,Dl:h,Eh:u,El:m,Fh:p,Fl:v,Gh:g,Gl:b,Hh:y,Hl:B}=this;for(let A=0;A<80;A++){let I=k.rotrSH(u,m,14)^k.rotrSH(u,m,18)^k.rotrBH(u,m,41),T=k.rotrSL(u,m,14)^k.rotrSL(u,m,18)^k.rotrBL(u,m,41),D=u&p^~u&g,P=m&v^~m&b,z=k.add5L(B,T,P,Fi[A],p0[A]),j=k.add5H(z,y,I,D,Li[A],b0[A]),E=z|0,O=k.rotrSH(n,x,28)^k.rotrBH(n,x,34)^k.rotrBH(n,x,39),U=k.rotrSL(n,x,28)^k.rotrBL(n,x,34)^k.rotrBL(n,x,39),L=n&i^n&f^i&f,$=x&a^x&c^a&c;y=g|0,B=b|0,g=p|0,b=v|0,p=u|0,v=m|0,{h:u,l:m}=k.add(s|0,h|0,j|0,E|0),s=f|0,h=c|0,f=i|0,c=a|0,i=n|0,a=x|0;let S=k.add3L(E,U,$);n=k.add3H(S,j,O,L),x=S|0}({h:n,l:x}=k.add(this.Ah|0,this.Al|0,n|0,x|0)),{h:i,l:a}=k.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:f,l:c}=k.add(this.Ch|0,this.Cl|0,f|0,c|0),{h:s,l:h}=k.add(this.Dh|0,this.Dl|0,s|0,h|0),{h:u,l:m}=k.add(this.Eh|0,this.El|0,u|0,m|0),{h:p,l:v}=k.add(this.Fh|0,this.Fl|0,p|0,v|0),{h:g,l:b}=k.add(this.Gh|0,this.Gl|0,g|0,b|0),{h:y,l:B}=k.add(this.Hh|0,this.Hl|0,y|0,B|0),this.set(n,x,i,a,f,c,s,h,u,m,p,v,g,b,y,B)}roundClean(){b0.fill(0),p0.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var Ye=class extends ce{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}};var yr=E0(()=>new ce);var wr=E0(()=>new Ye);d();var Br=[],vr=[],Er=[],ki=BigInt(0),W0=BigInt(1),Si=BigInt(2),Oi=BigInt(7),Hi=BigInt(256),Ri=BigInt(113);for(let t=0,e=W0,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],Br.push(2*(5*n+r)),vr.push((t+1)*(t+2)/2%64);let x=ki;for(let i=0;i<7;i++)e=(e<<W0^(e>>Oi)*Ri)%Hi,e&Si&&(x^=W0<<(W0<<BigInt(i))-W0);Er.push(x)}var[Mi,Vi]=je(Er,!0),Ar=(t,e,r)=>r>32?Ke(t,e,r):We(t,e,r),_r=(t,e,r)=>r>32?Je(t,e,r):qe(t,e,r);function Di(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){let f=(a+8)%10,c=(a+2)%10,s=r[c],h=r[c+1],u=Ar(s,h,1)^r[f],m=_r(s,h,1)^r[f+1];for(let p=0;p<50;p+=10)t[a+p]^=u,t[a+p+1]^=m}let x=t[2],i=t[3];for(let a=0;a<24;a++){let f=vr[a],c=Ar(x,i,f),s=_r(x,i,f),h=Br[a];x=t[h],i=t[h+1],t[h]=c,t[h+1]=s}for(let a=0;a<50;a+=10){for(let f=0;f<10;f++)r[f]=t[a+f];for(let f=0;f<10;f++)t[a+f]^=~r[(f+2)%10]&r[(f+4)%10]}t[0]^=Mi[n],t[1]^=Vi[n]}r.fill(0)}var oe=class t extends V0{constructor(e,r,n,x=!1,i=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=x,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,$e(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=hr(this.state)}keccak(){Pe||Ge(this.state32),Di(this.state32,this.rounds),Pe||Ge(this.state32),this.posOut=0,this.pos=0}update(e){M0(this);let{blockLen:r,state:n}=this;e=D0(e);let x=e.length;for(let i=0;i<x;){let a=Math.min(r-this.pos,x-i);for(let f=0;f<a;f++)n[this.pos++]^=e[i++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:r,pos:n,blockLen:x}=this;e[n]^=r,r&128&&n===x-1&&this.keccak(),e[x-1]^=128,this.keccak()}writeInto(e){M0(this,!1),R0(e),this.finish();let r=this.state,{blockLen:n}=this;for(let x=0,i=e.length;x<i;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,i-x);e.set(r.subarray(this.posOut,this.posOut+a),x),this.posOut+=a,x+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return $e(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ie(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){let{blockLen:r,suffix:n,outputLen:x,rounds:i,enableXOF:a}=this;return e||(e=new t(r,n,x,a,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=x,e.enableXOF=a,e.destroyed=this.destroyed,e}},g0=(t,e,r)=>E0(()=>new oe(e,t,r)),so=g0(6,144,224/8),uo=g0(6,136,256/8),ho=g0(6,104,384/8),lo=g0(6,72,512/8),bo=g0(1,144,224/8),Ir=g0(1,136,256/8),po=g0(1,104,384/8),go=g0(1,72,512/8),Cr=(t,e,r)=>lr((n={})=>new oe(e,t,n.dkLen===void 0?r:n.dkLen,!0)),mo=Cr(31,168,128/8),yo=Cr(31,136,256/8);d();var c0="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Ni=function(t){let e=[],r=Math.floor(t.length/5),n=t.length%5;if(n!=0){for(let i=0;i<5-n;i++)t+="\0";r+=1}for(let i=0;i<r;i++)e.push(c0.charAt(t.charCodeAt(i*5)>>3)),e.push(c0.charAt((t.charCodeAt(i*5)&7)<<2|t.charCodeAt(i*5+1)>>6)),e.push(c0.charAt((t.charCodeAt(i*5+1)&63)>>1)),e.push(c0.charAt((t.charCodeAt(i*5+1)&1)<<4|t.charCodeAt(i*5+2)>>4)),e.push(c0.charAt((t.charCodeAt(i*5+2)&15)<<1|t.charCodeAt(i*5+3)>>7)),e.push(c0.charAt((t.charCodeAt(i*5+3)&127)>>2)),e.push(c0.charAt((t.charCodeAt(i*5+3)&3)<<3|t.charCodeAt(i*5+4)>>5)),e.push(c0.charAt(t.charCodeAt(i*5+4)&31));let x=0;n==1?x=6:n==2?x=4:n==3?x=3:n==4&&(x=1);for(let i=0;i<x;i++)e.pop();for(let i=0;i<x;i++)e.push("=");return e.join("")},$i=function(t){let e=new ArrayBuffer(t.length*5/8),r=new Uint8Array(e);for(let n=0;n<t.length/8;n++){let x=[0,0,0,0,0,0,0,0];for(let a=0;a<8;++a)x[a]=c0.indexOf(t[n*8+a]);let i=0;r[n*5+0]=x[i+0]<<3|x[i+1]>>2,r[n*5+1]=(x[i+1]&3)<<6|x[i+2]<<1|x[i+3]>>4,r[n*5+2]=(x[i+3]&15)<<4|x[i+4]>>1,r[n*5+3]=(x[i+4]&1)<<7|x[i+5]<<2|x[i+6]>>3,r[n*5+4]=(x[i+6]&7)<<5|x[i+7]}return r},Ur={b32decode:$i,b32encode:Ni};d();var Ze="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Qe={};for(let t=0;t<Ze.length;++t)Qe[Ze.charAt(t)]=t;var Pi=Ze.length,r0={decode:function(t){if(t.length===0)return[];var e,r,n=[0];for(e=0;e<t.length;++e){var x=t[e];if(!(x in Qe))throw new Error("Non-base58 character");for(r=0;r<n.length;++r)n[r]*=Pi;n[0]+=Qe[x];var i=0;for(r=0;r<n.length;++r)n[r]+=i,i=n[r]>>8,n[r]&=255;for(;i;)n.push(i&255),i>>=8}for(e=0;t[e]==="1"&&e<t.length-1;++e)n.push(0);return n.reverse()}};d();q.sigma=[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],[11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4],[7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8],[9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13],[2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9],[12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11],[13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10],[6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5],[10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],[11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4],[7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8],[9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13],[2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]];q.u256=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479];q.padding=w.from([128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);q.prototype._length_carry=function(t){for(var e=0;e<t.length&&!(t[e]<4294967296);++e)t[e]-=4294967296,t[e+1]+=1};q.prototype.update=function(t,e){t=w.from(t,e);for(var r=this._block,n=0;this._blockOffset+t.length-n>=r.length;){for(var x=this._blockOffset;x<r.length;)r[x++]=t[n++];this._length[0]+=r.length*8,this._length_carry(this._length),this._compress(),this._blockOffset=0}for(;n<t.length;)r[this._blockOffset++]=t[n++];return this};var Gi=w.from([1]),zi=w.from([129]);function se(t,e){return(t<<32-e|t>>>e)>>>0}function m0(t,e,r,n,x,i,a,f){var c=q.sigma,s=q.u256;t[n]=t[n]+((e[c[r][f]]^s[c[r][f+1]])>>>0)+t[x]>>>0,t[a]=se(t[a]^t[n],16),t[i]=t[i]+t[a]>>>0,t[x]=se(t[x]^t[i],12),t[n]=t[n]+((e[c[r][f+1]]^s[c[r][f]])>>>0)+t[x]>>>0,t[a]=se(t[a]^t[n],8),t[i]=t[i]+t[a]>>>0,t[x]=se(t[x]^t[i],7)}function q(){this._h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this._s=[0,0,0,0],this._block=w.allocUnsafe(64),this._blockOffset=0,this._length=[0,0],this._nullt=!1,this._zo=Gi,this._oo=zi}q.prototype._compress=function(){var t=q.u256,e=new Array(16),r=new Array(16),n;for(n=0;n<16;++n)r[n]=this._block.readUInt32BE(n*4);for(n=0;n<8;++n)e[n]=this._h[n]>>>0;for(n=8;n<12;++n)e[n]=(this._s[n-8]^t[n-8])>>>0;for(n=12;n<16;++n)e[n]=t[n-8];for(this._nullt||(e[12]=(e[12]^this._length[0])>>>0,e[13]=(e[13]^this._length[0])>>>0,e[14]=(e[14]^this._length[1])>>>0,e[15]=(e[15]^this._length[1])>>>0),n=0;n<14;++n)m0(e,r,n,0,4,8,12,0),m0(e,r,n,1,5,9,13,2),m0(e,r,n,2,6,10,14,4),m0(e,r,n,3,7,11,15,6),m0(e,r,n,0,5,10,15,8),m0(e,r,n,1,6,11,12,10),m0(e,r,n,2,7,8,13,12),m0(e,r,n,3,4,9,14,14);for(n=0;n<16;++n)this._h[n%8]=(this._h[n%8]^e[n])>>>0;for(n=0;n<8;++n)this._h[n]=(this._h[n]^this._s[n%4])>>>0};q.prototype._padding=function(){var t=this._length[0]+this._blockOffset*8,e=this._length[1];t>=4294967296&&(t-=4294967296,e+=1);var r=w.allocUnsafe(8);r.writeUInt32BE(e,0),r.writeUInt32BE(t,4),this._blockOffset===55?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<55?(this._blockOffset===0&&(this._nullt=!0),this._length[0]-=(55-this._blockOffset)*8,this.update(q.padding.slice(0,55-this._blockOffset))):(this._length[0]-=(64-this._blockOffset)*8,this.update(q.padding.slice(0,64-this._blockOffset)),this._length[0]-=55*8,this.update(q.padding.slice(1,56)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=64,this.update(r)};q.prototype.digest=function(t){this._padding();for(var e=w.allocUnsafe(32),r=0;r<8;++r)e.writeUInt32BE(this._h[r],r*4);return e.toString(t)};var Tr=q;d();function de(t,e,r){var n=t[e]+t[r],x=t[e+1]+t[r+1];n>=4294967296&&x++,t[e]=n,t[e+1]=x}function Lr(t,e,r,n){var x=t[e]+r;r<0&&(x+=4294967296);var i=t[e+1]+n;x>=4294967296&&i++,t[e]=x,t[e+1]=i}function Fr(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function y0(t,e,r,n,x,i){var a=q0[x],f=q0[x+1],c=q0[i],s=q0[i+1];de(F,t,e),Lr(F,t,a,f);var h=F[n]^F[t],u=F[n+1]^F[t+1];F[n]=u,F[n+1]=h,de(F,r,n),h=F[e]^F[r],u=F[e+1]^F[r+1],F[e]=h>>>24^u<<8,F[e+1]=u>>>24^h<<8,de(F,t,e),Lr(F,t,c,s),h=F[n]^F[t],u=F[n+1]^F[t+1],F[n]=h>>>16^u<<16,F[n+1]=u>>>16^h<<16,de(F,r,n),h=F[e]^F[r],u=F[e+1]^F[r+1],F[e]=u>>>31^h<<1,F[e+1]=h>>>31^u<<1}var kr=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Xi=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],W=new Uint8Array(Xi.map(function(t){return t*2})),F=new Uint32Array(32),q0=new Uint32Array(32);function Sr(t,e){var r=0;for(r=0;r<16;r++)F[r]=t.h[r],F[r+16]=kr[r];for(F[24]=F[24]^t.t,F[25]=F[25]^t.t/4294967296,e&&(F[28]=~F[28],F[29]=~F[29]),r=0;r<32;r++)q0[r]=Fr(t.b,4*r);for(r=0;r<12;r++)y0(0,8,16,24,W[r*16+0],W[r*16+1]),y0(2,10,18,26,W[r*16+2],W[r*16+3]),y0(4,12,20,28,W[r*16+4],W[r*16+5]),y0(6,14,22,30,W[r*16+6],W[r*16+7]),y0(0,10,20,30,W[r*16+8],W[r*16+9]),y0(2,12,22,24,W[r*16+10],W[r*16+11]),y0(4,14,16,26,W[r*16+12],W[r*16+13]),y0(6,8,18,28,W[r*16+14],W[r*16+15]);for(r=0;r<16;r++)t.h[r]=t.h[r]^F[r]^F[r+16]}var w0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function K0(t,e,r,n){w0.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=t,w0[0]=t,e&&(w0[1]=e.length),w0[2]=1,w0[3]=1,r&&w0.set(r,32),n&&w0.set(n,48);for(var x=0;x<16;x++)this.h[x]=kr[x]^Fr(w0,x*4);e&&(Or(this,e),this.c=128)}K0.prototype.update=function(t){return Or(this,t),this};K0.prototype.digest=function(t){var e=!t||t==="binary"||t==="hex"?new Uint8Array(this.outlen):t;return ji(this,e),t==="hex"?Wi(e):e};K0.prototype.final=K0.prototype.digest;function Or(t,e){for(var r=0;r<e.length;r++)t.c===128&&(t.t+=t.c,Sr(t,!1),t.c=0),t.b[t.c++]=e[r]}function ji(t,e){for(t.t+=t.c;t.c<128;)t.b[t.c++]=0;Sr(t,!0);for(var r=0;r<t.outlen;r++)e[r]=t.h[r>>2]>>8*(r&3);return e}function Wi(t){for(var e="",r=0;r<t.length;r++)e+=qi(t[r]);return e}function qi(t){return t<16?"0"+t.toString(16):t.toString(16)}var et=K0;function Hr(t,e){let r=t.toString(16);return r.length%2===1&&(r="0"+r),r.padStart(e,"0")}function Ki(t){return t>="A"&&t<="F"||t>="a"&&t<="f"||t>="0"&&t<="9"?1:0}function Ji(t){let e=0;return t>="A"&&t<="F"?e=t.charCodeAt(0)-65+10:t>="a"&&t<="f"?e=t.charCodeAt(0)-97+10:t>="0"&&t<="9"&&(e=t.charCodeAt(0)-48),e}function Rr(t){let e="0123456789ABCDEF",r="";return r+=e.charAt(t>>4),r+=e.charAt(t&15),r}function Yi(t){let e="",r=0;for(r=0;r<t.length-1;r++)e+=Rr(t[r]);return e+=Rr(t[r]),e}function tt(t){let e=new Uint8Array(t.length/2),r=0,n=0,x=0,i=0;for(n=0;n<t.length;n++){let a=t.charAt(n);Ki(a)&&(r<<=4,r+=Ji(a),x++,x%2===0&&(e[i++]=r,r=0))}return e}var C={numberToHex:Hr,toHex:function(t){let e="";for(let r=0;r<t.length;r++)e+=Hr(t[r]);return e},sha256:function(t,e="HEX"){return j0(gr(tt(t)))},sha256x2:function(t,e="HEX"){return this.sha256(this.sha256(t,e),e)},sha256Checksum:function(t){return this.sha256(this.sha256(t)).slice(0,8)},sha512:function(t,e="HEX"){return j0(yr(t))},sha512_256:function(t,e="HEX"){return j0(wr(tt(t)))},blake256:function(t){return new Tr().update(t,"hex").digest("hex")},blake256Checksum:function(t){return this.blake256(this.blake256(t)).substr(0,8)},blake2b:function(t,e){return new et(e).update(rt.Buffer.from(t,"hex")).digest("hex")},keccak256:function(t){return j0(Ir(t))},keccak256Checksum:function(t){return this.keccak256(t).toString().substr(0,8)},blake2b256:function(t){return new et(32).update(rt.Buffer.from(t,"hex")).digest("hex")},base58:r0.decode,byteArray2hexStr:Yi,hexStr2byteArray:tt,base32:Ur};d();function H(t){return typeof t=="string"?t:t.address}var Mr=4,Zi=58;function Qi(t){if(t.length!==Zi)return!1;{let e=C.base32.b32decode(t),r=e.slice(0,e.length-Mr),n=C.byteArray2hexStr(e.slice(-4));return C.sha512_256(C.byteArray2hexStr(r)).substr(-Mr*2).toUpperCase()===n}}var nt={isValidAddress:function(t){return Qi(H(t))}};d();d();var Vr="qpzry9x8gf2tvdw0s3jn54khce6mua7l",ea=[996825010,642813549,513874426,1027748829,705979059],xt={BECH32:"bech32",BECH32M:"bech32m"},J={decode:na,encode:ra,encodings:xt,verifyChecksum:Pr};function Dr(t){return t==xt.BECH32?1:t==xt.BECH32M?734539939:null}function Nr(t){for(var e=1,r=0;r<t.length;++r){var n=e>>25;e=(e&33554431)<<5^t[r];for(var x=0;x<5;++x)n>>x&1&&(e^=ea[x])}return e}function $r(t){var e=[],r;for(r=0;r<t.length;++r)e.push(t.charCodeAt(r)>>5);for(e.push(0),r=0;r<t.length;++r)e.push(t.charCodeAt(r)&31);return e}function Pr(t,e,r){return Nr($r(t).concat(e))===Dr(r)}function ta(t,e,r){for(var n=$r(t).concat(e).concat([0,0,0,0,0,0]),x=Nr(n)^Dr(r),i=[],a=0;a<6;++a)i.push(x>>5*(5-a)&31);return i}function ra(t,e,r){for(var n=e.concat(ta(t,e,r)),x=t+"1",i=0;i<n.length;++i)x+=Vr.charAt(n[i]);return x}function na(t,e){var r,n=!1,x=!1;for(r=0;r<t.length;++r){if(t.charCodeAt(r)<33||t.charCodeAt(r)>126)return null;t.charCodeAt(r)>=97&&t.charCodeAt(r)<=122&&(n=!0),t.charCodeAt(r)>=65&&t.charCodeAt(r)<=90&&(x=!0)}if(n&&x)return null;t=t.toLowerCase();var i=t.lastIndexOf("1");if(i<1||i+7>t.length||t.length>110)return null;var a=t.substring(0,i),f=[];for(r=i+1;r<t.length;++r){var c=Vr.indexOf(t.charAt(r));if(c===-1)return null;f.push(c)}return Pr(a,f,e)?{hrp:a,data:f.slice(0,f.length-6)}:null}d();d();function Gr(t,e,r,n){for(var x=0,i=0,a=[],f=(1<<r)-1,c=0;c<t.length;++c){var s=t[c];if(s<0||s>>e)return null;for(x=x<<e|s,i+=e;i>=r;)i-=r,a.push(x>>i&f)}if(n)i>0&&a.push(x<<r-i&f);else if(i>=e||x<<r-i&f)return null;return a}function it(t,e){var r=!1,n=J.decode(e,J.encodings.BECH32);if(n===null&&(n=J.decode(e,J.encodings.BECH32M),r=!0),n===null||n.hrp!==t||n.data.length<1||n.data[0]>16)return null;var x=Gr(n.data.slice(1),5,8,!1);return x===null||x.length<2||x.length>40||n.data[0]===0&&x.length!==20&&x.length!==32||n.data[0]===0&&r||n.data[0]!==0&&!r?null:{version:n.data[0],program:x}}function zr(t,e,r){var n=J.encodings.BECH32;e>0&&(n=J.encodings.BECH32M);var x=J.encode(t,[e].concat(Gr(r,8,5,!0)),n);return it(t,x,n)===null?null:x}function xa(t,e={}){if(!e.bech32Hrp||e.bech32Hrp.length===0)return!1;let r=e.bech32Hrp;for(var n of r){var x=it(n,t);if(x)return zr(n,x.version,x.program)===t.toLowerCase()}return!1}var Xr={encode:zr,decode:it,isValidAddress:xa};var jr=a0(H0(),1);function ia(t){try{return r0.decode(t)}catch{return null}}function aa(t,e){switch(t){case"blake256keccak256":let r=C.blake2b256(e);return C.keccak256Checksum(jr.Buffer.from(r,"hex"));case"blake256":return C.blake256Checksum(e);case"keccak256":return C.keccak256Checksum(e);case"sha256":default:return C.sha256Checksum(e)}}function fa(t,e){let r=e.expectedLength||25,n=e.hashFunction||"sha256",x=ia(t);if(x){let i=x.length;if(i!==r)return null;if(e.regex&&!e.regex.test(t))return!1;let a=C.toHex(x.slice(i-4,i)),f=C.toHex(x.slice(0,i-4)),c=aa(n,f);return a===c?C.toHex(x.slice(0,r-24)):null}return null}function ca(t,e){let r=fa(t,e);return r?e.addressTypes.indexOf(r)>=0:!1}var n0=t=>({isValidAddress(e){let r=H(e);return ca(r,t)||Xr.isValidAddress(r,t)}});function sa(t,e){let r=new RegExp(e.regexp),n,x=t.split(":");if(x.length===1)n=t;else{if(x[0]!=="bitcoincash")return!1;n=x[1]}if(!r.test(n)||n.toLowerCase()!=n&&n.toUpperCase()!=n)return!1;let i=C.base32.b32decode(n),a=e.networkType==="mainnet"?"bitcoincash":"bchtest";try{if(J.verifyChecksum(a,i,J.encodings.BECH32))return!1}catch{return!1}return!0}var da={regexp:/^[qQpP][0-9a-zA-Z]{41}$/},ue=t=>({isValidAddress:function(e){let r=H(e),n={...da,...t};return sa(r,n)||n0(t).isValidAddress(e)}});d();var vn=a0(qr(),1);d();d();d();var ua=(t,e=0)=>{let r=~~e,n=0;for(let x=0;x<t.length;x++)n+=t[x];return r+=n%256,r%256},Kr=ua;d();d();var Jr=a0(H0(),1),ha=(t,e)=>Jr.Buffer.from(t,e),at=ha;function V(t,e){let r=(n,x)=>e(at(n),x)>>>0;return r.signed=(n,x)=>e(at(n),x),r.unsigned=r,r.model=t,r}var Yr=V("crc1",Kr);d();d();var ft=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];typeof Int32Array<"u"&&(ft=new Int32Array(ft));var la=(t,e=0)=>{let r=~~e;for(let n=0;n<t.length;n++)r=ft[(r^t[n])&255]&255;return r},Zr=la;var Qr=V("crc-8",Zr);d();d();var ct=[0,94,188,226,97,63,221,131,194,156,126,32,163,253,31,65,157,195,33,127,252,162,64,30,95,1,227,189,62,96,130,220,35,125,159,193,66,28,254,160,225,191,93,3,128,222,60,98,190,224,2,92,223,129,99,61,124,34,192,158,29,67,161,255,70,24,250,164,39,121,155,197,132,218,56,102,229,187,89,7,219,133,103,57,186,228,6,88,25,71,165,251,120,38,196,154,101,59,217,135,4,90,184,230,167,249,27,69,198,152,122,36,248,166,68,26,153,199,37,123,58,100,134,216,91,5,231,185,140,210,48,110,237,179,81,15,78,16,242,172,47,113,147,205,17,79,173,243,112,46,204,146,211,141,111,49,178,236,14,80,175,241,19,77,206,144,114,44,109,51,209,143,12,82,176,238,50,108,142,208,83,13,239,177,240,174,76,18,145,207,45,115,202,148,118,40,171,245,23,73,8,86,180,234,105,55,213,139,87,9,235,181,54,104,138,212,149,203,41,119,244,170,72,22,233,183,85,11,136,214,52,106,43,117,151,201,74,20,246,168,116,42,200,150,21,75,169,247,182,232,10,84,215,137,107,53];typeof Int32Array<"u"&&(ct=new Int32Array(ct));var ba=(t,e=0)=>{let r=~~e;for(let n=0;n<t.length;n++)r=ct[(r^t[n])&255]&255;return r},en=ba;var tn=V("dallas-1-wire",en);d();d();var ot=[0,213,127,170,254,43,129,84,41,252,86,131,215,2,168,125,82,135,45,248,172,121,211,6,123,174,4,209,133,80,250,47,164,113,219,14,90,143,37,240,141,88,242,39,115,166,12,217,246,35,137,92,8,221,119,162,223,10,160,117,33,244,94,139,157,72,226,55,99,182,28,201,180,97,203,30,74,159,53,224,207,26,176,101,49,228,78,155,230,51,153,76,24,205,103,178,57,236,70,147,199,18,184,109,16,197,111,186,238,59,145,68,107,190,20,193,149,64,234,63,66,151,61,232,188,105,195,22,239,58,144,69,17,196,110,187,198,19,185,108,56,237,71,146,189,104,194,23,67,150,60,233,148,65,235,62,106,191,21,192,75,158,52,225,181,96,202,31,98,183,29,200,156,73,227,54,25,204,102,179,231,50,152,77,48,229,79,154,206,27,177,100,114,167,13,216,140,89,243,38,91,142,36,241,165,112,218,15,32,245,95,138,222,11,161,116,9,220,118,163,247,34,136,93,214,3,169,124,40,253,87,130,255,42,128,85,1,212,126,171,132,81,251,46,122,175,5,208,173,120,210,7,83,134,44,249];typeof Int32Array<"u"&&(ot=new Int32Array(ot));var pa=(t,e=0)=>{let r=~~e;for(let n=0;n<t.length;n++)r=ot[(r^t[n])&255]&255;return r},rn=pa;var nn=V("crc-8-dvbs2",rn);d();d();var st=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];typeof Int32Array<"u"&&(st=new Int32Array(st));var ga=(t,e=0)=>{let r=~~e;for(let n=0;n<t.length;n++)r=(st[(r^t[n])&255]^r>>8)&65535;return r},xn=ga;var an=V("crc-16",xn);d();d();var dt=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];typeof Int32Array<"u"&&(dt=new Int32Array(dt));var ma=(t,e)=>{let r=typeof e<"u"?~~e:65535;for(let n=0;n<t.length;n++)r=(dt[(r>>8^t[n])&255]^r<<8)&65535;return r},fn=ma;var cn=V("ccitt",fn);d();d();var ut=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];typeof Int32Array<"u"&&(ut=new Int32Array(ut));var ya=(t,e)=>{let r=typeof e<"u"?~~e:65535;for(let n=0;n<t.length;n++)r=(ut[(r^t[n])&255]^r>>8)&65535;return r},on=ya;var sn=V("crc-16-modbus",on);d();d();var wa=(t,e)=>{let r=typeof e<"u"?~~e:0;for(let n=0;n<t.length;n++){let x=r>>>8&255;x^=t[n]&255,x^=x>>>4,r=r<<8&65535,r^=x,x=x<<5&65535,r^=x,x=x<<7&65535,r^=x}return r},dn=wa;var un=V("xmodem",dn);d();d();var ht=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960];typeof Int32Array<"u"&&(ht=new Int32Array(ht));var Aa=(t,e)=>{let r=typeof e<"u"?~~e:0;for(let n=0;n<t.length;n++)r=(ht[(r^t[n])&255]^r>>8)&65535;return r},hn=Aa;var ln=V("kermit",hn);d();d();var lt=[0,8801531,9098509,825846,9692897,1419802,1651692,10452759,10584377,2608578,2839604,11344079,3303384,11807523,12104405,4128302,12930697,4391538,5217156,13227903,5679208,13690003,14450021,5910942,6606768,14844747,15604413,6837830,16197969,7431594,8256604,16494759,840169,9084178,8783076,18463,10434312,1670131,1434117,9678590,11358416,2825259,2590173,10602790,4109873,12122826,11821884,3289031,13213536,5231515,4409965,12912278,5929345,14431610,13675660,5693559,6823513,15618722,14863188,6588335,16513208,8238147,7417269,16212302,1680338,10481449,9664223,1391140,9061683,788936,36926,8838341,12067563,4091408,3340262,11844381,2868234,11372785,10555655,2579964,14478683,5939616,5650518,13661357,5180346,13190977,12967607,4428364,8219746,16457881,16234863,7468436,15633027,6866552,6578062,14816117,1405499,9649856,10463030,1698765,8819930,55329,803287,9047340,11858690,3325945,4072975,12086004,2561507,10574104,11387118,2853909,13647026,5664841,5958079,14460228,4446803,12949160,13176670,5194661,7454091,16249200,16476294,8201341,14834538,6559633,6852199,15647388,3360676,11864927,12161705,4185682,10527045,2551230,2782280,11286707,9619101,1346150,1577872,10379115,73852,8875143,9172337,899466,16124205,7357910,8182816,16421083,6680524,14918455,15678145,6911546,5736468,13747439,14507289,5968354,12873461,4334094,5159928,13170435,4167245,12180150,11879232,3346363,11301036,2767959,2532769,10545498,10360692,1596303,1360505,9604738,913813,9157998,8856728,92259,16439492,8164415,7343561,16138546,6897189,15692510,14936872,6662099,5986813,14488838,13733104,5750795,13156124,5174247,4352529,12855018,2810998,11315341,10498427,2522496,12124823,4148844,3397530,11901793,9135439,862644,110658,8912057,1606574,10407765,9590435,1317464,15706879,6940164,6651890,14889737,8145950,16384229,16161043,7394792,5123014,13133629,12910283,4370992,14535975,5997020,5707818,13718737,2504095,10516836,11329682,2796649,11916158,3383173,4130419,12143240,8893606,129117,876971,9121104,1331783,9576124,10389322,1625009,14908182,6633453,6925851,15721184,7380471,16175372,16402682,8127489,4389423,12891860,13119266,5137369,13704398,5722165,6015427,14517560];typeof Int32Array<"u"&&(lt=new Int32Array(lt));var _a=(t,e)=>{let r=typeof e<"u"?~~e:11994318;for(let n=0;n<t.length;n++)r=(lt[(r>>16^t[n])&255]^r<<8)&16777215;return r},bn=_a;var pn=V("crc-24",bn);d();d();var bt=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(bt=new Int32Array(bt));var Ba=(t,e)=>{let r=e===0?0:~~e^-1;for(let n=0;n<t.length;n++)r=bt[(r^t[n])&255]^r>>>8;return r^-1},gn=Ba;var mn=V("crc-32",gn);d();d();var pt=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];typeof Int32Array<"u"&&(pt=new Int32Array(pt));var va=(t,e)=>{let r=typeof e<"u"?~~e:4294967295;for(let n=0;n<t.length;n++)r=pt[(r>>24^t[n])&255]^r<<8;return r},yn=va;var wn=V("crc-32-mpeg",yn);d();d();var gt=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(gt=new Int32Array(gt));var Ea=(t,e=-1)=>{let r=e===0?0:~~e;for(let n=0;n<t.length;n++)r=gt[(r^t[n])&255]^r>>>8;return r},An=Ea;var _n=V("jam",An);var le={crc1:Yr,crc8:Qr,crc81wire:tn,crc8dvbs2:nn,crc16:an,crc16ccitt:cn,crc16modbus:sn,crc16xmodem:un,crc16kermit:ln,crc24:pn,crc32:mn,crc32mpeg2:wn,crcjam:_n};d();var Bn={isValidAddress:function(t,e){let r=J.decode(t,J.encodings.BECH32);if(!r)return!1;let n=r.hrp;return e.bech32Hrp.indexOf(n)!==-1}};function Ia(t){try{let e=r0.decode(t);return vn.default.decode(new Uint8Array(e).buffer)}catch{return null}}function Ca(t){let e=Ia(t);if(!e||!Array.isArray(e)&&e.length!=2)return!1;let r=e[0],n=e[1];return typeof n!="number"?!1:le.crc32(r)==n}function Ua(t,e){return Bn.isValidAddress(t,e)}var mt={isValidAddress(t){let e=H(t);return Ca(H(e))||Ua(e,{bech32Hrp:["addr"]})}};d();function Ta(t){let e=/^[a-z0-9.]+$/g;return t.search(e)!==-1&&t.length===12}var yt={isValidAddress:function(t){return Ta(H(t))}};d();var wt={isValidAddress:function(t){let e=H(t);return/^0x[0-9a-fA-F]{40}$/.test(e)?/^0x[0-9a-f]{40}$/.test(e)||/^0x?[0-9A-F]{40}$/.test(e)?!0:this.verifyChecksum(e):!1},verifyChecksum:function(t){t=t.replace("0x","");let e=C.keccak256(t.toLowerCase());for(let r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0}};d();d();d();var _={};function o(t,e,r){if(r!==_)return t instanceof o?t:typeof t>"u"?G:o.parse(t);for(t=t||[];t.length&&!t[t.length-1];)--t.length;this._d=t,this._s=t.length?e||1:0}o._construct=function(t,e){return new o(t,e,_)};var R=1e7,x0=7;o.base=R;o.base_log10=x0;var G=new o([],0,_);o.ZERO=G;var Q=new o([1],1,_);o.ONE=Q;var be=new o(Q._d,-1,_);o.M_ONE=be;o._0=G;o._1=Q;o.small=[G,Q,new o([2],1,_),new o([3],1,_),new o([4],1,_),new o([5],1,_),new o([6],1,_),new o([7],1,_),new o([8],1,_),new o([9],1,_),new o([10],1,_),new o([11],1,_),new o([12],1,_),new o([13],1,_),new o([14],1,_),new o([15],1,_),new o([16],1,_),new o([17],1,_),new o([18],1,_),new o([19],1,_),new o([20],1,_),new o([21],1,_),new o([22],1,_),new o([23],1,_),new o([24],1,_),new o([25],1,_),new o([26],1,_),new o([27],1,_),new o([28],1,_),new o([29],1,_),new o([30],1,_),new o([31],1,_),new o([32],1,_),new o([33],1,_),new o([34],1,_),new o([35],1,_),new o([36],1,_)];o.digits="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");o.prototype.toString=function(t){if(t=+t||10,t<2||t>36)throw new Error("illegal radix "+t+".");if(this._s===0)return"0";if(t===10){var e=this._s<0?"-":"";e+=this._d[this._d.length-1].toString();for(var r=this._d.length-2;r>=0;r--){for(var n=this._d[r].toString();n.length<x0;)n="0"+n;e+=n}return e}else{var x=o.digits;t=o.small[t];for(var i=this._s,a=this.abs(),f=[],c;a._s!==0;){var s=a.divRem(t);a=s[0],c=s[1],f.push(x[c.valueOf()])}return(i<0?"-":"")+f.reverse().join("")}};o.radixRegex=[/^$/,/^$/,/^[01]*$/,/^[012]*$/,/^[0-3]*$/,/^[0-4]*$/,/^[0-5]*$/,/^[0-6]*$/,/^[0-7]*$/,/^[0-8]*$/,/^[0-9]*$/,/^[0-9aA]*$/,/^[0-9abAB]*$/,/^[0-9abcABC]*$/,/^[0-9a-dA-D]*$/,/^[0-9a-eA-E]*$/,/^[0-9a-fA-F]*$/,/^[0-9a-gA-G]*$/,/^[0-9a-hA-H]*$/,/^[0-9a-iA-I]*$/,/^[0-9a-jA-J]*$/,/^[0-9a-kA-K]*$/,/^[0-9a-lA-L]*$/,/^[0-9a-mA-M]*$/,/^[0-9a-nA-N]*$/,/^[0-9a-oA-O]*$/,/^[0-9a-pA-P]*$/,/^[0-9a-qA-Q]*$/,/^[0-9a-rA-R]*$/,/^[0-9a-sA-S]*$/,/^[0-9a-tA-T]*$/,/^[0-9a-uA-U]*$/,/^[0-9a-vA-V]*$/,/^[0-9a-wA-W]*$/,/^[0-9a-xA-X]*$/,/^[0-9a-yA-Y]*$/,/^[0-9a-zA-Z]*$/];o.parse=function(t,e){function r(u){return u=u.replace(/\s*[*xX]\s*10\s*(\^|\*\*)\s*/,"e"),u.replace(/^([+\-])?(\d+)\.?(\d*)[eE]([+\-]?\d+)$/,function(m,p,v,g,b){b=+b;var y=b<0,B=v.length+b;m=(y?v:g).length,b=(b=Math.abs(b))>=m?b-m+y:0;var A=new Array(b+1).join("0"),I=v+g;return(p||"")+(y?I=A+I:I+=A).substr(0,B+=y?A.length:0)+(B<I.length?"."+I.substr(B):"")})}t=t.toString(),(typeof e>"u"||+e==10)&&(t=r(t));var n;typeof e>"u"?n="0[xcb]":e==16?n="0x":e==8?n="0c":e==2?n="0b":n="";var x=new RegExp("^([+\\-]?)("+n+")?([0-9a-z]*)(?:\\.\\d*)?$","i").exec(t);if(x){var i=x[1]||"+",a=x[2]||"",f=x[3]||"";if(typeof e>"u")a==="0x"||a==="0X"?e=16:a==="0c"||a==="0C"?e=8:a==="0b"||a==="0B"?e=2:e=10;else if(e<2||e>36)throw new Error("Illegal radix "+e+".");if(e=+e,!o.radixRegex[e].test(f))throw new Error("Bad digit for radix "+e);if(f=f.replace(/^0+/,"").split(""),f.length===0)return G;if(i=i==="-"?-1:1,e==10){for(var c=[];f.length>=x0;)c.push(parseInt(f.splice(f.length-o.base_log10,o.base_log10).join(""),10));return c.push(parseInt(f.join(""),10)),new o(c,i,_)}var c=G;e=o.small[e];for(var s=o.small,h=0;h<f.length;h++)c=c.multiply(e).add(s[parseInt(f[h],36)]);return new o(c._d,i,_)}else throw new Error("Invalid BigInteger format: "+t)};o.prototype.add=function(t){if(this._s===0)return o(t);if(t=o(t),t._s===0)return this;if(this._s!==t._s)return t=t.negate(),this.subtract(t);for(var e=this._d,r=t._d,n=e.length,x=r.length,i=new Array(Math.max(n,x)+1),a=Math.min(n,x),f=0,c,s=0;s<a;s++)c=e[s]+r[s]+f,i[s]=c%R,f=c/R|0;for(x>n&&(e=r,n=x),s=a;f&&s<n;s++)c=e[s]+f,i[s]=c%R,f=c/R|0;for(f&&(i[s]=f);s<n;s++)i[s]=e[s];return new o(i,this._s,_)};o.prototype.negate=function(){return new o(this._d,-this._s|0,_)};o.prototype.abs=function(){return this._s<0?this.negate():this};o.prototype.subtract=function(t){if(this._s===0)return o(t).negate();if(t=o(t),t._s===0)return this;if(this._s!==t._s)return t=t.negate(),this.add(t);var e=this;this._s<0&&(e=new o(t._d,1,_),t=new o(this._d,1,_));var r=e.compareAbs(t);if(r===0)return G;if(r<0){var n=t;t=e,e=n}var x=e._d,i=t._d,a=x.length,f=i.length,c=new Array(a),s=0,h,u;for(h=0;h<f;h++)u=x[h]-s-i[h],u<0?(u+=R,s=1):s=0,c[h]=u;for(h=f;h<a;h++){if(u=x[h]-s,u<0)u+=R;else{c[h++]=u;break}c[h]=u}for(;h<a;h++)c[h]=x[h];return new o(c,r,_)};(function(){function t(r,n){for(var x=r._d,i=x.slice(),a=!0,f=0;;){var c=(x[f]||0)+1;if(i[f]=c%R,c<=R-1)break;++f}return new o(i,n,_)}function e(r,n){for(var x=r._d,i=x.slice(),a=!0,f=0;;){var c=(x[f]||0)-1;if(c<0)i[f]=c+R;else{i[f]=c;break}++f}return new o(i,n,_)}o.prototype.next=function(){switch(this._s){case 0:return Q;case-1:return e(this,-1);default:return t(this,1)}},o.prototype.prev=function(){switch(this._s){case 0:return be;case-1:return t(this,-1);default:return e(this,1)}}})();o.prototype.compareAbs=function(t){if(this===t)return 0;if(!(t instanceof o)){if(!isFinite(t))return isNaN(t)?t:-1;t=o(t)}if(this._s===0)return t._s!==0?-1:0;if(t._s===0)return 1;var e=this._d.length,r=t._d.length;if(e<r)return-1;if(e>r)return 1;for(var n=this._d,x=t._d,i=e-1;i>=0;i--)if(n[i]!==x[i])return n[i]<x[i]?-1:1;return 0};o.prototype.compare=function(t){if(this===t)return 0;if(t=o(t),this._s===0)return-t._s;if(this._s===t._s){var e=this.compareAbs(t);return e*this._s}else return this._s};o.prototype.isUnit=function(){return this===Q||this===be||this._d.length===1&&this._d[0]===1};o.prototype.multiply=function(t){if(this._s===0||(t=o(t),t._s===0))return G;if(this.isUnit())return this._s<0?t.negate():t;if(t.isUnit())return t._s<0?this.negate():this;if(this===t)return this.square();var e=this._d.length>=t._d.length,r=(e?this:t)._d,n=(e?t:this)._d,x=r.length,i=n.length,a=x+i,f=new Array(a),c;for(c=0;c<a;c++)f[c]=0;for(c=0;c<i;c++){for(var s=0,h=n[c],u=x+c,m,p=c;p<u;p++)m=f[p]+h*r[p-c]+s,s=m/R|0,f[p]=m%R|0;s&&(m=f[p]+s,s=m/R|0,f[p]=m%R)}return new o(f,this._s*t._s,_)};o.prototype.multiplySingleDigit=function(t){if(t===0||this._s===0)return G;if(t===1)return this;var e;if(this._d.length===1)return e=this._d[0]*t,e>=R?new o([e%R|0,e/R|0],1,_):new o([e],1,_);if(t===2)return this.add(this);if(this.isUnit())return new o([t],1,_);for(var r=this._d,n=r.length,x=n+1,i=new Array(x),a=0;a<x;a++)i[a]=0;for(var f=0,c=0;c<n;c++)e=t*r[c]+f,f=e/R|0,i[c]=e%R|0;return f&&(i[c]=f),new o(i,1,_)};o.prototype.square=function(){if(this._s===0)return G;if(this.isUnit())return Q;var t=this._d,e=t.length,r=new Array(e+e+1),n,x,i,a;for(a=0;a<e;a++)i=a*2,n=t[a]*t[a],x=n/R|0,r[i]=n%R,r[i+1]=x;for(a=0;a<e;a++){x=0,i=a*2+1;for(var f=a+1;f<e;f++,i++)n=t[f]*t[a]*2+r[i]+x,x=n/R|0,r[i]=n%R;i=e+a;var c=x+r[i];x=c/R|0,r[i]=c%R,r[i+1]+=x}return new o(r,1,_)};o.prototype.quotient=function(t){return this.divRem(t)[0]};o.prototype.divide=o.prototype.quotient;o.prototype.remainder=function(t){return this.divRem(t)[1]};o.prototype.divRem=function(t){if(t=o(t),t._s===0)throw new Error("Divide by zero");if(this._s===0)return[G,G];if(t._d.length===1)return this.divRemSmall(t._s*t._d[0]);switch(this.compareAbs(t)){case 0:return[this._s===t._s?Q:be,G];case-1:return[G,this]}for(var e=this._s*t._s,r=t.abs(),n=this._d,x=n.length,i=t._d.length,a=[],f,c=new o([],0,_);x;){if(c._d.unshift(n[--x]),c=new o(c._d,1,_),c.compareAbs(t)<0){a.push(0);continue}if(c._s===0)f=0;else{var s=c._d.length,h=r._d.length,u=c._d[s-1]*R+c._d[s-2],m=r._d[h-1]*R+r._d[h-2];c._d.length>r._d.length&&(u=(u+1)*R),f=Math.ceil(u/m)}do{var p=r.multiplySingleDigit(f);if(p.compareAbs(c)<=0)break;f--}while(f);if(a.push(f),!!f){var v=c.subtract(p);c._d=v._d.slice()}}return[new o(a.reverse(),e,_),new o(c._d,this._s,_)]};o.prototype.divRemSmall=function(t){var e;if(t=+t,t===0)throw new Error("Divide by zero");var r=t<0?-1:1,n=this._s*r;if(t=Math.abs(t),t<1||t>=R)throw new Error("Argument out of range");if(this._s===0)return[G,G];if(t===1||t===-1)return[n===1?this.abs():new o(this._d,n,_),G];if(this._d.length===1){var x=new o([this._d[0]/t|0],1,_);return e=new o([this._d[0]%t|0],1,_),n<0&&(x=x.negate()),this._s<0&&(e=e.negate()),[x,e]}for(var i=this._d.slice(),a=new Array(i.length),f=0,c=0,s=0,h;i.length;){if(f=f*R+i[i.length-1],f<t){a[s++]=0,i.pop(),c=R*c+f;continue}f===0?h=0:h=f/t|0;var u=t*h;if(c=f-u,a[s++]=h,!h){i.pop();continue}i.pop(),f=c}return e=new o([c],1,_),this._s<0&&(e=e.negate()),[new o(a.reverse(),n,_),e]};o.prototype.isEven=function(){var t=this._d;return this._s===0||t.length===0||t[0]%2===0};o.prototype.isOdd=function(){return!this.isEven()};o.prototype.sign=function(){return this._s};o.prototype.isPositive=function(){return this._s>0};o.prototype.isNegative=function(){return this._s<0};o.prototype.isZero=function(){return this._s===0};o.prototype.exp10=function(t){if(t=+t,t===0)return this;if(Math.abs(t)>Number(At))throw new Error("exponent too large in BigInteger.exp10");if(this._s===0)return G;if(t>0){for(var e=new o(this._d.slice(),this._s,_);t>=x0;t-=x0)e._d.unshift(0);return t==0?e:(e._s=1,e=e.multiplySingleDigit(Math.pow(10,t)),this._s<0?e.negate():e)}else{if(-t>=this._d.length*x0)return G;var e=new o(this._d.slice(),this._s,_);for(t=-t;t>=x0;t-=x0)e._d.shift();return t==0?e:e.divRemSmall(Math.pow(10,t))[0]}};o.prototype.pow=function(t){if(this.isUnit())return this._s>0?this:o(t).isOdd()?this:this.negate();if(t=o(t),t._s===0)return Q;if(t._s<0){if(this._s===0)throw new Error("Divide by zero");return G}if(this._s===0)return G;if(t.isUnit())return this;if(t.compareAbs(At)>0)throw new Error("exponent too large in BigInteger.pow");for(var e=this,r=Q,n=o.small[2];t.isPositive();){if(t.isOdd()&&(r=r.multiply(e),t.isUnit()))return r;e=e.square(),t=t.quotient(n)}return r};o.prototype.modPow=function(t,e){for(var r=Q,n=this;t.isPositive();)t.isOdd()&&(r=r.multiply(n).remainder(e)),t=t.quotient(o.small[2]),t.isPositive()&&(n=n.square().remainder(e));return r};o.prototype.log=function(){switch(this._s){case 0:return-1/0;case-1:return NaN;default:}var t=this._d.length;if(t*x0<30)return Math.log(this.valueOf());var e=Math.ceil(30/x0),r=this._d.slice(t-e);return Math.log(new o(r,1,_).valueOf())+(t-e)*Math.log(R)};o.prototype.valueOf=function(){return parseInt(this.toString(),10)};o.prototype.toJSValue=function(){return parseInt(this.toString(),10)};o.prototype.lowVal=function(){return this._d[0]||0};var At=o(2147483647);o.MAX_EXP=At;(function(){function t(n){return function(x){return n.call(o(x))}}function e(n){return function(x,i){return n.call(o(x),o(i))}}function r(n){return function(x,i,a){return n.call(o(x),o(i),o(a))}}(function(){var n,x,i="toJSValue,isEven,isOdd,sign,isZero,isNegative,abs,isUnit,square,negate,isPositive,toString,next,prev,log".split(","),a="compare,remainder,divRem,subtract,add,quotient,divide,multiply,pow,compareAbs".split(","),f=["modPow"];for(n=0;n<i.length;n++)x=i[n],o[x]=t(o.prototype[x]);for(n=0;n<a.length;n++)x=a[n],o[x]=e(o.prototype[x]);for(n=0;n<f.length;n++)x=f[n],o[x]=r(o.prototype[x]);o.exp10=function(c,s){return o(c).exp10(s)}})()})();var La=function(){for(var t={},e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",r=[],n=0;n<e.length;n++)r.push(e.charCodeAt(n));var x=[0,2,3,5,6,7,9,10,11],i=r.length,a=8,f=11,c=new o(2).pow(64);function s(g){if(g.length%2!==0)throw"Hex string has invalid length!";for(var b=new Uint8Array(g.length/2),y=0;y<g.length/2;++y)b[y]=parseInt(g.slice(y*2,y*2+2),16);return b}function h(g){for(var b=[],y=0;y<g.length;++y)b.push(("0"+g[y].toString(16)).slice(-2));return b.join("")}function u(g){for(var b=new Uint8Array(g.length),y=0;y<g.length;y++)b[y]=g.charCodeAt(y);return b}function m(g){for(var b=[],y=0;y<g.length;y++)b.push(String.fromCharCode(g[y]));return b.join("")}function p(g){if(g.length<1||g.length>8)throw"Invalid input length";var b=o.ZERO,y=new o(2).pow(8),B=0;switch(9-g.length){case 1:b=b.add(g[B++]);case 2:b=b.multiply(y).add(g[B++]);case 3:b=b.multiply(y).add(g[B++]);case 4:b=b.multiply(y).add(g[B++]);case 5:b=b.multiply(y).add(g[B++]);case 6:b=b.multiply(y).add(g[B++]);case 7:b=b.multiply(y).add(g[B++]);case 8:b=b.multiply(y).add(g[B++]);break;default:throw"Impossible condition"}return b}function v(g,b){var y=new Uint8Array(b);if(b<1||b>8)throw"Invalid input length";for(var B=new o(2).pow(8),A=b-1;A>=0;A--)y[A]=g.remainder(B).toJSValue(),g=g.divide(B);return y}return t.encode_block=function(g,b,y){if(g.length<1||g.length>f)throw"Invalid block length: "+g.length;for(var B=p(g),A=x[g.length]-1;B.compare(0)===1;){var I=B.divRem(i),T=I[1];B=I[0],b[y+A]=r[T.toJSValue()],A--}return b},t.encode=function(g){var b=s(g);if(b.length===0)return"";var y=Math.floor(b.length/a),B=b.length%a,A=y*f+x[B],I=new Uint8Array(A),T;for(T=0;T<A;++T)I[T]=r[0];for(T=0;T<y;T++)I=t.encode_block(b.subarray(T*a,T*a+a),I,T*f);return B>0&&(I=t.encode_block(b.subarray(y*a,y*a+B),I,y*f)),m(I)},t.decode_block=function(g,b,y){if(g.length<1||g.length>f)throw"Invalid block length: "+g.length;var B=x.indexOf(g.length);if(B<=0)throw"Invalid block size";for(var A=new o(0),I=new o(1),T=g.length-1;T>=0;T--){var D=r.indexOf(g[T]);if(D<0)throw"Invalid symbol";var P=I.multiply(D).add(A);if(P.compare(c)===1)throw"Overflow";A=P,I=I.multiply(i)}if(B<a&&new o(2).pow(8*B).compare(A)<=0)throw"Overflow 2";return b.set(v(A,B),y),b},t.decode=function(g){if(g=u(g),g.length===0)return"";var b=Math.floor(g.length/f),y=g.length%f,B=x.indexOf(y);if(B<0)throw"Invalid encoded length";for(var A=b*a+B,I=new Uint8Array(A),T=0;T<b;T++)I=t.decode_block(g.subarray(T*f,T*f+f),I,T*a);return y>0&&(I=t.decode_block(g.subarray(b*f,b*f+y),I,b*a)),h(I)},t}(),En=La;var Fa=new RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{95}$"),ka=new RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{106}$"),In={addressTypes:{mainnet:["18","42"],testnet:["53","63"],stagenet:["24"]},iAddressTypes:{mainnet:["19"],testnet:["54"],stagenet:["25"]}};function Sa(t,e,r){let n=r==="integrated"?In.iAddressTypes[e]:In.addressTypes[e],x=parseInt(t.substr(0,2),16).toString();switch(e){case"mainnet":return n.indexOf(x)>=0;case"testnet":return n.indexOf(x)>=0;default:return!1}}function Oa(t){if(t.length%2!==0)return null;let e=new Uint8Array(t.length/2);for(let r=0;r<t.length/2;++r)e[r]=parseInt(t.slice(r*2,r*2+2),16);return e}var pe=t=>({isValidAddress(e){let r=H(e),n="standard";if(!Fa.test(r))if(ka.test(r))n="integrated";else return!1;let x=En.decode(r);if(!x||!Sa(x,t,n))return!1;let i=x.slice(-8),a=C.keccak256Checksum(Oa(x.slice(0,-8)));return i===a}});d();var Cn=a0(H0(),1);var _t={isValidAddress(t){let e=H(t).toString().toUpperCase().replace(/-/g,"");if(!t||e.length!==40)return!1;let r=C.toHex(C.base32.b32decode(e));return C.keccak256Checksum(Cn.Buffer.from(r.slice(0,42),"hex"))===r.slice(42)}};d();var Ln=a0(ge(),1);var Fn="13456789abcdefghijkmnopqrstuwxyz",Ra=(0,Ln.default)(Fn),Tn=new RegExp("^(xrb|nano)_(["+Fn+"]{60})$"),Bt={isValidAddress(t){let e=H(t);return Tn.test(e)?this.verifyChecksum(e):!1},verifyChecksum:function(t){let e=Ra.decode(Tn.exec(t)[2]).slice(-37),r=C.blake2b(C.toHex(e.slice(0,-5)),5),n=C.toHex(e.slice(-5).reverse());return r===n}};d();var Ma=[{addressLength:3,accountIndexLength:1,checkSumLength:1},{addressLength:4,accountIndexLength:2,checkSumLength:1},{addressLength:5,accountIndexLength:2,checkSumLength:2},{addressLength:6,accountIndexLength:4,checkSumLength:1},{addressLength:7,accountIndexLength:4,checkSumLength:2},{addressLength:8,accountIndexLength:4,checkSumLength:3},{addressLength:9,accountIndexLength:4,checkSumLength:4},{addressLength:10,accountIndexLength:8,checkSumLength:1},{addressLength:11,accountIndexLength:8,checkSumLength:2},{addressLength:12,accountIndexLength:8,checkSumLength:3},{addressLength:13,accountIndexLength:8,checkSumLength:4},{addressLength:14,accountIndexLength:8,checkSumLength:5},{addressLength:15,accountIndexLength:8,checkSumLength:6},{addressLength:16,accountIndexLength:8,checkSumLength:7},{addressLength:17,accountIndexLength:8,checkSumLength:8},{addressLength:34,accountIndexLength:32,checkSumLength:2}];function Va(t){try{let e="53533538505245",r=C.base58(t),n=C.byteArray2hexStr(r.slice(0,1)),x=r.slice(1),i=Ma.find(s=>s.addressLength===x.length);if(!i)throw new Error("Invalid address length");let a=C.byteArray2hexStr(x.slice(0,i.accountIndexLength)),f=C.byteArray2hexStr(x.slice(-i.checkSumLength));return C.blake2b(e+n+a,64).substr(0,i.checkSumLength*2).toUpperCase()==f}catch{return!1}}var vt={isValidAddress(t){return Va(H(t))}};d();var kn=a0(ge(),1);var Sn="rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz",Da=(0,kn.default)(Sn),Na=new RegExp("^r["+Sn+"]{27,35}$"),Et={isValidAddress:function(t){let e=H(t),r=t.destinationTag;return Na.test(e)&&this.verifyChecksum(e)&&this.verifyMemo(r)},verifyMemo(t){return!t||/[0-9]+/.test(t)},verifyChecksum:function(t){let e=Da.decode(t),r=C.sha256Checksum(C.toHex(e.slice(0,-4))),n=C.toHex(e.slice(-4));return r===n}};d();var bx=a0(lx(),1);function mc(t){let e=t.slice(0,64),r=t.slice(32*2,38*2),n=C.blake2b(e,32).slice(0,6*2);return!!(0,bx.default)(n,r)}var Mt={isValidAddress:function(t){let e=H(t);return e.length!==76?!1:mc(e)}};d();d();var px={isValidAddress:function(t,e){try{if(!t||t.length==0||e.minLength&&t.length<e.minLength||e.maxLength&&t.length>e.maxLength)return!1;try{let r=r0.decode(t);if(!r||!r.length)return!1}catch{return!1}return!0}catch{return!1}}};var Vt={isValidAddress:function(t){return px.isValidAddress(H(t),{maxLength:44,minLength:43})}};d();var yc=new Uint8Array([6,161,159]);function wc(t){let e=t.slice(0,-4),r=t.slice(-4),n=C.hexStr2byteArray(C.sha256x2(C.byteArray2hexStr(e)));if(!(r[0]^n[0]|r[1]^n[1]|r[2]^n[2]|r[3]^n[3]))return e}var Dt={isValidAddress(t){try{let e=r0.decode(H(t)),r=wc(e);return r?(r.slice(yc.length),!0):!1}catch{return!1}}};d();function Ac(t){if(typeof t!="string"||t.length!==34)return!1;let e;try{e=C.base58(t)}catch{return!1}let n=e.length-4,x=e.slice(n);e=e.slice(0,n);let i=C.sha256(C.byteArray2hexStr(e)),f=C.hexStr2byteArray(C.sha256(i)).slice(0,4);return x[0]===f[0]&&x[1]===f[1]&&x[2]===f[2]&&x[3]===f[3]?e:!1}var _c={addressTypes:["65"]},Nt=t=>({isValidAddress:function(e){let r={..._c,...t},n=Ac(H(e));return!n||n.length!==21?!1:r.addressTypes.includes(n[0].toString())}});d();var gx=a0(ge(),1);var mx="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Bc=(0,gx.default)(mx),vc=new RegExp("^["+mx+"]{56}$"),Ec=48;function Ic(t){let e=t&255,r=t>>8&255;return e<<8|r}var $t={isValidAddress(t){let e=H(t);return vc.test(e)?this.verifyChecksum(e):!1},verifyChecksum:function(t){var e=Bc.decode(t);if(e[0]!==Ec)return!1;let r=C.numberToHex(Ic(le.crc16xmodem(e.slice(0,-2))),4),n=C.toHex(e.slice(-2));return r===n}};var Te={algorand:{validator:nt},bitcoin:{alternatives:["btc","omni"],validator:{mainnet:n0({addressTypes:["00","05"],bech32Hrp:["bc"]}),testnet:n0({addressTypes:["6f","c4","3c","26"],bech32Hrp:["tb"]})}},bitcoincash:{alternatives:["bch","bitcoin-cash","bitcoin cash"],validator:{mainnet:ue({addressTypes:["00","05"],bech32Hrp:["bc"],networkType:"mainnet"}),testnet:ue({addressTypes:["6f","c4","3c","26"],bech32Hrp:["tb"],networkType:"testnet"})}},cardano:{alternatives:["ada"],validator:mt},doge:{alternatives:["dogecoin"],validator:{mainnet:n0({addressTypes:["1e","16"]}),testnet:n0({addressTypes:["71","c4"]})}},eos:{validator:yt},ethereum:{alternatives:["eth","erc20","flare","avalanche","avalanche-c","bsc","bnb","binance"],validator:wt},litecoin:{alternatives:["ltc"],validator:{mainnet:n0({addressTypes:["30","05","32"],bech32Hrp:["ltc"]}),testnet:n0({addressTypes:["6f","c4","3a"],bech32Hrp:["tltc"]})}},monero:{validator:{mainnet:pe("mainnet"),testnet:pe("testnet")}},nem:{validator:_t},nano:{validator:Bt},polkadot:{validator:vt},ripple:{alternatives:["xrp"],validator:Et},sia:{validator:Mt},solana:{alternatives:["spl"],validator:Vt},tron:{alternatives:["trc20"],validator:Nt()},tezos:{validator:Dt},xlm:{alternatives:["stellar"],validator:$t}};function yx(t){let e=t.chain||t,r=t.networkType||"mainnet",n=Object.keys(Te).find(x=>x.toUpperCase()===e.toUpperCase()||Te[x]?.alternatives?.map(i=>i.toUpperCase())?.includes(e.toUpperCase()));return Te[n]?.validator[r]||Te[n]?.validator}function Cc(t,e){let r=yx(e);if(r)return r.isValidAddress(t);throw new Error(`Missing validator for chain: ${e}`)}return Ux(Uc);})();
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
ieee754/index.js:
|
|
5
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
6
|
+
|
|
7
|
+
buffer/index.js:
|
|
8
|
+
(*!
|
|
9
|
+
* The buffer module from node.js, for the browser.
|
|
10
|
+
*
|
|
11
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
12
|
+
* @license MIT
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
@noble/hashes/esm/utils.js:
|
|
16
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
17
|
+
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getValidatorForChain } from './chain-validators.js';
|
|
2
|
+
export function validate(address, chain) {
|
|
3
|
+
const validator = getValidatorForChain(chain);
|
|
4
|
+
if (validator) {
|
|
5
|
+
return validator.isValidAddress(address);
|
|
6
|
+
}
|
|
7
|
+
throw new Error(`Missing validator for chain: ${chain}`);
|
|
8
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type Address = string | {
|
|
2
|
+
address: string;
|
|
3
|
+
memo?: string;
|
|
4
|
+
};
|
|
5
|
+
export type Chain = string | {
|
|
6
|
+
chain: string;
|
|
7
|
+
networkType?: NetworkType;
|
|
8
|
+
};
|
|
9
|
+
export interface Validator {
|
|
10
|
+
isValidAddress(address: Address): boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare enum NetworkType {
|
|
13
|
+
MainNet = "mainnet",
|
|
14
|
+
TestNet = "testnet"
|
|
15
|
+
}
|
package/dist/types.js
ADDED